How to make sure that EJBs inherit from abstract class (including annotations) using differing EARs?
Issue
-
EJBs that inherit from an abstract class placed in another EAR are not working correctly.
The abstact class uses container functions e.g. ejb injection using the @EJB annotation. -
As long as the AbstractBean.class and the derived EJB_A.class are in the same main.ear everything works fine.
-
When we put an derived EJB_B.class in another.ear and solved class loading via jboss-deployment-structure.xml the server starts up without any error but when using the EJB_B we are facing errors NullPointerExceptions because the @EJB annotation has not been processed. The same happens with other annotations for example @Ressource or @PostConstruct on a public method.
-
So it seems that the annotations of the inherited class won't be processed when the derived class is located in another EAR.
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 6.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.