AnsweredAssumed Answered

java.sql.SQLException in activiti -5.10 when delete process

Question asked by santharamselva on Feb 12, 2013
Latest reply on Feb 13, 2013 by frederikheremans1
Hi,

I am getting the problem when I am deleting process using activiti delete API with activiti-engine 5.10.

   my code is like below.

  
processEngine.getRuntimeService().deleteProcessInstance(historicProcessInstance.getId(), deleteReason);

   When I deleting this I am getting following error,


12:46:49,925 SEVERE [org.activiti.engine.impl.interceptor.CommandContext] (http–0.0.0.0-8182-1) Error while closing command context: org.apache.ibatis.exceptions.PersistenceException:
### Error committing transaction.  Cause: java.sql.SQLException: You cannot commit during a managed transaction!
### Cause: java.sql.SQLException: You cannot commit during a managed transaction!
   at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23) [mybatis-3.1.1.jar:3.1.1]
   at org.apache.ibatis.session.defaults.DefaultSqlSession.commit(DefaultSqlSession.java:170) [mybatis-3.1.1.jar:3.1.1]
   at org.apache.ibatis.session.defaults.DefaultSqlSession.commit(DefaultSqlSession.java:162) [mybatis-3.1.1.jar:3.1.1]
   at org.activiti.engine.impl.db.DbSqlSession.commit(DbSqlSession.java:493) [activiti-engine-5.10.jar:5.10]
   at org.activiti.engine.impl.cfg.standalone.StandaloneMybatisTransactionContext.commit(StandaloneMybatisTransactionContext.java:58) [activiti-engine-5.10.jar:5.10]
   at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:118) [activiti-engine-5.10.jar:5.10]
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:49) [activiti-engine-5.10.jar:5.10]
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33) [activiti-engine-5.10.jar:5.10]
   at org.activiti.engine.impl.RuntimeServiceImpl.deleteProcessInstance(RuntimeServiceImpl.java:79) [activiti-engine-5.10.jar:5.10]
   at net.treetechnologies.workflow.process.Process.deleteProcessByOrderId(Process.java:50) [workflowutil-0.0.18-P2-SNAPSHOT.jar:]
   at net.treetechnologies.party.services.PartyServicesImpl.cancelWorkflowProcess(PartyServicesImpl.java:8986) [party-uiIntegration-0.0.12-P2-SNAPSHOT.jar:]
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_24]
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_24]
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_24]
   at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_24]
   at org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
   at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
   at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:36) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
   at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
   at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
   at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
   at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
   at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
   at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:228) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
   at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:304) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
   at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:190) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
   at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
   at org.jboss.as.ejb3.security.AuthorizationInterceptor.processInvocation(AuthorizationInterceptor.java:106) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
   at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:76) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
   at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
   at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
   at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:32) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
   at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
   at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
   at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
   at org.jboss.as.webservices.invocation.AbstractInvocationHandlerEJB.invoke(AbstractInvocationHandlerEJB.java:112)
   at org.jboss.wsf.stack.cxf.JBossWSInvoker._invokeInternal(JBossWSInvoker.java:181)
   at org.jboss.wsf.stack.cxf.JBossWSInvoker.invoke(JBossWSInvoker.java:127)
   at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58) [cxf-2.6.1.jar:2.6.1]
   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [rt.jar:1.6.0_24]
   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [rt.jar:1.6.0_24]
   at java.util.concurrent.FutureTask.run(FutureTask.java:138) [rt.jar:1.6.0_24]
   at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37) [cxf-2.6.1.jar:2.6.1]
   at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106) [cxf-2.6.1.jar:2.6.1]
   at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263) [cxf-2.6.1.jar:2.6.1]
   at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) [cxf-2.6.1.jar:2.6.1]
   at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:207) [cxf-2.6.1.jar:2.6.1]
   at org.jboss.wsf.stack.cxf.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:91)
   at org.jboss.wsf.stack.cxf.transport.ServletHelper.callRequestHandler(ServletHelper.java:169)
   at org.jboss.wsf.stack.cxf.CXFServletExt.invoke(CXFServletExt.java:87)
   at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:185) [cxf-2.6.1.jar:2.6.1]
   at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:108) [cxf-2.6.1.jar:2.6.1]
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:754) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
   at org.jboss.wsf.stack.cxf.CXFServletExt.service(CXFServletExt.java:135)
   at org.jboss.wsf.spi.deployment.WSFServlet.service(WSFServlet.java:140) [jbossws-spi-2.0.3.GA.jar:2.0.3.GA]
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:489)
   at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
   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:368)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)
   at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_24]
