-
1. Re: Spezializes on a generic type does not deploy
tremes Apr 10, 2014 5:13 AM (in response to abl-dam)Hi Andreas.
I think this is bug in Weld. I've tried with Weld 1.1.19.Final (EAP container) and Weld 2.2.0.CR2 (WildFly container) and in both cases i got following exception, which is IMHO inappropriate:
org.jboss.weld.exceptions.DefinitionException: WELD-001511: Specializing bean Managed Bean [class mypackage.BeanCustom] with qualifiers [@Any @Default] does not have bean type class mypackage.BeanDefault<T> of specialized bean Managed Bean [class mypackage.BeanDefault] with qualifiers [@Any @Default]
So far I've created [WELD-1651] Specialization of generic beans throws inappropriate exception - JBoss Issue Tracker and there's also need to file EAP tracking bug (will do later on).
-
2. Re: Spezializes on a generic type does not deploy
abl-dam Apr 10, 2014 5:42 AM (in response to tremes)Hi Tomas,
thanks for your feedback and effort! I did some more tests, and i can workaround it by using an interface and the @Typed Annotation:
public interface IBean<T extends AbstractEntity>
and let the base class implement the interface reducing the Bean-Types to it with @Typed(IBean.class):
@Typed(IBean.class)
public class BeanDefault<T extends AbstractEntity> implements IBean<T>
for my case that is a possible solution, but I guess this is not intended and portable behaviour.
instead using @Typed with the base class does NOT work (again the WELD-001511 deployment error):
// DEPLOYMENT ERROR
@Typed(BeanDefault.class)
public class BeanDefault<T extends AbstractEntity>