3 Replies Latest reply on Aug 24, 2014 12:20 PM by christian.beikov

    Deploying EAR with multiple EJB jars that fail to see registered session beans

    jmanko

      I have an EAR that I'm trying to deploy to Wildfly 8.1, and it's failing because one EJB module is failing to inject qualified session beans residing in another EJB module.  This is my first attempt at using Wildfly with an EAR project, so I'm just learning how WF handles module and dependency isolation.  Any help would be appreciated.

       

      I basically have a WAR bean that injects a qualified EJB from my first EJB module:

       

      WAR:

      @Named

      @SessionScoped

      public class MyController {

        @Inject

        @MyCustom

        private MyEJBInterfaceLocal myInjectedBean; // <-- INJECTION WORKS, APPARENTLY

      }

       

      JAR LIBRARY:

      @Local

      public interface MyEJBInterfaceLocal { /* stuff */ }

       

      EJB JAR #1:

      @Stateless

      @MyCustom // <-- CUSTOM QUALIFIER

      public class MyCustomBean implements MyEJBInterfaceLocal {

        @Inject

        @MyDefault

        private MyEJBInterfaceLocal myInjectedBean; // <-- INJECTION FAILS

      }

       

      EJB JAR #2:

      @Stateless

      @MyDefault // <-- CUSTOM QUALIFIER

      public class MyCustomBean implements MyEJBInterfaceLocal {

       

      }


      jboss-deployment-structure.xml:

      <jboss-deployment-structure>

          <ear-subdeployments-isolated>false</ear-subdeployments-isolated>

      </jboss-deployment-structure>