Caused by: java.sql.SQLException: You cannot commit during a managed transaction!
   at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.jdbcCommit(BaseWrapperManagedConnection.java:981)
   at org.jboss.jca.adapters.jdbc.WrappedConnection.commit(WrappedConnection.java:757)
   at org.apache.ibatis.transaction.jdbc.JdbcTransaction.commit(JdbcTransaction.java:68) [mybatis-3.1.1.jar:3.1.1]
   at org.apache.ibatis.executor.BaseExecutor.commit(BaseExecutor.java:203) [mybatis-3.1.1.jar:3.1.1]
   at org.apache.ibatis.executor.CachingExecutor.commit(CachingExecutor.java:113) [mybatis-3.1.1.jar:3.1.1]
   at org.apache.ibatis.session.defaults.DefaultSqlSession.commit(DefaultSqlSession.java:167) [mybatis-3.1.1.jar:3.1.1]
   … 82 more

12:46:50,015 INFO  [org.activiti.engine.impl.cfg.standalone.StandaloneMybatisTransactionContext] (http–0.0.0.0-8182-1) Exception during transaction:
### Error rolling back transaction.  Cause: java.sql.SQLException: You cannot rollback during a managed transaction!
### Cause: java.sql.SQLException: You cannot rollback during a managed transaction!
12:46:50,017 SEVERE [org.activiti.engine.impl.interceptor.CommandContext] (http–0.0.0.0-8182-1) masked exception in command context. for root cause, see below as it will be rethrown later.: org.apache.ibatis.exceptions.PersistenceException:
### Error rolling back transaction.  Cause: java.sql.SQLException: You cannot rollback during a managed transaction!
### Cause: java.sql.SQLException: You cannot rollback during a managed transaction!
   at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23) [mybatis-3.1.1.jar:3.1.1]
   at org.apache.ibatis.session.defaults.DefaultSqlSession.rollback(DefaultSqlSession.java:185) [mybatis-3.1.1.jar:3.1.1]
   at org.apache.ibatis.session.defaults.DefaultSqlSession.rollback(DefaultSqlSession.java:177) [mybatis-3.1.1.jar:3.1.1]
   at org.activiti.engine.impl.db.DbSqlSession.rollback(DbSqlSession.java:497) [activiti-engine-5.10.jar:5.10]
   at org.activiti.engine.impl.cfg.standalone.StandaloneMybatisTransactionContext.rollback(StandaloneMybatisTransactionContext.java:91) [activiti-engine-5.10.jar:5.10]
   at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:130) [activiti-engine-5.10.jar:5.10]
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:49) [activiti-engine-5.10.jar:5.10]
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33) [activiti-engine-5.10.jar:5.10]
   at org.activiti.engine.impl.RuntimeServiceImpl.deleteProcessInstance(RuntimeServiceImpl.java:79) [activiti-engine-5.10.jar:5.10]
   at net.treetechnologies.workflow.process.Process.deleteProcessByOrderId(Process.java:50) [workflowutil-0.0.18-P2-SNAPSHOT.jar:]
   at net.treetechnologies.party.services.PartyServicesImpl.cancelWorkflowProcess(PartyServicesImpl.java:8986) [party-uiIntegration-0.0.12-P2-SNAPSHOT.jar:]
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_24]
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_24]
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_24]
   at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_24]
   at org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
   at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
   at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:36) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
   at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
   at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
   at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
   at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
   at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
   at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:228) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
   at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:304) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
   at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:190) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
   at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
   at org.jboss.as.ejb3.security.AuthorizationInterceptor.processInvocation(AuthorizationInterceptor.java:106) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
   at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:76) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
   at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
   at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
   at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:32) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
   at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
   at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
   at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
   at org.jboss.as.webservices.invocation.AbstractInvocationHandlerEJB.invoke(AbstractInvocationHandlerEJB.java:112)
   at org.jboss.wsf.stack.cxf.JBossWSInvoker._invokeInternal(JBossWSInvoker.java:181)
   at org.jboss.wsf.stack.cxf.JBossWSInvoker.invoke(JBossWSInvoker.java:127)
   at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58) [cxf-2.6.1.jar:2.6.1]
   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [rt.jar:1.6.0_24]
   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [rt.jar:1.6.0_24]
   at java.util.concurrent.FutureTask.run(FutureTask.java:138) [rt.jar:1.6.0_24]
   at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37) [cxf-2.6.1.jar:2.6.1]
   at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106) [cxf-2.6.1.jar:2.6.1]
   at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263) [cxf-2.6.1.jar:2.6.1]
   at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) [cxf-2.6.1.jar:2.6.1]
   at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:207) [cxf-2.6.1.jar:2.6.1]
   at org.jboss.wsf.stack.cxf.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:91)
   at org.jboss.wsf.stack.cxf.transport.ServletHelper.callRequestHandler(ServletHelper.java:169)
   at org.jboss.wsf.stack.cxf.CXFServletExt.invoke(CXFServletExt.java:87)
   at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:185) [cxf-2.6.1.jar:2.6.1]
   at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:108) [cxf-2.6.1.jar:2.6.1]
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:754) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
   at org.jboss.wsf.stack.cxf.CXFServletExt.service(CXFServletExt.java:135)
   at org.jboss.wsf.spi.deployment.WSFServlet.service(WSFServlet.java:140) [jbossws-spi-2.0.3.GA.jar:2.0.3.GA]
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:489)
   at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
   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:368)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)
   at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_24]
