3 Replies Latest reply on Jan 8, 2014 7:56 AM by Prabakaran Kamaraj

    bitronix.tm.BitronixTransaction fireAfterCompletionEvent WARNING: Synchronization.afterCompletion() call failed for org.hibernate.transaction.CacheSynchronization

    Prabakaran Kamaraj Newbie

      Hi,

       

      We are having JBPM workflow application which is using Bitronix transaction manager with 2 resources(Oracle & QPID).

       

      JBPM 5.2.0 Final

       

      JAR version List:

       

      BTM:

      btm-2.1.3.jar

      btm-tomcat55-lifecycle-2.1.3.jar

       

      Oracle:

      ojdbc6.jar

       

      Hibernate:

      hibernate-3.2.6.ga.jar

      hibernate-annotations-3.3.1.GA.jar

      hibernate-commons-annotations-3.0.0.ga.jar

      hibernate-core-3.3.2.GA.jar

      hibernate-entitymanager-3.4.0.GA.jar

       

      Ehcache:

      ehcache-1.2.3.jar

       

      QPID:

      qpid-all.jar

      qpid-client-2.7.1.jar

      geronimo-jms_1.1_spec-1.0.jar

      qpid-common-2.7.1.jar

      commons-lang-2.2.jar

      backport-util-concurrent-2.2.jar

      mina-filter-ssl-1.0.1.jar

      mina-core-1.0.1.jar

      commons-collections-3.2.jar

      log4j-1.2.12.jar

      slf4j-api-1.4.0.jar

      slf4j-log4j12-1.4.0.jar

       

      Some time We are getting below Exception. If any one faced same kind of issue, please help us to resolve the issue.

       

       

      Oct 30, 2013 11:37:20 AM bitronix.tm.BitronixTransaction fireAfterCompletionEvent

      WARNING: Synchronization.afterCompletion() call failed for org.hibernate.transaction.CacheSynchronization

      org.hibernate.exception.GenericJDBCException: Cannot release connection

      at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)

      at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)

      at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)

      at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)

      at org.hibernate.jdbc.ConnectionManager.closeConnection(ConnectionManager.java:455)

      at org.hibernate.jdbc.ConnectionManager.aggressiveRelease(ConnectionManager.java:406)

      at org.hibernate.jdbc.ConnectionManager.afterTransaction(ConnectionManager.java:298)

      at org.hibernate.jdbc.JDBCContext.afterTransactionCompletion(JDBCContext.java:225)

      at org.hibernate.transaction.CacheSynchronization.afterCompletion(CacheSynchronization.java:85)

      at bitronix.tm.BitronixTransaction.fireAfterCompletionEvent(BitronixTransaction.java:549)

      at bitronix.tm.BitronixTransaction.commit(BitronixTransaction.java:298)

      at bitronix.tm.BitronixTransactionManager.commit(BitronixTransactionManager.java:143)

      at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1028)

      at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732)

      at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701)

      at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321)

      at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)

      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)

      at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)

      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)

      at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635)

      at com.workflow.jbpm.service.WorkflowManagerImpl$$EnhancerByCGLIB$$3c490356.startProcess(<generated>)

      at com.workflow.web.webservice.WorkflowWebService.launchWorkflow(WorkflowWebService.java:90)

      at sun.reflect.GeneratedMethodAccessor189.invoke(Unknown Source)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

      at java.lang.reflect.Method.invoke(Unknown Source)

      at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:166)

      at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:82)

      at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:55)

      at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:68)

      at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)

      at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

      at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)

      at java.util.concurrent.FutureTask.run(Unknown Source)

      at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)

      at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:98)

      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)

      at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:104)

      at org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:99)

      at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:452)

      at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:196)

      at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:220)

      at org.apache.cxf.transport.servlet.AbstractCXFServlet.doPost(AbstractCXFServlet.java:153)

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)

      at org.apache.cxf.transport.servlet.AbstractCXFServlet.service(AbstractCXFServlet.java:211)

      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)

      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

      at org.apache.catalina.ha.session.JvmRouteBinderValve.invoke(JvmRouteBinderValve.java:227)

      at org.apache.catalina.ha.tcp.ReplicationValve.invoke(ReplicationValve.java:347)

      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)

      at org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:448)

      at org.apache.coyote.ajp.AjpAprProtocol$AjpConnectionHandler.process(AjpAprProtocol.java:399)

      at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1675)

      at java.lang.Thread.run(Unknown Source)

      Caused by: java.sql.SQLException: error requeuing a JdbcPooledConnection from datasource jdbc/jbpmdb in state ACCESSIBLE with usage count 1 wrapping oracle.jdbc.driver.T4CXAConnection@3eb96b57

      at bitronix.tm.resource.jdbc.JdbcPooledConnection.release(JdbcPooledConnection.java:251)

      at bitronix.tm.resource.jdbc.JdbcConnectionHandle.close(JdbcConnectionHandle.java:103)

      at sun.reflect.GeneratedMethodAccessor98.invoke(Unknown Source)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

      at java.lang.reflect.Method.invoke(Unknown Source)

      at bitronix.tm.resource.jdbc.BaseProxyHandlerClass.invoke(BaseProxyHandlerClass.java:64)

      at $Proxy42.close(Unknown Source)

      at org.hibernate.connection.DatasourceConnectionProvider.closeConnection(DatasourceConnectionProvider.java:74)

      at org.hibernate.jdbc.ConnectionManager.closeConnection(ConnectionManager.java:451)

      ... 54 more

      Caused by: bitronix.tm.internal.BitronixSystemException: cannot close a resource when its XAResource is taking part in an unfinished global transaction

      at bitronix.tm.resource.common.TransactionContextHelper.requeue(TransactionContextHelper.java:140)

      at bitronix.tm.resource.jdbc.JdbcPooledConnection.release(JdbcPooledConnection.java:240)

      ... 62 more

       

       

      Thanks and Regards,

      Praba

        • 1. Re: bitronix.tm.BitronixTransaction fireAfterCompletionEvent WARNING: Synchronization.afterCompletion() call failed for org.hibernate.transaction.CacheSynchronization
          Prabakaran Kamaraj Newbie


          HI,

           

          Addtion to above issue, a

           

          fter getting above CacheSynchronization error, the below exception occured for all transactions.

           

          org.hibernate.AssertionFailure: Transaction MARKED_FOR_JOINED after isOpen() call

          at org.hibernate.ejb.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:465)

          at org.hibernate.ejb.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:431)

          at org.drools.persistence.jpa.JpaPersistenceContextManager.beginCommandScopedEntityManager(JpaPersistenceContextManager.java:83)

          at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:339)

          at org.drools.command.impl.CommandBasedStatefulKnowledgeSession$1.registerWorkItemHandler(CommandBasedStatefulKnowledgeSession.java:164)

          at com.workflow.jbpm.util.WorkflowAPIUtil.getTaskService(WorkflowAPIUtil.java:76)

          at com.workflow.jbpm.service.KnowledgeSessionFactory.configureTaskService(KnowledgeSessionFactory.java:403)

          at com.workflow.jbpm.service.KnowledgeSessionFactory.loadKnowledgeSession(KnowledgeSessionFactory.java:219)

          at com.workflow.jbpm.service.KnowledgeSessionFactory$$FastClassByCGLIB$$552fcfe.invoke(<generated>)

          at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)

          at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:700)

          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)

          at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)

          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)

          at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)

          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)

          at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635)

          at com.workflow.jbpm.service.KnowledgeSessionFactory$$EnhancerByCGLIB$$d6979502.loadKnowledgeSession(<generated>)

          at com.workflow.jbpm.event.handler.CancelWorkflowHandler.handleEvent(CancelWorkflowHandler.java:60)

          at com.workflow.event.service.WorkflowEventService.processEvent(WorkflowEventService.java:52)

          at com.workflow.event.service.WorkflowEventService$$FastClassByCGLIB$$95456485.invoke(<generated>)

          at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)

          at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:700)

          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)

          at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)

          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)

          at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)

          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)

          at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635)

          at com.workflow.event.service.WorkflowEventService$$EnhancerByCGLIB$$7be058f.processEvent(<generated>)

          at com.workflow.event.listener.WorkflowEventListener.processEvent(WorkflowEventListener.java:158)

          at com.workflow.event.listener.WorkflowEventListener.onMessage(WorkflowEventListener.java:134)

          at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:543)

          at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:482)

          at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:451)

          at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:323)

          at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:241)

          at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:982)

          at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:881)

          at org.springframework.scheduling.commonj.DelegatingWork.run(DelegatingWork.java:61)

          at de.myfoo.commonj.work.FooWorkItem.run(FooWorkItem.java:100)

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

          at java.lang.Thread.run(Unknown Source)

           

          Thanks and Regards,

          Praba

          • 2. Re: bitronix.tm.BitronixTransaction fireAfterCompletionEvent WARNING: Synchronization.afterCompletion() call failed for org.hibernate.transaction.CacheSynchronization
            Prabakaran Kamaraj Newbie


            BTM team reported that the issue will be fixed in 3.0.0 version but the release date is still not yet given.

             

            Did any body face similar issues in 2.2 or 2.3 of BTM???