4 Replies Latest reply on Mar 27, 2013 4:12 PM by Nicklas Karlsson

    @Inject session bean into war

    klind Newbie

      JBoss 7.1.1-final


      I have a Simple session bean in the EJB module, and inject this session bean in a class in the war module.


      But I get a NullPointerException when runnig the code... injection is not working..

      I got a setup that is very similar to this where it works, and I can't seem to find any differences on how the injection is done..


      I do not use the injected sessionbean in the constructor.



      @Stateless(name = "HibernateUtilsSBBean", mappedName = "jsi/ejb/HibernateUtilsSBBean")
      public class HibernateUtilsSBBean implements HibernateUtilsSBBeanLocal, HibernateUtilsSBBeanRemote {



      public interface HibernateUtilsSBBeanLocal {



      public interface HibernateUtilsSBBeanRemote {



      pojo class in the web app that @Inject sessionbean. 
          private HibernateUtilsSBBeanLocal hibernateUtils;



      Maven project.. 
           - WAR
                - WEB-INF
                          com.foo.... class that @Inject sesison bean interface
           - EJB
                - META-INF
           - META-INF
                com.foo.... session bean class