1 Reply Latest reply on Sep 13, 2008 1:01 PM by Hans Schlegel

    SFSBs in different context...

    Gerardo Segura Newbie

      Hello,
      my application is throwing an EJBException when trying to passivate a SFSB (sesionList) which is in APPLICATION context, the stack trace shows the problem is a RequiredException thrown by another SFSB (userHandler) bound to SESSION context which has a reference to the former bean.


      This exception occurs even if I just start the server and let it alone.  But why?  at that moment there hadn't been any session beans instantiated.


      Here I reproduce the declarations of both beans:


      @Stateful
      @Scope(ScopeType.APPLICATION)
      @Startup
      @Name("sesionList")
      public class SesionListImpl implements SesionList {
      ...
      



      @Stateful
      @Scope(ScopeType.SESSION)
      @Name("userHandler")
      public class UserHandlerImpl implements UserHandler {
         @In SesionList sesionList ;
         @In User user ;
      ....
      



      And here is some fragment of the exception:


      01:11:08,953 ERROR [SesionList] problem passivation thread
      java.lang.RuntimeException: javax.ejb.EJBException: org.jboss.seam.RequiredException: @In attribute requires non-null value: userHandler.user
              at org.jboss.ejb3.interceptor.LifecycleInterceptorHandler.prePassivate(LifecycleInterceptorHandler.java:169)
                at org.jboss.ejb3.stateful.StatefulContainer.invokePrePassivate(StatefulContainer.java:406)
      ...
      Caused by: javax.ejb.EJBException: org.jboss.seam.RequiredException: @In attribute requires non-null value: userHandler.user
              at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:63)
              at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)          



      Could someone please explain why the Session scoped bean (userHandler) is been instantiated when the application scoped one is about to be passivated?
      Remember I don't try to use the application, I just wait a while after startup and this exception happens by itself.




      regards