Error Code-11001 - Problem with transaction Manager and throwing up exception to the client

Hello,

we have some trouble with the Jta Transaction manager when throwing up exceptions, when a processinstance has been started. Let me describe:

We have the following simplified process start:

Inside the task we are transforming and saving something in our db via our own registered transaction manager. For that we have registered our JTAConfiguration as follows:

  public class JtaConfigurationFactory {

  private DataSource dataSource;

  private String databaseSchemaUpdate;

  private TransactionManager transactionManager;

  private boolean transactionsExternallyManaged;

  boolean jobExecutorActivate = true;

  public JtaProcessEngineConfiguration getConfiguration() {
    JtaProcessEngineConfiguration conf = new JtaProcessEngineConfiguration();
    conf.setDataSource(dataSource);
    conf.setDatabaseSchemaUpdate(databaseSchemaUpdate);
    conf.setTransactionManager(transactionManager);
    conf.setJobExecutorActivate(jobExecutorActivate);
    conf.setTransactionsExternallyManaged(transactionsExternallyManaged);

    //register a custom incident handler
    conf.setCustomIncidentHandlers(Arrays.asList(new RequestIncidentHandler("failedJob")));
    return conf;
  }

The bean configuraiton xml file:

<!-- Beans -->
<bean id="configurationFactory"
    class="com.my.package.JtaConfigurationFactory">
   <property name="dataSource" ref="paxDataSource"/>
   <property name="databaseSchemaUpdate" value="true"/>
   <property name="transactionManager" ref="transactionManager"/>
   <property name="transactionsExternallyManaged" value="true"/>
   <property name="jobExecutorActivate" value="true"/>
</bean>
<reference id="paxDataSource" interface="javax.sql.DataSource" filter="(osgi.jndi.service.name=jdbc/dbSchemaName)"/>

We want the following behaviour:
If an exception occurs inside the service task the exception should be thrown to the component, which is calling #startProcessInstanceByKey(…). If the job is done successfully all the stuff inside the task has to be committed. For that i have set the property asynchronous after.

What we get:
If we start the process instance n times in a short time, the first processinstance-start is throwing the following exception:

org.camunda.bpm.engine.ProcessEngineException: ENGINE-11001 RollbackException while registering synchronization\r\n\tat org.camunda.bpm.engine.impl.cfg.TransactionLogger.exceptionWhileInteractingWithTransaction(TransactionLogger.java:25)\r\n\tat org.camunda.bpm.engine.impl.cfg.jta.JtaTransactionContext.addTransactionListener(JtaTransactionContext.java:77)\r\n\tat org.camunda.bpm.engine.impl.persistence.entity.JobManager.hintJobExecutor(JobManager.java:136)\r\n\tat org.camunda.bpm.engine.impl.persistence.entity.JobManager.send(JobManager.java:93)\r\n\tat org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.scheduleAtomicOperationAsync(ExecutionEntity.java:639)\r\n\tat org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:84)\r\n\tat org.camunda.bpm.engine.impl.interceptor.CommandContext.invokeNext(CommandContext.java:187)\r\n\tat org.camunda.bpm.engine.impl.interceptor.CommandContext.performNext(CommandContext.java:174)\r\n\tat org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:141)\r\n\tat org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:589)\r\n\tat org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:565)\r\n\tat org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl.start(PvmExecutionImpl.java:230)\r\n\tat org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.start(ExecutionEntity.java:427)\r\n\tat org.camunda.bpm.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:50)\r\n\tat org.camunda.bpm.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:29)\r\n\tat org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)\r\n\tat org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:104)\r\n\tat org.camunda.bpm.engine.impl.interceptor.JtaTransactionInterceptor.execute(JtaTransactionInterceptor.java:58)\r\n\tat org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:66)\r\n\tat org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)\r\n\tat org.camunda.bpm.engine.impl.ProcessInstantiationBuilderImpl.execute(ProcessInstantiationBuilderImpl.java:145)\r\n\tat org.camunda.bpm.engine.impl.ProcessInstantiationBuilderImpl.execute(ProcessInstantiationBuilderImpl.java:117)\r\n\tat org.camunda.bpm.engine.impl.RuntimeServiceImpl.startProcessInstanceByKey(RuntimeServiceImpl.java:85)\r\n\tat com.somePackage.core.process.service.ProcessService.startProcessInstance(ProcessService.java:231)\r\n\tat Proxyd9c2b986_e702_4499_89ab_32dfe09fdb1f.startProcessInstance(Unknown Source)\r\n\tat Proxyf477e831_a5b2_4f22_aae0_9e4f2597a376.startProcessInstance(Unknown Source)\r\n\tat com.somePackage.inbound.etsi.service.WorkflowTriggerService.triggerNewProcessInstance(WorkflowTriggerService.java:52)\r\n\tat com.somePackage.inbound.etsi.service.EtsiInboundCreator.createInbound(EtsiInboundCreator.java:42)\r\n\tat com.somePackage.inbound.etsi.service.EtsiInboundCreator.createInbound(EtsiInboundCreator.java:14)\r\n\tat Proxya30e9151_8041_48f8_85c5_4bbd61fed117.createInbound(Unknown Source)\r\n\tat com.somePackage.core.rest.InboundResource.createInbound(InboundResource.java:106)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:498)\r\n\tat org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180)\r\n\tat org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)\r\n\tat org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:189)\r\n\tat org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:99)\r\n\tat org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)\r\n\tat org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96)\r\n\tat org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)\r\n\tat org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)\r\n\tat org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:262)\r\n\tat org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)\r\n\tat org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)\r\n\tat org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)\r\n\tat org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:180)\r\n\tat org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:299)\r\n\tat org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPut(AbstractHTTPServlet.java:235)\r\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:710)\r\n\tat org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:274)\r\n\tat org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)\r\n\tat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)\r\n\tat org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71)\r\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)\r\n\tat org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)\r\n\tat org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)\r\n\tat org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)\r\n\tat org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:287)\r\n\tat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)\r\n\tat org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)\r\n\tat org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)\r\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)\r\n\tat org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)\r\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)\r\n\tat org.eclipse.jetty.server.Server.handle(Server.java:499)\r\n\tat org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)\r\n\tat org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)\r\n\tat org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)\r\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)\r\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)\r\n\tat java.lang.Thread.run(Thread.java:745)\r\nCaused by: javax.transaction.RollbackException: Transaction is marked for rollback\r\n\tat org.apache.geronimo.transaction.manager.TransactionImpl.registerSynchronization(TransactionImpl.java:154)\r\n\tat org.camunda.bpm.engine.impl.cfg.jta.JtaTransactionContext.addTransactionListener(JtaTransactionContext.java:74)\r\n\t… 71 more\r\n"}

