3 Replies Latest reply on Jul 24, 2007 11:56 AM by John McClain

    WorkingMemory injected in EJB but not POJO

    John McClain Newbie

      I have an EJB I am using as an event handler. When I inject my JBOSS Rules workingMemory into it, all is well; I have declared it in components.xml. Here is the code:

      @Stateful
      @Name("indexPage")
      @Scope(org.jboss.seam.ScopeType.SESSION)
      public class IndexPageBean implements IndexPage {
      
       @Logger
       private Log log;
      
       @In
       FacesMessages facesMessages;
      
       @In WorkingMemory wmUnderwriting;
      .
      .
      .
      


      HOWEVER - what I would like to do INSTEAD is use another seam component and inject the WorkingMemory into it instead of the event handler above. Here is my proposed code

      @Name("UnderwritingService")
      public class UnderwritingService
      {
      //TODO - NOTE - I changed the ant build script to include all .drl files
       // I.E., security.drl is now *.drl
      
       @In
       WorkingMemory wmUnderwriting;
      .
      .
      .
      


      The problem I am having is that when I manually instantiate this comopnent from the first comoponent, the workingMemory object is null. I dont understand, because it is NOT nulll whe it is injected into the EJB event handler, but it IS null when injected instead into the service component that I instantiate from the event handler. I am not understnading why injection works for the EJB and not for the pojo service component