I can see something that might be a bug in weld. I attempted to work 
around https://issues.jboss.org/projects/WELD/issues/WELD-2466 by using 
the@Typed annotation on a Producer Method to exclude the unproxiable Types 
and thus avoid getting caught by the failing isBeanProxiable check. 
However the annotation did not affect whether or not the ProducerMethod is 
proxiable. This might be a second bug. 

I have uploaded a recreate application which I have verified against 
Wildfly 11.0.0 here: https://github.com/benjamin-confino/TypedProducerBug

To recreate you can download the pre-compiled binary from github, deploy 
it to a version of Wildfly without the fix for WELD-2466, and visit the 
url http://localhost:8080/WeldRecreateProducesExtendedAbstract/inheritance 
this will trigger a call to getInjectableReference() which will fail 
because the ProducerMethod for recreate.BeanProducer.produceBean() is not 

If you debug into constructor for ProducerMethod at line 76 you will see 
that the proxiable flag is set using method.getTypeClosures() ; which 
returns all the associated types, rather than just those specified with 
the Typed() paramater. 

Is this the correct behaviour? Should a ProducerMethod be unproxiable even 
with Typed limiting the bean types to proxiable types? 

Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
weld-dev mailing list

Reply via email to