Caused by: java.sql.SQLException: You cannot rollback during a managed transaction!
   at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.jdbcRollback(BaseWrapperManagedConnection.java:1022)
   at org.jboss.jca.adapters.jdbc.WrappedConnection.rollback(WrappedConnection.java:778)
   at org.apache.ibatis.transaction.jdbc.JdbcTransaction.rollback(JdbcTransaction.java:77) [mybatis-3.1.1.jar:3.1.1]
   at org.apache.ibatis.executor.BaseExecutor.rollback(BaseExecutor.java:214) [mybatis-3.1.1.jar:3.1.1]
   at org.apache.ibatis.executor.CachingExecutor.rollback(CachingExecutor.java:120) [mybatis-3.1.1.jar:3.1.1]
   at org.apache.ibatis.session.defaults.DefaultSqlSession.rollback(DefaultSqlSession.java:182) [mybatis-3.1.1.jar:3.1.1]
   … 82 more

12:46:50,094 ERROR [stderr] (http–0.0.0.0-8182-1) org.apache.ibatis.exceptions.PersistenceException:

12:46:50,095 ERROR [stderr] (http–0.0.0.0-8182-1) ### Error committing transaction.  Cause: java.sql.SQLException: You cannot commit during a managed transaction!

12:46:50,096 ERROR [stderr] (http–0.0.0.0-8182-1) ### Cause: java.sql.SQLException: You cannot commit during a managed transaction!

12:46:50,096 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)

12:46:50,097 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.apache.ibatis.session.defaults.DefaultSqlSession.commit(DefaultSqlSession.java:170)

12:46:50,098 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.apache.ibatis.session.defaults.DefaultSqlSession.commit(DefaultSqlSession.java:162)

12:46:50,099 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.activiti.engine.impl.db.DbSqlSession.commit(DbSqlSession.java:493)

12:46:50,099 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.activiti.engine.impl.cfg.standalone.StandaloneMybatisTransactionContext.commit(StandaloneMybatisTransactionContext.java:58)

12:46:50,100 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:118)

12:46:50,101 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:49)

12:46:50,102 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)

12:46:50,103 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.activiti.engine.impl.RuntimeServiceImpl.deleteProcessInstance(RuntimeServiceImpl.java:79)

12:46:50,104 ERROR [stderr] (http–0.0.0.0-8182-1)    at net.treetechnologies.workflow.process.Process.deleteProcessByOrderId(Process.java:50)

12:46:50,104 ERROR [stderr] (http–0.0.0.0-8182-1)    at net.treetechnologies.party.services.PartyServicesImpl.cancelWorkflowProcess(PartyServicesImpl.java:8986)

12:46:50,106 ERROR [stderr] (http–0.0.0.0-8182-1)    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

12:46:50,106 ERROR [stderr] (http–0.0.0.0-8182-1)    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

12:46:50,107 ERROR [stderr] (http–0.0.0.0-8182-1)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

12:46:50,108 ERROR [stderr] (http–0.0.0.0-8182-1)    at java.lang.reflect.Method.invoke(Method.java:597)

12:46:50,109 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72)

12:46:50,110 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

12:46:50,111 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)

12:46:50,111 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:36)

12:46:50,112 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

12:46:50,113 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)

12:46:50,114 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

12:46:50,115 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)

12:46:50,116 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

12:46:50,116 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

12:46:50,117 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53)

12:46:50,118 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

12:46:50,119 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51)

12:46:50,120 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

12:46:50,121 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:228)

12:46:50,121 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:304)

12:46:50,122 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:190)

12:46:50,123 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

12:46:50,124 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)

12:46:50,125 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

12:46:50,125 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.as.ejb3.security.AuthorizationInterceptor.processInvocation(AuthorizationInterceptor.java:106)

