0 Replies Latest reply on Nov 24, 2011 6:53 AM by Lars Fischer

    EJB inheritance to outer dependency?

    Lars Fischer Newbie



      lets say I have to deploy multiple EARs containing many similar EJBs into one container. The EJBs inside different EARs differ only in some details. So I would like to create an abstract parent class, from which all other EJBs inherit. The parent class needs to use JEE annotations like @Inject etc.

      Additional, there is a requirement, that EAR files should only be touched, if there are changes on the differing aspects.


      I tried to use module dependencies between EARs to have only one core-EAR containing the abstract class and all other EARs with inherrited EJBs depend on this core-EAR module.


      Unfortunately, this is not working. The annotations of the abstract class are not recognized, when EJBs inside the none-core-EARs are created by the container. E.g. no bean is injected into an @EJB field or @PostConstruct methods are not called.


      Is there a way to get this working without copying the abstract parent class into the non-core-EARs?