2 Replies Latest reply on Jul 30, 2011 8:58 AM by Scott Kroll

    CDI/EJB Injection in EAR Deployments

    Scott Kroll Newbie

      I think this may be a bug, but I may be doing something wrong here. Here is my application:



           lib/javaee-dao.jar - POJO CDI with beans.xml in META-INF

           lib/javaee-dao-impl.jar - POJO CDI with beans.xml in META-INF


           javaee-ejb.jar - EJB


      Now, I have a EJB in javaee-ejb.jar that uses @Inject to pull a dependency from javaee-dao-impl.jar. However, every time I try to use it, the depedency is null and I get a NullPointerException.


      What is weird, if I had get rid of the ear, put all the jars in the WAR's WEB-INF/lib and deploy it by itself, the application works fine.


      Is there an issue when it comes to EAR deployments, or am I missing something?