1 Reply Latest reply on Jun 29, 2010 10:09 PM by kapitanpetko

    Problem with long Running Asynchronous tasks

    idyoshin

      Hello community.


      I've made asynchronous tasks via Quartz. Sometimes later this tasks couldn't be run in 5 minutes (the default for JTA transaction in JbossAS 5.1.0.GA). So in JBoss AS I've managed to extend the JTA Transaction time, I've made changes to server/default/deploy/transaction-jboss-beans.xml and modified the parameter: <property name="transactionTimeout">1200</property> . Thus mine transactions now could run for 20 minutes.


      But when I call flush now  I've started receiving following exception:


      20:29:25,790 ERROR [TxPolicy] javax.ejb.NoSuchEJBException: Could not find stateful bean: 3j011-n3er7z-gazkfh8b-1-gazkqmuu-9t
      20:29:26,411 ERROR [AsynchronousExceptionHandler] Exeception thrown whilst executing asynchronous call
      javax.ejb.NoSuchEJBException: Could not find stateful bean: 3j011-n3er7z-gazkfh8b-1-gazkqmuu-9t
           at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:479)
           at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:430)
           at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:59)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
           at org.jboss.aspects.tx.TxInterceptor$Supports.invoke(TxInterceptor.java:147)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:186)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.ejb3.session.SessionSpecContainer.invoke(SessionSpecContainer.java:176)
           at org.jboss.ejb3.session.SessionSpecContainer.invoke(SessionSpecContainer.java:216)
           at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:207)
           at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:164)
           at $Proxy502.beforeTransactionCommit(Unknown Source)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.lang.reflect.Method.invoke(Method.java:616)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
           at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
           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_seam_6.beforeTransactionCommit(Object_$$_javassist_seam_6.java)
           at org.jboss.seam.transaction.UTTransaction.commit(UTTransaction.java:49)
           at org.jboss.seam.util.Work.workInTransaction(Work.java:58)
           at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:91)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.async.AsynchronousInterceptor.aroundInvoke(AsynchronousInterceptor.java:52)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.granite.tide.seam.async.TideAsynchronousInterceptor.aroundInvoke(TideAsynchronousInterceptor.java:119)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
           at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
           at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
           at com.uniqa.session.quartz.ScheduleIncomingParser_$$_javassist_seam_5.processCorporate(ScheduleIncomingParser_$$_javassist_seam_5.java)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.lang.reflect.Method.invoke(Method.java:616)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
           at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
           at org.jboss.seam.async.AsynchronousInvocation$1.process(AsynchronousInvocation.java:62)
           at org.jboss.seam.async.Asynchronous$ContextualAsynchronousRequest.run(Asynchronous.java:80)
           at org.jboss.seam.async.AsynchronousInvocation.execute(AsynchronousInvocation.java:44)
           at org.jboss.seam.async.QuartzDispatcher$QuartzJob.execute(QuartzDispatcher.java:243)
           at org.quartz.core.JobRunShell.run(JobRunShell.java:199)
           at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:546)
      



      I'm out of ideas what else should I do.


      Kind regards,
      Ilya Dyoshin

        • 1. Re: Problem with long Running Asynchronous tasks
          kapitanpetko

          Ilya Dyoshin wrote on Jun 28, 2010 13:41:


          Hello community.

          I've made asynchronous tasks via Quartz. Sometimes later this tasks couldn't be run in 5 minutes (the default for JTA transaction in JbossAS 5.1.0.GA). So in JBoss AS I've managed to extend the JTA Transaction time, I've made changes to server/default/deploy/transaction-jboss-beans.xml and modified the parameter: <property name="transactionTimeout">1200</property> . Thus mine transactions now could run for 20 minutes.

          But when I call flush now I've started receiving following exception:


          The JBoss SFSB timeout is probably set to 20 minutes and your SFSBs get removed. A few ways to solve it:



          • don't use SFSBs for background jobs

          • break up your transaction into smaller chunks if you can (use REQUIRES_NEWS)

          • if all else fails, increase the SFSB removal timeout.