Every following start of the processinstance is working fine, but (sometimes also the same issue). So this problem does randomly occur. The interesting thing is, that if i set the “asynchronous Before flag”, this exception does not occur anymore. Also not as a failed job. Everything works fine then and the commit is done.

So this exception is thrown by the camunda engine itself.

  1. When is camunda throwing this kind of exception with error code ENGINE-11001?
  2. Any ideas whats wrong or how to bring this to work? It is important, that the class, which is calling #startProcessInstanceByKey is informed about that error. We must not register it as a failed job

I would be very grateful for your help.

Best regards,
Andy

Hi Andy,

please provide the complete stack trace is a more readable format. The image is hard to read.

Best regards,
Philipp

Hi Philipp,

sorry for the screenshot, i will replace it, if i got this exception again. But i have figured out, what the real problem is by setting a breakpoint inside org.camunda.bpm.engine.impl.cfg.jta.JtaTransactionContext#rollback . It turns out, that this seems to be an mysql thing. Maybe the database version is to old?

I got the following rollbackCause:

cause = {SQLException@20916} “java.sql.SQLException: XAER_INVAL: Invalid arguments (or unsupported command)”
SQLState = “XAE05”
vendorCode = 1398
next = null
classContext = {Reference[165]@20921}
detailMessage = “XAER_INVAL: Invalid arguments (or unsupported command)
cause = {SQLException@20916} “java.sql.SQLException: XAER_INVAL: Invalid arguments (or unsupported command)
stackTrace = {StackTraceElement[169]@20922}
suppressedExceptions = {Collections$UnmodifiableRandomAccessList@20918} size = 0
stackTrace = {StackTraceElement[169]@20922}
0 = {StackTraceElement@20924} “com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)”
1 = {StackTraceElement@20925} “com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887)”
2 = {StackTraceElement@20926} “com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3823)”
3 = {StackTraceElement@20927} “com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2435)”
4 = {StackTraceElement@20928} “com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2582)”
5 = {StackTraceElement@20929} “com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2526)”
6 = {StackTraceElement@20930} “com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2484)”
7 = {StackTraceElement@20931} “com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:848)”
8 = {StackTraceElement@20932} “com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:742)”
9 = {StackTraceElement@20933} “com.mysql.jdbc.jdbc2.optional.MysqlXAConnection.dispatchCommand(MysqlXAConnection.java:560)”
10 = {StackTraceElement@20934} “com.mysql.jdbc.jdbc2.optional.MysqlXAConnection.start(MysqlXAConnection.java:507)”
11 = {StackTraceElement@20935} “org.apache.geronimo.transaction.manager.WrapperNamedXAResource.start(WrapperNamedXAResource.java:111)”
12 = {StackTraceElement@20936} “org.apache.geronimo.transaction.manager.TransactionImpl.enlistResource(TransactionImpl.java:202)”
13 = {StackTraceElement@20937} “org.apache.geronimo.connector.outbound.TransactionEnlistingInterceptor.getConnection(TransactionEnlistingInterceptor.java:60)”
14 = {StackTraceElement@20938} “org.apache.geronimo.connector.outbound.TransactionCachingInterceptor.getConnection(TransactionCachingInterceptor.java:101)”
15 = {StackTraceElement@20939} “org.apache.geronimo.connector.outbound.ConnectionHandleInterceptor.getConnection(ConnectionHandleInterceptor.java:43)”
16 = {StackTraceElement@20940} “org.apache.geronimo.connector.outbound.TCCLInterceptor.getConnection(TCCLInterceptor.java:39)”
17 = {StackTraceElement@20941} “org.apache.geronimo.connector.outbound.ConnectionTrackingInterceptor.getConnection(ConnectionTrackingInterceptor.java:66)”
18 = {StackTraceElement@20942} “org.apache.geronimo.connector.outbound.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:81)”
19 = {StackTraceElement@20943} “org.tranql.connector.jdbc.TranqlDataSource.getConnection(TranqlDataSource.java:75)”
20 = {StackTraceElement@20944} “org.apache.aries.transaction.jdbc.RecoverableDataSource.getConnection(RecoverableDataSource.java:253)”
21 = {StackTraceElement@20945} “org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:139)”
22 = {StackTraceElement@20946} “org.hibernate.internal.AbstractSessionImpl$NonContextualJdbcConnectionAccess.obtainConnection(AbstractSessionImpl.java:380)”
23 = {StackTraceElement@20947} “org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:228)”
24 = {StackTraceElement@20948} “org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.getConnection(LogicalConnectionImpl.java:171)”
25 = {StackTraceElement@20949} “org.hibernate.engine.jdbc.internal.StatementPreparerImpl.connection(StatementPreparerImpl.java:63)”
26 = {StackTraceElement@20950} “org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(StatementPreparerImpl.java:162)”
27 = {StackTraceElement@20951} “org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:186)”
28 = {StackTraceElement@20952} “org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:160)”
29 = {StackTraceElement@20953} “org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1884)”
30 = {StackTraceElement@20954} “org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1861)”
31 = {StackTraceElement@20955} “org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1838)”
32 = {StackTraceElement@20956} “org.hibernate.loader.Loader.doQuery(Loader.java:909)”
33 = {StackTraceElement@20957} “org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:354)”
34 = {StackTraceElement@20958} “org.hibernate.loader.Loader.doList(Loader.java:2553)”
35 = {StackTraceElement@20959} “org.hibernate.loader.Loader.doList(Loader.java:2539)”
36 = {StackTraceElement@20960} “org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2369)”
37 = {StackTraceElement@20961} “org.hibernate.loader.Loader.list(Loader.java:2364)”
38 = {StackTraceElement@20962} “org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:496)”
39 = {StackTraceElement@20963} “org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:387)”
40 = {StackTraceElement@20964} “org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:231)”
41 = {StackTraceElement@20965} “org.hibernate.internal.SessionImpl.list(SessionImpl.java:1264)”
42 = {StackTraceElement@20966} “org.hibernate.internal.QueryImpl.list(QueryImpl.java:103)”
43 = {StackTraceElement@20967} “org.hibernate.jpa.internal.QueryImpl.list(QueryImpl.java:573)”
44 = {StackTraceElement@20968} “org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:449)”
45 = {StackTraceElement@20969} “com.somepackage.core.dao.service.RequestTypeDao.findByPort(RequestTypeDao.java:43)”
46 = {StackTraceElement@20970} “Proxyebf7c5fe_7a26_4bc1_80ea_e01f42c4fc29.findByPort(Unknown Source)”
47 = {StackTraceElement@20971} “Proxyb1830bab_0a5e_49bf_80cf_b205eab40569.findByPort(Unknown Source)”
48 = {StackTraceElement@20972} “com.somepackage.core.services.request.RequestTypeService.findByPort(RequestTypeService.java:18)”
49 = {StackTraceElement@20973} “Proxyffb14479_e2e8_4552_a045_1985e23e9eef.findByPort(Unknown Source)”
50 = {StackTraceElement@20974} “Proxyac2cdb97_f3d2_4abe_ba8b_872ba583a32f.findByPort(Unknown Source)”
51 = {StackTraceElement@20975} “com.somepackage.core.services.AbstractEtsiInboundHandler.getRequestTypeByPort(AbstractEtsiInboundHandler.java:34)”
52 = {StackTraceElement@20976} “com.somepackage.core.delegates.EtsiInboundHandler.createInboundRequest(EtsiInboundHandler.java:53)”
53 = {StackTraceElement@20977} “com.somepackage.core.delegates.EtsiInboundHandler.createInboundRequest(EtsiInboundHandler.java:47)”
54 = {StackTraceElement@20978} “Proxyc01ca2f4_d2f4_4adb_8033_e0d1772f3d73.createInboundRequest(Unknown Source)”
55 = {StackTraceElement@20979} “com.somepackage.core.delegates.DelegateCaisTransformation.execute(DelegateCaisTransformation.java:43)”
56 = {StackTraceElement@20980} “Proxy7d129465_7917_4dea_a016_55a8d08cd05c.execute(Unknown Source)”
57 = {StackTraceElement@20981} “org.camunda.bpm.engine.impl.bpmn.delegate.JavaDelegateInvocation.invoke(JavaDelegateInvocation.java:36)”
58 = {StackTraceElement@20982} “org.camunda.bpm.engine.impl.delegate.DelegateInvocation.proceed(DelegateInvocation.java:54)”
59 = {StackTraceElement@20983} “org.camunda.bpm.engine.impl.delegate.DefaultDelegateInterceptor.handleInvocationInContext(DefaultDelegateInterceptor.java:87)”
60 = {StackTraceElement@20984} “org.camunda.bpm.engine.impl.delegate.DefaultDelegateInterceptor.handleInvocation(DefaultDelegateInterceptor.java:59)”
61 = {StackTraceElement@20985} “org.camunda.bpm.engine.impl.bpmn.behavior.ServiceTaskDelegateExpressionActivityBehavior$3.call(ServiceTaskDelegateExpressionActivityBehavior.java:112)”
62 = {StackTraceElement@20986} “org.camunda.bpm.engine.impl.bpmn.behavior.ServiceTaskDelegateExpressionActivityBehavior$3.call(ServiceTaskDelegateExpressionActivityBehavior.java:98)”
63 = {StackTraceElement@20987} “org.camunda.bpm.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior.executeWithErrorPropagation(AbstractBpmnActivityBehavior.java:105)”
64 = {StackTraceElement@20988} “org.camunda.bpm.engine.impl.bpmn.behavior.ServiceTaskDelegateExpressionActivityBehavior.execute(ServiceTaskDelegateExpressionActivityBehavior.java:123)”
65 = {StackTraceElement@20989} “org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationActivityExecute.execute(PvmAtomicOperationActivityExecute.java:41)”
66 = {StackTraceElement@20990} “org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationActivityExecute.execute(PvmAtomicOperationActivityExecute.java:26)”
67 = {StackTraceElement@20991} “org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:81)”
68 = {StackTraceElement@20992} “org.camunda.bpm.engine.impl.interceptor.CommandContext.invokeNext(CommandContext.java:187)”
69 = {StackTraceElement@20993} “org.camunda.bpm.engine.impl.interceptor.CommandContext.performNext(CommandContext.java:166)”
70 = {StackTraceElement@20994} “org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:141)”
71 = {StackTraceElement@20995} “org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:589)”
72 = {StackTraceElement@20996} “org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:565)”
73 = {StackTraceElement@20997} “org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationTransitionNotifyListenerStart.eventNotificationsCompleted(PvmAtomicOperationTransitionNotifyListenerStart.java:56)”
74 = {StackTraceElement@20998} “org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationTransitionNotifyListenerStart.eventNotificationsCompleted(PvmAtomicOperationTransitionNotifyListenerStart.java:26)”
75 = {StackTraceElement@20999} “org.camunda.bpm.engine.impl.core.operation.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:65)”
76 = {StackTraceElement@21000} “org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:81)”
77 = {StackTraceElement@21001} “org.camunda.bpm.engine.impl.interceptor.CommandContext.invokeNext(CommandContext.java:187)”
78 = {StackTraceElement@21002} “org.camunda.bpm.engine.impl.interceptor.CommandContext.performNext(CommandContext.java:166)”
79 = {StackTraceElement@21003} “org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:141)”
80 = {StackTraceElement@21004} “org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:131)”
81 = {StackTraceElement@21005} “org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:600)”
82 = {StackTraceElement@21006} “org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:575)”
83 = {StackTraceElement@21007} “org.camunda.bpm.engine.impl.core.operation.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:58)”
84 = {StackTraceElement@21008} “org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:81)”
85 = {StackTraceElement@21009} “org.camunda.bpm.engine.impl.interceptor.CommandContext.invokeNext(CommandContext.java:187)”
86 = {StackTraceElement@21010} “org.camunda.bpm.engine.impl.interceptor.CommandContext.performNext(CommandContext.java:166)”
87 = {StackTraceElement@21011} “org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:141)”
88 = {StackTraceElement@21012} “org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:131)”
89 = {StackTraceElement@21013} “org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:600)”
90 = {StackTraceElement@21014} “org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:575)”
91 = {StackTraceElement@21015} “org.camunda.bpm.engine.impl.core.operation.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:58)”
92 = {StackTraceElement@21016} “org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:81)”
93 = {StackTraceElement@21017} “org.camunda.bpm.engine.impl.interceptor.CommandContext.invokeNext(CommandContext.java:187)”
94 = {StackTraceElement@21018} “org.camunda.bpm.engine.impl.interceptor.CommandContext.performNext(CommandContext.java:166)”
95 = {StackTraceElement@21019} “org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:141)”
96 = {StackTraceElement@21020} “org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:589)”
97 = {StackTraceElement@21021} “org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:565)”
98 = {StackTraceElement@21022} “org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationTransitionCreateScope.scopeCreated(PvmAtomicOperationTransitionCreateScope.java:34)”
99 = {StackTraceElement@21023} “org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationCreateScope.execute(PvmAtomicOperationCreateScope.java:49)”
100 = {StackTraceElement@21243} “org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationCreateScope.execute(PvmAtomicOperationCreateScope.java:23)”
101 = {StackTraceElement@21244} “org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:81)”
102 = {StackTraceElement@21245} “org.camunda.bpm.engine.impl.interceptor.CommandContext.invokeNext(CommandContext.java:187)”
103 = {StackTraceElement@21246} “org.camunda.bpm.engine.impl.interceptor.CommandContext.performNext(CommandContext.java:174)”
104 = {StackTraceElement@21247} “org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:141)”
105 = {StackTraceElement@21248} “org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:589)”
106 = {StackTraceElement@21249} “org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:565)”
107 = {StackTraceElement@21250} “org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl.start(PvmExecutionImpl.java:230)”
108 = {StackTraceElement@21251} “org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.start(ExecutionEntity.java:427)”
109 = {StackTraceElement@21252} “org.camunda.bpm.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:50)”
110 = {StackTraceElement@21253} “org.camunda.bpm.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:29)”
111 = {StackTraceElement@21254} “org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)”
112 = {StackTraceElement@21255} “org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:104)”
113 = {StackTraceElement@21256} “org.camunda.bpm.engine.impl.interceptor.JtaTransactionInterceptor.execute(JtaTransactionInterceptor.java:58)”
114 = {StackTraceElement@21257} “org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:66)”
115 = {StackTraceElement@21258} “org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)”
116 = {StackTraceElement@21259} “org.camunda.bpm.engine.impl.ProcessInstantiationBuilderImpl.execute(ProcessInstantiationBuilderImpl.java:145)”
117 = {StackTraceElement@21260} “org.camunda.bpm.engine.impl.ProcessInstantiationBuilderImpl.execute(ProcessInstantiationBuilderImpl.java:117)”
118 = {StackTraceElement@21261} “org.camunda.bpm.engine.impl.RuntimeServiceImpl.startProcessInstanceByKey(RuntimeServiceImpl.java:85)”
119 = {StackTraceElement@21262} “com.somepackage.core.process.service.ProcessService.startProcessInstance(ProcessService.java:233)”
120 = {StackTraceElement@21263} “Proxy1581d324_7211_46fe_986e_f568ae0fa38c.startProcessInstance(Unknown Source)”
121 = {StackTraceElement@21264} “Proxy255f42a5_d9e8_4396_b49a_37c54496516f.startProcessInstance(Unknown Source)”
122 = {StackTraceElement@21265} “com.somepackage.inbound.etsi.service.WorkflowTriggerService.triggerNewProcessInstance(WorkflowTriggerService.java:52)”
123 = {StackTraceElement@21266} “com.somepackage.inbound.etsi.service.EtsiInboundCreator.createInbound(EtsiInboundCreator.java:42)”
124 = {StackTraceElement@21267} “com.somepackage.inbound.etsi.service.EtsiInboundCreator.createInbound(EtsiInboundCreator.java:14)”
125 = {StackTraceElement@21268} “Proxy63a713e8_918e_4e64_8e18_807958aad48b.createInbound(Unknown Source)”
126 = {StackTraceElement@21269} “com.somepackage.core.rest.InboundResource.createInbound(InboundResource.java:106)”
127 = {StackTraceElement@21270} “sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)”
128 = {StackTraceElement@21271} “sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)”
129 = {StackTraceElement@21272} “sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)”
130 = {StackTraceElement@21273} “java.lang.reflect.Method.invoke(Method.java:498)”
131 = {StackTraceElement@21274} “org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180)”
132 = {StackTraceElement@21275} “org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)”
133 = {StackTraceElement@21276} “org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:189)”
134 = {StackTraceElement@21277} “org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:99)”
135 = {StackTraceElement@21278} “org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)”
136 = {StackTraceElement@21279} “org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96)”
137 = {StackTraceElement@21280} “org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)”
138 = {StackTraceElement@21281} “org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)”
139 = {StackTraceElement@21282} “org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:262)”
140 = {StackTraceElement@21283} “org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)”
141 = {StackTraceElement@21284} “org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)”
142 = {StackTraceElement@21285} “org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)”
143 = {StackTraceElement@21286} “org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:180)”
144 = {StackTraceElement@21287} “org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:299)”
145 = {StackTraceElement@21288} “org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPut(AbstractHTTPServlet.java:235)”
146 = {StackTraceElement@21289} “javax.servlet.http.HttpServlet.service(HttpServlet.java:710)”
147 = {StackTraceElement@21290} “org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:274)”
148 = {StackTraceElement@21291} “org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)”
149 = {StackTraceElement@21292} “org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)”
150 = {StackTraceElement@21293} “org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71)”
151 = {StackTraceElement@21294} “org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)”
152 = {StackTraceElement@21295} “org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)”
153 = {StackTraceElement@21296} “org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)”
154 = {StackTraceElement@21297} “org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)”
155 = {StackTraceElement@21298} “org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:287)”
156 = {StackTraceElement@21299} “org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)”
157 = {StackTraceElement@21300} “org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)”
158 = {StackTraceElement@21301} “org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)”
159 = {StackTraceElement@21302} “org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)”
160 = {StackTraceElement@21303} “org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)”
161 = {StackTraceElement@21304} “org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)”
162 = {StackTraceElement@21305} “org.eclipse.jetty.server.Server.handle(Server.java:499)”
163 = {StackTraceElement@21306} “org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)”
164 = {StackTraceElement@21307} “org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)”
165 = {StackTraceElement@21308} “org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)”
166 = {StackTraceElement@21309} “org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)”
167 = {StackTraceElement@21310} “org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)”
168 = {StackTraceElement@21311} “java.lang.Thread.run(Thread.java:745)”

