4 Replies Latest reply on Feb 11, 2010 9:26 PM by James Stevenson

    EntityHome.persist results in "could not find stateful bean"

    Raj Tiwari Newbie

      We are running into this really strange problem. When we invoke persist() on an Entityhome subclass, it throws


      javax.ejb.NoSuchEJBException: Could not find stateful bean: 5c4o16-11mvaf-fkozz2f7-1-fkp0k9nr-16



      Which is odd because it happens pretty much moments after a session is started and clearly, no stateful bean has had the opportunity to timeout.


      Here is another twist: This call happens as part of a seam remoting invocation. Interestingly, everything was working fine when our client did JavaScript-based seam remoting. We recently rewrote our client in Flex and started using Flamingo. Now suddenly we are seeing this problem.


      Any idea what might be going wrong?


      Here is a partial stack trace:


      [org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:390)
      org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:375)
      org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:61)
       org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
       org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
       org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
       org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
       org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:206)
       org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:119)
       $Proxy182.registerSynchronization(Unknown Source)
       sun.reflect.GeneratedMethodAccessor304.invoke(Unknown Source)
       sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       java.lang.reflect.Method.invoke(Method.java:597)
       org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
       org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
       org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
       org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
       org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
       org.javassist.tmp.java.lang.Object_$$_javassist_1.registerSynchronization(Object_$$_javassist_1.java)
       org.jboss.seam.transaction.UTTransaction.registerSynchronization(UTTransaction.java:92)
       org.jboss.seam.async.AbstractDispatcher.scheduleTransactionSuccessEvent(AbstractDispatcher.java:38)
       sun.reflect.GeneratedMethodAccessor351.invoke(Unknown Source)
       sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       java.lang.reflect.Method.invoke(Method.java:597)
       org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
       org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
       org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
       org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
       org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
       org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
       org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
       org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
       org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
       org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
       org.jboss.seam.async.ThreadPoolDispatcher_$$_javassist_8.scheduleTransactionSuccessEvent(ThreadPoolDispatcher_$$_javassist_8.java)
       org.jboss.seam.core.Events.raiseTransactionSuccessEvent(Events.java:125)
       org.jboss.seam.framework.Controller.raiseTransactionSuccessEvent(Controller.java:258)
       org.jboss.seam.framework.Home.raiseAfterTransactionSuccessEvent(Home.java:443)
       org.jboss.seam.framework.EntityHome.persist(EntityHome.java:88)
       sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       java.lang.reflect.Method.invoke(Method.java:597)
       org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
       org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
       org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
       org.jboss.seam.persistence.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:48)
       org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
       org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
       org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
       org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:38)
       org.jboss.seam.util.Work.workInTransaction(Work.java:40)
       org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:32)
       org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
       org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
       org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
       org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
       org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
       org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
       com.sharon.session.DataAccessorRootHome_$$_javassist_9.persist(DataAccessorRootHome_$$_javassist_9.java)
       com.sharon.util.datasources.WebFileSource.createAccessorRoot(WebFileSource.java:938)
      ...
      

        • 1. Re: EntityHome.persist results in "could not find stateful bean"
          Joshua Jackson Master

          How does your Seam action class that persist the object look like?

          • 2. Re: EntityHome.persist results in "could not find stateful bean"
            Raj Tiwari Newbie

            The Seam component that is being invoked is a stateful EJB3.


            Right now I am getting a very similar error on an operation that does not persist anything. It simply retrieves things from the database. It looks like the operation within my code completes successfully. After that it chokes on destroying the transaction:


            17:59:27,419 WARN  [Component] Exception calling stateful session bean default @Remove method: org.jboss.seam.transaction.synchronizations




            Here is the complete stack trace:


            17:59:27,419 WARN  [Component] Exception calling stateful session bean default @Remove method: org.jboss.seam.transaction.synchronizations
            javax.ejb.NoSuchEJBException: Could not find stateful bean: 5c4o12-h83u32-fkyo79d4-1-fkyoaodu-l
                 at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:390)
                 at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:375)
                 at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:61)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                 at org.jboss.ejb3.stateful.StatefulRemoveInterceptor.invoke(StatefulRemoveInterceptor.java:97)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                 at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
                 at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                 at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                 at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                 at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:206)
                 at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:119)
                 at $Proxy120.destroy(Unknown Source)
                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:597)
                 at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
                 at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
                 at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
                 at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
                 at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
                 at org.javassist.tmp.java.lang.Object_$$_javassist_1.destroy(Object_$$_javassist_1.java)
                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:597)
                 at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
                 at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
                 at org.jboss.seam.Component.callComponentMethod(Component.java:2084)
                 at org.jboss.seam.Component.callDefaultRemoveMethod(Component.java:1989)
                 at org.jboss.seam.Component.destroy(Component.java:1341)
                 at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:251)
                 at org.jboss.seam.contexts.Contexts.flushAndDestroyContexts(Contexts.java:394)
                 at org.jboss.seam.contexts.ServletLifecycle.endRequest(ServletLifecycle.java:60)
                 at org.jboss.seam.servlet.ContextualHttpServletRequest.run(ContextualHttpServletRequest.java:56)
                 at com.exadel.flamingo.service.seam.amf.process.AMF3RemotingMessageProcessor.process(AMF3RemotingMessageProcessor.java:71)
                 at com.exadel.flamingo.service.seam.amf.process.AMF3MessageProcessor.process(AMF3MessageProcessor.java:58)
                 at com.exadel.flamingo.flex.amf.process.AMF0MessageProcessor.process(AMF0MessageProcessor.java:53)
                 at com.exadel.flamingo.service.seam.AMFToSeamRequestProcessor.process(AMFToSeamRequestProcessor.java:73)
                 at com.exadel.flamingo.service.seam.AMFRemoteService.getResource(AMFRemoteService.java:79)
                 at org.jboss.seam.servlet.SeamResourceServlet.doGet(SeamResourceServlet.java:75)
                 at org.jboss.seam.servlet.SeamResourceServlet.doPost(SeamResourceServlet.java:92)
                 at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
                 at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                 at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:154)
                 at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:260)
                 at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:366)
                 at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:493)
                 at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                 at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                 at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
                 at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                 at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
                 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                 at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
                 at java.lang.Thread.run(Thread.java:619)




            • 3. Re: EntityHome.persist results in "could not find stateful bean"
              Arnie Morein Newbie

              did you figure out what was causing this error? I'm getting this on ANY ejb in my Project if ejb-transaction is on - but only if the app is configured as a portlet.


              otherwise, it runs fine.

              • 4. Re: EntityHome.persist results in "could not find stateful bean"
                James Stevenson Newbie

                I had something similar happening.  The only solution I could find (and I am not saying I like the solution) was to make sure I was only making one AMF call at a time.  For instance if I was trying to populate 2 droplists using Remote objects at once it would throw that same error.  When I chained the calls it worked fine. By chaining I mean I would start populating the second list from the resultHandler of the prior list.