6 Replies Latest reply on Nov 10, 2011 5:41 PM by Taimur Mirza

    Seam Cron or EJB Timer job fails if advances system clock, why?

    Taimur Mirza Newbie

      I am using JBoss 7.0.1 and Seam 3.

       

      I have one scheduled job which triggers perfectly fine if I do not play with system clock after starting jboss. but it gets failed if I advances system clock to test my functionality.

       

      If I change system clock after starting Jboss and observe the job, my injected EJBs seem to be in some inconsistent state and I receive an error like failed to connect database or something like that. I believe this is not a database connection error but some sort of synchornization issue as everything works fine if I don't change system clock after Jboss startup.

       

      I am experiencing the same behaviour in Seam Cron and EJB Timer. Please help me out, what I am missing here?

        • 1. Re: Seam Cron or EJB Timer job fails if advances system clock, why?
          jaikiran pai Master

          You'll have to post more  details including the exact exception stacktrace. Also, please try this on 7.0.2 which has been released some time back.

          • 2. Re: Seam Cron or EJB Timer job fails if advances system clock, why?
            Taimur Mirza Newbie

            I am able to reproduce this exception on 7.0.x. I am pasting complete stacktrace below, This stuff appears when my scheduled job is triggered.

             

            12:00:00,280 WARN  [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (SimpleThreadPoolWorker-1) SQL Error: 0, SQLState: 08003

            12:00:00,285 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (SimpleThreadPoolWorker-1) No operations allowed after connection closed.

            12:00:00,287 ERROR [org.jboss.ejb3.tx2.impl.CMTTxInterceptor] (SimpleThreadPoolWorker-1) javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.JDBCConnectionException: No operations allowed after connection closed.

            12:00:00,292 SEVERE [org.quartz.core.JobRunShell] (SimpleThreadPoolWorker-1) Job schedule_job_group.org.jboss.seam.cron.spi.scheduling.trigger.ScheduledTriggerDetail{scheduleSpec=0 0 12 1/1 * ? *, qualifier=@com.mypackage.myapp.cron.EmailDelivery()}-trigger threw an unhandled Exception: : javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.JDBCConnectionException: No operations allowed after connection closed.

                      at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.handleInCallerTx(CMTTxInterceptor.java:158)

                      at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:237)

                      at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.required(CMTTxInterceptor.java:363)

                      at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invoke(CMTTxInterceptor.java:219)

                      at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:35)

                      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

                      at org.jboss.as.ejb3.component.session.SessionInvocationContextInterceptor.processInvocation(SessionInvocationContextInterceptor.java:71)

                      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

                      at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

                      at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:146)

                      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

                      at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

                      at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:76)

                      at com.mypackage.myapp.ejb.EmailPlanDAO$$$view2.findEmailPlanForToday(Unknown Source) [classes:]

                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_12]

                      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_12]

                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_12]

                      at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_12]

                      at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]

                      at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]

                      at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]

                      at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]

                      at org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler.invoke(EnterpriseBeanProxyMethodHandler.java:125) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]

                      at org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance.invoke(EnterpriseTargetBeanInstance.java:62) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]

                      at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:125) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]

                      at com.mypackage.myapp.ejb.EmailPlanDAO$-425031659$Proxy$_$$_Weld$Proxy$.findEmailPlanForToday(EmailPlanDAO$-425031659$Proxy$_$$_Weld$Proxy$.java) [weld-core-1.1.2.Final.jar:]

                      at com.mypackage.myapp.cron.CronJob.sendEmail(CronJob.java:81) [classes:]

                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_12]

                      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_12]

                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_12]

                      at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_12]

                      at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:51)

                      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

                      at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:370) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

                      at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:114) [jboss-as-weld-7.0.1.Final.jar:7.0.1.Final]

                      at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:122) [jboss-as-weld-7.0.1.Final.jar:7.0.1.Final]

                      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

                      at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

                      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

                      at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:45) [jboss-as-jpa-7.0.1.Final.jar:7.0.1.Final]

                      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

                      at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:44)

                      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

                      at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)

                      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

                      at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

                      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

                      at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

                      at org.jboss.as.ee.component.ViewDescription$ComponentDispatcherInterceptor.processInvocation(ViewDescription.java:202)

                      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

                      at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:44)

                      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

                      at org.jboss.as.ejb3.component.session.SessionInvocationContextInterceptor$CustomSessionInvocationContext.proceed(SessionInvocationContextInterceptor.java:126)

                      at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:257)

                      at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.required(CMTTxInterceptor.java:359)

                      at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invoke(CMTTxInterceptor.java:219)

                      at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:35)

                      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

                      at org.jboss.as.ejb3.component.session.SessionInvocationContextInterceptor.processInvocation(SessionInvocationContextInterceptor.java:71)

                      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

                      at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

                      at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:146)

                      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

                      at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

                      at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:76)

                      at com.mypackage.myapp.cron.CronJob$$$view6.sendEmail(Unknown Source) [classes:]

                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_12]

                      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_12]

                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_12]

                      at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_12]

                      at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]

                      at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]

                      at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]

                      at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]

                      at org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler.invoke(EnterpriseBeanProxyMethodHandler.java:125) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]

                      at org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance.invoke(EnterpriseTargetBeanInstance.java:62) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]

                      at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:125) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]

                      at com.mypackage.myapp.cron.CronJob$Proxy$_$$_Weld$Proxy$.sendEmail(CronJob$Proxy$_$$_Weld$Proxy$.java) [classes:]

                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_12]

                      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_12]

                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_12]

                      at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_12]

                      at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]

                      at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]

                      at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]

                      at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]

                      at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:188) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]

                      at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:59) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]

                      at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:198) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]

                      at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:282) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]

                      at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:265) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]

                      at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:234) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]

                      at org.jboss.weld.manager.BeanManagerImpl.notifyObservers(BeanManagerImpl.java:635) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]

                      at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:622) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]

                      at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:616) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]

                      at org.jboss.seam.cron.spi.scheduling.trigger.TriggerSupport.fireTrigger(TriggerSupport.java:96) [seam-cron-spi-3.0.0.Alpha1.jar:]

                      at org.jboss.seam.cron.spi.scheduling.trigger.ProviderContextTriggerSupport.fireTrigger(ProviderContextTriggerSupport.java:61) [seam-cron-spi-3.0.0.Alpha1.jar:]

                      at org.jboss.seam.cron.scheduling.quartz.TriggerJob.execute(TriggerJob.java:50) [seam-cron-scheduling-quartz-3.0.0.Alpha1.jar:]

                      at org.quartz.core.JobRunShell.run(JobRunShell.java:202) [quartz-1.6.1.jar:]

                      at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525) [quartz-1.6.1.jar:]

            Caused by: javax.persistence.PersistenceException: org.hibernate.exception.JDBCConnectionException: No operations allowed after connection closed.

                      at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1344) [hibernate-entitymanager-4.0.0.Beta5.jar:4.0.0.Beta5]

                      at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1277) [hibernate-entitymanager-4.0.0.Beta5.jar:4.0.0.Beta5]

                      at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:261) [hibernate-entitymanager-4.0.0.Beta5.jar:4.0.0.Beta5]

                      at com.mypackage.myapp.ejb.EmailPlanDAOBean.findEmailPlanForToday(EmailPlanDAOBean.java:38) [classes:]

                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_12]

                      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_12]

                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_12]

                      at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_12]

                      at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:51)

                      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

                      at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:370) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

                      at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:114) [jboss-as-weld-7.0.1.Final.jar:7.0.1.Final]

                      at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:122) [jboss-as-weld-7.0.1.Final.jar:7.0.1.Final]

                      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

                      at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

                      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

                      at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:45) [jboss-as-jpa-7.0.1.Final.jar:7.0.1.Final]

                      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

                      at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:44)

                      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

                      at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)

                      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

                      at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

                      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

                      at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

                      at org.jboss.as.ee.component.ViewDescription$ComponentDispatcherInterceptor.processInvocation(ViewDescription.java:202)

                      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

                      at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:44)

                      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

                      at org.jboss.as.ejb3.component.session.SessionInvocationContextInterceptor$CustomSessionInvocationContext.proceed(SessionInvocationContextInterceptor.java:126)

                      at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:233)

                      ... 98 more

            Caused by: org.hibernate.exception.JDBCConnectionException: No operations allowed after connection closed.

                      at org.hibernate.exception.internal.SQLStateConverter.convert(SQLStateConverter.java:107) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]

                      at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:124) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]

                      at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:109) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]

                      at org.hibernate.engine.jdbc.internal.proxy.ConnectionProxyHandler.continueInvocation(ConnectionProxyHandler.java:145) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]

                      at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:80) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]

                      at $Proxy126.prepareStatement(Unknown Source)          at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(StatementPreparerImpl.java:148) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]

                      at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:177) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]

                      at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:146) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]

                      at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1741) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]

                      at org.hibernate.loader.Loader.doQuery(Loader.java:828) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]

                      at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:289) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]

                      at org.hibernate.loader.Loader.doList(Loader.java:2449) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]

                      at org.hibernate.loader.Loader.doList(Loader.java:2435) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]

                      at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]

                      at org.hibernate.loader.Loader.list(Loader.java:2271) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]

                      at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:470) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]

                      at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:355) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]

                      at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:196) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]

                      at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1105) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]

                      at org.hibernate.internal.QueryImpl.list(QueryImpl.java:100) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]

                      at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:252) [hibernate-entitymanager-4.0.0.Beta5.jar:4.0.0.Beta5]

                      ... 126 more

            Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.

                      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [:1.6.0_12]

                      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) [:1.6.0_12]

                      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) [:1.6.0_12]

                      at java.lang.reflect.Constructor.newInstance(Constructor.java:513) [:1.6.0_12]

                      at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)

                      at com.mysql.jdbc.Util.getInstance(Util.java:386)

                      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1013)

                      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)

                      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982)

                      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)

                      at com.mysql.jdbc.ConnectionImpl.throwConnectionClosedException(ConnectionImpl.java:1206)

                      at com.mysql.jdbc.ConnectionImpl.checkClosed(ConnectionImpl.java:1198)

                      at com.mysql.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:4183)

                      at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.doPrepareStatement(BaseWrapperManagedConnection.java:670)

                      at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.prepareStatement(BaseWrapperManagedConnection.java:645)

                      at org.jboss.jca.adapters.jdbc.WrappedConnection.prepareStatement(WrappedConnection.java:401)

                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_12]

                      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_12]

                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_12]

                      at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_12]

                      at org.hibernate.engine.jdbc.internal.proxy.ConnectionProxyHandler.continueInvocation(ConnectionProxyHandler.java:137) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]

                      ... 144 more

            Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

             

             

            The last packet successfully received from the server was 86,352,130 milliseconds ago.  The last packet sent successfully to the server was 17 milliseconds ago.

                      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [:1.6.0_12]

                      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) [:1.6.0_12]

                      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) [:1.6.0_12]

                      at java.lang.reflect.Constructor.newInstance(Constructor.java:513) [:1.6.0_12]

                      at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)

                      at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1116)

                      at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3090)

                      at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2979)

                      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3520)

                      at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1990)

                      at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2151)

                      at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2619)

                      at com.mysql.jdbc.ConnectionImpl.setAutoCommit(ConnectionImpl.java:4997)

                      at org.jboss.jca.adapters.jdbc.local.LocalManagedConnection.begin(LocalManagedConnection.java:160)

                      at org.jboss.jca.core.tx.jbossts.LocalXAResourceImpl.start(LocalXAResourceImpl.java:116)

                      at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:630)

                      at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:391)

                      at org.jboss.jca.core.connectionmanager.listener.TxConnectionListener$TransactionSynchronization.enlist(TxConnectionListener.java:587)

                      at org.jboss.jca.core.connectionmanager.listener.TxConnectionListener.enlist(TxConnectionListener.java:264)

                      at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.managedConnectionReconnected(TxConnectionManagerImpl.java:423)

                      at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.reconnectManagedConnection(AbstractConnectionManager.java:602)

                      at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:470)

                      at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:129)

                      at org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:67) [hibernate-entitymanager-4.0.0.Beta5.jar:4.0.0.Beta5]

                      at org.hibernate.internal.AbstractSessionImpl$NonContextualJdbcConnectionAccess.obtainConnection(AbstractSessionImpl.java:276) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]

                      at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:296) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]

                      at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.getConnection(LogicalConnectionImpl.java:168) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]

                      at org.hibernate.engine.jdbc.internal.proxy.ConnectionProxyHandler.extractPhysicalConnection(ConnectionProxyHandler.java:81) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]

                      ... 145 more

            Caused by: java.net.SocketException: Software caused connection abort: recv failed

                      at java.net.SocketInputStream.socketRead0(Native Method) [:1.6.0_12]

                      at java.net.SocketInputStream.read(SocketInputStream.java:129) [:1.6.0_12]

                      at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:114)

                      at com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:161)

                      at com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:189)

                      at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:2537)

                      at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2990)

                      ... 166 more

            • 3. Re: Seam Cron or EJB Timer job fails if advances system clock, why?
              Taimur Mirza Newbie

              Any help? if anybody willing I can create a test app for this usecase.

              • 4. Re: Seam Cron or EJB Timer job fails if advances system clock, why?
                Carlo de Wolf Master

                The most likely cause is that the kernel recv call timed out with a EWOULDBLOCK when you forward the system time. Forwarding system time can have this impact on any process running on your machine.

                 

                My advice is to not fiddle with the system clock.

                • 5. Re: Seam Cron or EJB Timer job fails if advances system clock, why?
                  Taimur Mirza Newbie

                  Thanks Carlo, I really appreciate your response. You are correct that fiddling with system clock is not advisable but for testing my different usecases in my development environment I have no otherway to forward the system clock to test my functionality otherwise I'll have to wait for 24 hours to simply test my daily email use case.

                   

                  I am using quartz in my other struts application and I don't see such issue if I play with system clock. I agree in production environment, this would not happen but it makes me uneasy to deploy my application in production without unit test.

                   

                  I am also attaching test app for this use case. cron job is scheduled for 16:00:00 daily. so if you change system clock to next day's 16:00:00 it would crash.

                  • 6. Re: Seam Cron or EJB Timer job fails if advances system clock, why?
                    Taimur Mirza Newbie

                    Code is attached

                     

                    You can create database named cron with one table

                     

                    CREATE TABLE `emailplan` (

                      `Id` int(11) NOT NULL AUTO_INCREMENT,

                      `PlanDate` date DEFAULT NULL,

                      PRIMARY KEY (`Id`),

                      UNIQUE KEY `PlanDate_UNIQUE` (`PlanDate`)

                    )