We are using the following database evironments:
Currently we are using mysql-connector-java in version 5.1.38 and
mysql Ver 14.14 Distrib 5.7.18, for Linux (x86_64)

It seems to be, that Camunda is possibly given a not supported command to the datbase or something like this.

Thanks and best regards,
Andy

Hi Andy,

your MySQL version should be ok. Please enable the debug logging for org.camunda.bpm.engine.persistence so that we can which SQL statemant causes the rollback.

Do you insert any custom data within the same transaction that can cause the rollback?

Best regards,
Philipp

Hi Philipp,

thank you for your advice. I have logged all the packages and also mybatis. This is the most detailed log i could produce for this rollback exception error. Look the Rollback Exception on the bottom:

camunda_rollback.log (454.5 KB)

Some further information:

  • Task_SaveADocument is the id of the ‘save a document in own db’ task (see post on top)
  • The last job definition select statement is looking for id 6816. In the database it is referencing to the async after job-definition of Task_SaveADocument. See here:

In business speaking the task is doing the folowing thing:

  • get a json, which is passed through a variable on processinstance start. It is a long json String. So we are passing it as follows:

      @Override
        public String startProcessInstance(String processDefinitionKey, String originalJsonRequest) throws FailToStartProcessInstanceException {
          RuntimeService runtimeService = processEngine.getRuntimeService();
    
          BytesValue fileValue = Variables.byteArrayValue(originalJsonRequest.getBytes());
          VariableMap variableMap = Variables.createVariables()
            .putValue("ORIGINAL_JSON_REQUEST", fileValue);
    
          try {
            ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processDefinitionKey, variableMap);
            String processInstanceId = processInstance.getId();
            return processInstanceId;
          } catch (Exception ex) {
            log.error("Error during start process instance : message: {}; stacktrace: {}", ex.getMessage(), ExceptionUtils.getStackTrace(ex));
            throw ex;
          }
        }
    
  • transform the json into our own json data format, extract the parameters and generate a Document-entity. It is saved in the task by using a DocumentService. It stores it in our own database. The save method of the DocumentService is marked with @Transactional(Transactional.TxType.REQUIRED) in order to proceed the transaction, which was started by Camunda

  • after that the flow is going through the delegate until the async after job wants to be performed. Then the exception in the log is thrown. But randomly! The error is not really reproducable.

If you need any further information, just ask.

Thanks a lot and best regards,
Andy

Hi Andy,

as far as I can see, there’s no exception on Camunda side. I assume that the transaction is rolled back because of the Document Service. Can you verify this?

Best regards,
Philipp