12:46:50,126 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

12:46:50,127 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:76)

12:46:50,128 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

12:46:50,129 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59)

12:46:50,130 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

12:46:50,130 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)

12:46:50,131 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

12:46:50,132 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:32)

12:46:50,133 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

12:46:50,134 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)

12:46:50,135 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

12:46:50,136 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

12:46:50,137 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165)

12:46:50,137 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.as.webservices.invocation.AbstractInvocationHandlerEJB.invoke(AbstractInvocationHandlerEJB.java:112)

12:46:50,138 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.wsf.stack.cxf.JBossWSInvoker._invokeInternal(JBossWSInvoker.java:181)

12:46:50,139 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.wsf.stack.cxf.JBossWSInvoker.invoke(JBossWSInvoker.java:127)

12:46:50,140 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)

12:46:50,141 ERROR [stderr] (http–0.0.0.0-8182-1)    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)

12:46:50,141 ERROR [stderr] (http–0.0.0.0-8182-1)    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

12:46:50,142 ERROR [stderr] (http–0.0.0.0-8182-1)    at java.util.concurrent.FutureTask.run(FutureTask.java:138)

12:46:50,143 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)

12:46:50,143 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)

12:46:50,144 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)

12:46:50,145 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)

12:46:50,146 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:207)

12:46:50,147 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.wsf.stack.cxf.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:91)

12:46:50,147 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.wsf.stack.cxf.transport.ServletHelper.callRequestHandler(ServletHelper.java:169)

12:46:50,148 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.wsf.stack.cxf.CXFServletExt.invoke(CXFServletExt.java:87)

12:46:50,149 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:185)

12:46:50,150 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:108)

12:46:50,150 ERROR [stderr] (http–0.0.0.0-8182-1)    at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)

12:46:50,151 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.wsf.stack.cxf.CXFServletExt.service(CXFServletExt.java:135)

12:46:50,152 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.wsf.spi.deployment.WSFServlet.service(WSFServlet.java:140)

12:46:50,152 ERROR [stderr] (http–0.0.0.0-8182-1)    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

12:46:50,153 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)

12:46:50,154 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)

12:46:50,155 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)

12:46:50,155 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)

12:46:50,156 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:489)

12:46:50,157 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)

12:46:50,158 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)

12:46:50,159 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

12:46:50,160 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

12:46:50,161 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)

12:46:50,161 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)

12:46:50,162 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)

12:46:50,163 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)

12:46:50,164 ERROR [stderr] (http–0.0.0.0-8182-1)    at java.lang.Thread.run(Thread.java:662)

12:46:50,164 ERROR [stderr] (http–0.0.0.0-8182-1) Caused by: java.sql.SQLException: You cannot commit during a managed transaction!

12:46:50,165 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.jdbcCommit(BaseWrapperManagedConnection.java:981)

12:46:50,165 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.jboss.jca.adapters.jdbc.WrappedConnection.commit(WrappedConnection.java:757)

12:46:50,166 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.apache.ibatis.transaction.jdbc.JdbcTransaction.commit(JdbcTransaction.java:68)

12:46:50,167 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.apache.ibatis.executor.BaseExecutor.commit(BaseExecutor.java:203)

12:46:50,168 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.apache.ibatis.executor.CachingExecutor.commit(CachingExecutor.java:113)

12:46:50,168 ERROR [stderr] (http–0.0.0.0-8182-1)    at org.apache.ibatis.session.defaults.DefaultSqlSession.commit(DefaultSqlSession.java:167)

12:46:50,169 ERROR [stderr] (http–0.0.0.0-8182-1)    … 82 more



   This problem happening when I get the process engine by below code in Jboss 7.1 using JNDI name connection.

ProcessEngineConfiguration configuration = ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration();
            configuration.setDataSourceJndiName("java:jboss/datasources/workflow");
            configuration.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_FALSE);
            configuration.setJobExecutorActivate(true);


  This is not happening when I am getting process engine by direct connection like below code.

            ProcessEngineConfiguration configuration = ProcessEngineConfiguration
                  .createStandaloneInMemProcessEngineConfiguration()
                  .setJdbcUrl("jdbc:postgresql://"+host+":"+port+"/"+dbName)
                  .setJdbcDriver("org.postgresql.Driver")
                  .setJdbcUsername(userName)
                  .setJdbcPassword(password)
                  .setDatabaseSchemaUpdate(
                        ProcessEngineConfiguration.DB_SCHEMA_UPDATE_FALSE)
                        .setJobExecutorActivate(false)


  Any one please tell me what I have missed in between these two process engine config


Thanks,
s.selvakumar

Outcomes