2 Replies Latest reply on Jan 2, 2008 2:25 PM by benc

    Dependency Injection @EJB in separate jar

    vri_97

      I have two jar, eg: ABC.jar dan DEF.jar.
      In ABC.jar I have a class that one of the attribute is an EJB in DEF.jar.

      example :
      in ABC. jar :
      I have class MyClassInABC, with one of the attribute:
      @EJB
      private MyClassInDEF ejb;

      MyClassInDEF reside in DEF.jar.

      If I deploy the ABC.jar and DEF.jar at the same time, there will be java.lang.NoClassDefFoundError. But if I deploy DEF.jar, then deploy ABC.jar manually, it works properly.
      I guess it was failed because JBoss can not find MyClassInDEF bean when trying to inject it.

      Would it possible to define a dependency in my ABC.jar ? so it will be deployed only AFTER DEF.jar successfully deployed ?

      Thanks