4 Replies Latest reply on Feb 3, 2006 6:58 AM by Alexander Hartner

    EJB3 in Default configuration does not work in RC4

    Alexander Hartner Newbie

      I tried to configure EJB3 on the default configuration. In the installation documentation it is suggested to leave out the steps involving

      ejb3-clustered-sfsbcache-service.xml

      and
      ejb3-entity-cache-service.xml


      My problem is that my Stateful Session beans seem to be disappearing in front of my eyes, even without a call to the @Remove annotated method.
      I am guessing that sfsbcache is the stateful session bean cache service, which not is not deployed and hence my beans are removed. I don't know if this makes much sence, but I am hoping that somebody could confirm my theory.

      The exception I get is :


      javax.ejb.EJBNoSuchObjectException: Could not find Stateful bean: 5c4o43f-x8d47r-ej5qpwed-1-ej5r15i4-ai
      at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:249)
      at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:59)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:190)
      at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:98)


      Any insight into this problem will help me a great deal. In the mean time I will try out the all configuration.



        • 1. Re: EJB3 in Default configuration does not work in RC4
          Bill Burke Master

          Hmmmm, anyway you could write a test to reproduce this problem?

          • 2. Re: EJB3 in Default configuration does not work in RC4
            Bill Burke Master

            I think I know the problem.

            Does this problem show up when you have lots of stateful session beans?

            • 3. Re: EJB3 in Default configuration does not work in RC4
              Bill Burke Master

              Ok, I couldn't reproduce the problem.

              Can you give me more information? Do SFSBs not work *AT ALL*??? Or they disappear randomly?

              You can always do

              @Cache(org.jboss.ejb3.cache.NoPassivationCache.class)
              @Stateful
              public class MyBean

              • 4. Re: EJB3 in Default configuration does not work in RC4
                Alexander Hartner Newbie

                I will put a test together. So far I can rule out the theory that it is confinded to the default configuration. I had the same problem with the all configuration. After some searching I found that changing the exception from : EntityNotFound to NoResultException.

                Within my session bean i had :

                 log.info("GetMime with Key :"+key);
                 try
                 {
                 MIME mime = (MIME)manager.createQuery("select l from MIME l where l.mimeKey=:mimeKey ").setParameter("mimeKey", key).getSingleResult();
                 return mime;
                 }
                 catch (EntityNotFoundException enfe)
                 {
                 throw new CIEFacadeException(CIEFacadeException.OBJECT_NOT_FOUND,"MIME with key :"+key+" not found.");
                 }
                


                I changed the code to

                 public MIME getMIME(String key) throws CIEFacadeException
                 {
                 log.info("GetMime with Key :"+key);
                 try
                 {
                 MIME mime = (MIME)manager.createQuery("select l from MIME l where l.mimeKey=:mimeKey ").setParameter("mimeKey", key).getSingleResult();
                 return mime;
                 }
                 catch (NoResultException enfe)
                 {
                 throw new CIEFacadeException(CIEFacadeException.OBJECT_NOT_FOUND,"MIME with key :"+key+" not found.");
                 }
                 }
                


                I have a new theory now. Before the NoResultException was not handled and seemed to have resulted in the SessionBean being removed from the cache. I don't know if this makes much sense, but I will put a basic example together and try to reproduce the problem.