4 Replies Latest reply on Jun 16, 2011 5:13 AM by kirillica

    EJB3-JSF2 conflict in JBoss5

    kirillica

      Hi all,

       

      After vacations I've continued migrating application to JSF2 platform, but based on JBoss5 server (I've got too many issues with JBoss6, so I've started to hate it ).

       

      And it seems to me I found the bug: EJB3 is incompatible (don't ask me why) with JSF2.

       

      Here is my path: I have working application based on JSF1.2. In Eclipse I change it to JSF2.0, put new libraries in WEB-INF/lib catalogue, add two new properties in web.xml:

        <!-- JSF 2: this tells JBoss 5 to use the jsf jars included in the app -->     
        <context-param>          
          <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>          
          <param-value>true</param-value>     
        </context-param>     
      
        <!-- JSF 2: this needs to be included to avoid an error message -->
        <context-param>
          <param-name>com.sun.faces.injectionProvider</param-name>
          <param-value>org.jboss.web.jsf.integration.injection.JBossInjectionProvider</param-value>
        </context-param>

       

      Application compiles fine, started with no errors, EJB is binded:

      11:40:04,766 INFO  [SessionSpecContainer] Starting jboss.j2ee:ear=MyApplication.ear,jar=MyBusiness.jar,name=SomeDAOImpl,service=EJB3
      11:40:04,766 INFO  [EJBContainer] STARTED EJB: my.path.SomeDAOImpl ejbName: SomeDAOImpl
      11:40:04,779 INFO  [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:
      
           MyApplication/SomeDAOImpl/local - EJB3.x Default Local Business Interface
           MyApplication/SomeDAOImpl/local-my.path.SomeDAO - EJB3.x Local Business Interface

      but:

        @EJB(beanName="SomeDAOImpl/local", beanInterface=SomeDAO.class)
        protected SomeDAO someDao;

      is not injected. someDao is null.

       

      EJB is located in another jar and maybe this is causing the issue, but if I change JSF2.0 back to JSF1.2 - verything is working fine.

       

      So where is the catch?