ARJUNA016082: Synchronizations are not allowed! Transaction status isActionStatus.RUNNING

61 views
Skip to first unread message

Alex T

unread,
Jan 26, 2021, 1:01:23 PM1/26/21
to narayana-users

Hi!

I have this exception:

Caused by: org.hibernate.engine.transaction.jta.platform.spi.JtaPlatformException: Could not access JTA Transaction to register synchronization

at deployment.kie-server.war//org.hibernate.engine.transaction.jta.platform.internal.TransactionManagerBasedSynchronizationStrategy.registerSynchronization(TransactionManagerBasedSynchronizationStrategy.java:33)

at deployment.kie-server.war//org.hibernate.engine.transaction.jta.platform.internal.AbstractJtaPlatform.registerSynchronization(AbstractJtaPlatform.java:126)

at deployment.kie-server.war//org.hibernate.resource.transaction.backend.jta.internal.JtaTransactionCoordinatorImpl.joinJtaTransaction(JtaTransactionCoordinatorImpl.java:170)

at deployment.kie-server.war//org.hibernate.resource.transaction.backend.jta.internal.JtaTransactionCoordinatorImpl.pulse(JtaTransactionCoordinatorImpl.java:158)

at deployment.kie-server.war//org.hibernate.internal.AbstractSharedSessionContract.pulseTransactionCoordinator(AbstractSharedSessionContract.java:480)

at deployment.kie-server.war//org.hibernate.internal.AbstractSharedSessionContract.checkTransactionSynchStatus(AbstractSharedSessionContract.java:474)

at deployment.kie-server.war//org.hibernate.internal.SessionImpl.fireMerge(SessionImpl.java:902)

... 117 more

Caused by: java.lang.IllegalStateException: ARJUNA016082: Synchronizations are not allowed! Transaction status isActionStatus.RUNNING

at org.jboss.jts//com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.registerSynchronizationImple(TransactionImple.java:400)

at org.jboss.jts//com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.registerSynchronization(TransactionImple.java:376)

at org.wildfly.tra...@1.1.9.Final//org.wildfly.transaction.client.LocalTransaction.registerSynchronization(LocalTransaction.java:178)

at deployment.kie-server.war//org.hibernate.engine.transaction.jta.platform.internal.TransactionManagerBasedSynchronizationStrategy.registerSynchronization(TransactionManagerBasedSynchronizationStrategy.java:30)

It is inside jbpm, so it is not easy to deploy my environment, and seems no easy way to reproduce it. I don't found solution in internet about this exception. 

May be anybody can explain common cases of this problem and workaround?



Ondra Chaloupka

unread,
Jan 27, 2021, 4:11:11 AM1/27/21
to narayana-users
Hi,

the exception could be caused by different aspects. The synchronization was rejected to be registered to the currently running transaction. It could be that the code tries to register an undefined (a null) synchronization. It could be that the code tries to register synchronization late and the transaction has already started to finish. Or in case the transaction is a nested one and the synchronization for jta can be added only at the top-level transaction.
The real cause depends on your runtime.

Maybe if you can provide log of your application around this occurence, with logging category "com.arjuna" set to TRACE, it could possible to say more.

Ondra

jhal...@redhat.com

unread,
Jan 27, 2021, 4:48:54 AM1/27/21
to narayana-users
You left out most of the trace, but odds are that's from inside the beforeCompletion call of an interposed synchronization. Explicitly use hibernate earlier in the transaction to force it to register first.

Jonathan

Alex T

unread,
Jan 27, 2021, 7:50:24 AM1/27/21
to narayana-users
With TRACE option there are no additional log messages appears. From com.arjuna.ats.arjuna there one my stacktrace:


11:37:11,821 WARN  [com.arjuna.ats.arjuna] (default task-2) ARJUNA012125: TwoPhaseCoordinator.beforeCompletion - failed for SynchronizationImple< 0:ffffac110003:254a3364:60114f9a:e04, org.wildfly.transaction.client.AbstractTransaction$AssociatingSynchronization@756f5b5d >: javax.persistence.PersistenceException: org.hibernate.engine.transaction.jta.platform.spi.JtaPlatformException: Could not access JTA Transaction to register synchronization
    at deployment.kie-server.war//org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:154)
    at deployment.kie-server.war//org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:181)
    at deployment.kie-server.war//org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:188)
    at deployment.kie-server.war//org.hibernate.internal.SessionImpl.fireMerge(SessionImpl.java:917)
    at deployment.kie-server.war//org.hibernate.internal.SessionImpl.merge(SessionImpl.java:891)
    at net.app.CustomJPAPlaceholderResolverStrategy.marshallObject(CustomJPAPlaceholderResolverStrategy.java:185)
    at net.app.CustomJPAPlaceholderResolverStrategy.marshal(CustomJPAPlaceholderResolverStrategy.java:272)
    at deployment.kie-server.war//org.jbpm.marshalling.impl.ProtobufProcessMarshaller.marshallVariable(ProtobufProcessMarshaller.java:269)
    at deployment.kie-server.war//org.jbpm.marshalling.impl.AbstractProtobufProcessInstanceMarshaller.writeProcessInstance(AbstractProtobufProcessInstanceMarshaller.java:164)
    at deployment.kie-server.war//org.jbpm.marshalling.impl.AbstractProtobufProcessInstanceMarshaller.writeProcessInstance(AbstractProtobufProcessInstanceMarshaller.java:75)
    at deployment.kie-server.war//org.jbpm.persistence.processinstance.ProcessInstanceInfo.transform(ProcessInstanceInfo.java:244)
    at deployment.kie-server.war//org.drools.persistence.TriggerUpdateTransactionSynchronization.beforeCompletion(TriggerUpdateTransactionSynchronization.java:61)
    at deployment.kie-server.war//org.drools.persistence.jta.JtaTransactionSynchronizationAdapter.beforeCompletion(JtaTransactionSynchronizationAdapter.java:54)
    at org.jboss.as...@19.1.0.Final//org.jboss.as.txn.service.internal.tsr.JCAOrderedLastSynchronizationList.beforeCompletion(JCAOrderedLastSynchronizationList.java:113)
    at org.wildfly.tra...@1.1.9.Final//org.wildfly.transaction.client.AbstractTransaction.performConsumer(AbstractTransaction.java:236)
    at org.wildfly.tra...@1.1.9.Final//org.wildfly.transaction.client.AbstractTransaction.performConsumer(AbstractTransaction.java:247)
    at org.wildfly.tra...@1.1.9.Final//org.wildfly.transaction.client.AbstractTransaction$AssociatingSynchronization.beforeCompletion(AbstractTransaction.java:292)
    at org.jboss.jts//com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:76)
    at org.jboss.jts//com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:360)
    at org.jboss.jts//com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:91)
    at org.jboss.jts//com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:162)
    at org.jboss.jts//com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1287)
    at org.jboss.jts//com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:126)
    at org.jboss.jts.integration//com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:94)
    at org.wildfly.tra...@1.1.9.Final//org.wildfly.transaction.client.LocalTransaction.commitAndDissociate(LocalTransaction.java:75)
    at org.wildfly.tra...@1.1.9.Final//org.wildfly.transaction.client.ContextTransactionManager.commit(ContextTransactionManager.java:71)
    at org.wildfly.tra...@1.1.9.Final//org.wildfly.transaction.client.LocalUserTransaction.commit(LocalUserTransaction.java:53)
    at deployment.kie-server.war//org.drools.persistence.jta.JtaTransactionManager.commit(JtaTransactionManager.java:246)
    at deployment.kie-server.war//org.drools.persistence.PersistableRunner$TransactionInterceptor.execute(PersistableRunner.java:600)
    at deployment.kie-server.war//org.drools.persistence.PersistableRunner$TransactionInterceptor.execute(PersistableRunner.java:563)
    at deployment.kie-server.war//org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:39)
    at deployment.kie-server.war//org.drools.persistence.jpa.OptimisticLockRetryInterceptor.internalExecute(OptimisticLockRetryInterceptor.java:102)
    at deployment.kie-server.war//org.drools.persistence.jpa.OptimisticLockRetryInterceptor.execute(OptimisticLockRetryInterceptor.java:83)
    at deployment.kie-server.war//org.drools.persistence.jpa.OptimisticLockRetryInterceptor.execute(OptimisticLockRetryInterceptor.java:44)
    at deployment.kie-server.war//org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:39)
    at deployment.kie-server.war//org.drools.persistence.jta.TransactionLockInterceptor.execute(TransactionLockInterceptor.java:73)
    at deployment.kie-server.war//org.drools.persistence.jta.TransactionLockInterceptor.execute(TransactionLockInterceptor.java:45)
    at deployment.kie-server.war//org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:39)
    at deployment.kie-server.war//org.jbpm.runtime.manager.impl.error.ExecutionErrorHandlerInterceptor.internalExecute(ExecutionErrorHandlerInterceptor.java:66)
    at deployment.kie-server.war//org.jbpm.runtime.manager.impl.error.ExecutionErrorHandlerInterceptor.execute(ExecutionErrorHandlerInterceptor.java:52)
    at deployment.kie-server.war//org.jbpm.runtime.manager.impl.error.ExecutionErrorHandlerInterceptor.execute(ExecutionErrorHandlerInterceptor.java:29)
    at deployment.kie-server.war//org.drools.persistence.PersistableRunner.execute(PersistableRunner.java:398)
    at deployment.kie-server.war//org.drools.persistence.PersistableRunner.execute(PersistableRunner.java:66)
    at deployment.kie-server.war//org.drools.core.runtime.InternalLocalRunner.execute(InternalLocalRunner.java:37)
    at deployment.kie-server.war//org.drools.core.runtime.InternalLocalRunner.execute(InternalLocalRunner.java:41)
    at deployment.kie-server.war//org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession.execute(CommandBasedStatefulKnowledgeSession.java:537)
    at deployment.kie-server.war//org.jbpm.kie.services.impl.ProcessServiceImpl.setProcessVariable(ProcessServiceImpl.java:391)
    at deployment.kie-server.war//org.kie.server.services.jbpm.ProcessServiceBase.setProcessVariable(ProcessServiceBase.java:273)
    at deployment.kie-server.war//org.kie.server.remote.rest.jbpm.ProcessResource.setProcessVariable(ProcessResource.java:536)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.jboss.restea...@3.11.2.Final//org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:138)
    at org.jboss.restea...@3.11.2.Final//org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:535)
    at org.jboss.restea...@3.11.2.Final//org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:424)
    at org.jboss.restea...@3.11.2.Final//org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$0(ResourceMethodInvoker.java:385)
    at org.jboss.restea...@3.11.2.Final//org.jboss.resteasy.core.interception.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:356)
    at org.jboss.restea...@3.11.2.Final//org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:387)
    at org.jboss.restea...@3.11.2.Final//org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:356)
    at org.jboss.restea...@3.11.2.Final//org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:329)
    at org.jboss.restea...@3.11.2.Final//org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:440)
    at org.jboss.restea...@3.11.2.Final//org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:229)
    at org.jboss.restea...@3.11.2.Final//org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:135)
    at org.jboss.restea...@3.11.2.Final//org.jboss.resteasy.core.interception.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:356)
    at org.jboss.restea...@3.11.2.Final//org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:138)
    at org.jboss.restea...@3.11.2.Final//org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:215)
    at org.jboss.restea...@3.11.2.Final//org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:227)
    at org.jboss.restea...@3.11.2.Final//org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
    at org.jboss.restea...@3.11.2.Final//org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
    at javax.se...@2.0.0.Final//javax.servlet.http.HttpServlet.service(HttpServlet.java:590)
    at io.undert...@2.1.0.Final//io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
    at io.undert...@2.1.0.Final//io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
    at io.opentracing.contrib.opentracing-jaxrs2//io.opentracing.contrib.jaxrs2.server.SpanFinishingFilter.doFilter(SpanFinishingFilter.java:52)
    at io.undert...@2.1.0.Final//io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
    at io.undert...@2.1.0.Final//io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
    at io.undert...@2.1.0.Final//io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
    at io.undert...@2.1.0.Final//io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
    at io.undert...@2.1.0.Final//io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
    at io.undert...@2.1.0.Final//io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
    at org.wildfly.ext...@19.1.0.Final//org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
    at io.under...@2.1.0.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at io.undert...@2.1.0.Final//io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68)
    at io.undert...@2.1.0.Final//io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:132)
    at io.undert...@2.1.0.Final//io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
    at io.under...@2.1.0.Final//io.undertow.server.handlers.DisableCacheHandler.handleRequest(DisableCacheHandler.java:33)
    at io.under...@2.1.0.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at io.under...@2.1.0.Final//io.undertow.security.handlers.AuthenticationConstraintHandler.handleRequest(AuthenticationConstraintHandler.java:53)
    at io.under...@2.1.0.Final//io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
    at io.undert...@2.1.0.Final//io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
    at io.undert...@2.1.0.Final//io.undertow.servlet.handlers.security.ServletSecurityConstraintHandler.handleRequest(ServletSecurityConstraintHandler.java:59)
    at io.under...@2.1.0.Final//io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
    at io.undert...@2.1.0.Final//io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
    at io.under...@2.1.0.Final//io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
    at io.under...@2.1.0.Final//io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
    at io.under...@2.1.0.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at org.wildfly.ext...@19.1.0.Final//org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
    at io.under...@2.1.0.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at org.wildfly.ext...@19.1.0.Final//org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68)
    at io.under...@2.1.0.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at io.undert...@2.1.0.Final//io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:269)
    at io.undert...@2.1.0.Final//io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:78)
    at io.undert...@2.1.0.Final//io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:133)
    at io.undert...@2.1.0.Final//io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:130)
    at io.undert...@2.1.0.Final//io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
    at io.undert...@2.1.0.Final//io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
    at org.wildfly.ext...@19.1.0.Final//org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
    at org.wildfly.ext...@19.1.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1541)
    at org.wildfly.ext...@19.1.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1541)
    at org.wildfly.ext...@19.1.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1541)
    at org.wildfly.ext...@19.1.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1541)
    at io.undert...@2.1.0.Final//io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:249)
    at io.undert...@2.1.0.Final//io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:78)
    at io.under...@2.1.0.Final//io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
    at org.jbos...@2.3.3.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
    at org.jbos...@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
    at org.jbos...@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
    at org.jbos...@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
    at java.base/java.lang.Thread.run(Thread.java:834)

Caused by: org.hibernate.engine.transaction.jta.platform.spi.JtaPlatformException: Could not access JTA Transaction to register synchronization
    at deployment.kie-server.war//org.hibernate.engine.transaction.jta.platform.internal.TransactionManagerBasedSynchronizationStrategy.registerSynchronization(TransactionManagerBasedSynchronizationStrategy.java:33)
    at deployment.kie-server.war//org.hibernate.engine.transaction.jta.platform.internal.AbstractJtaPlatform.registerSynchronization(AbstractJtaPlatform.java:126)
    at deployment.kie-server.war//org.hibernate.resource.transaction.backend.jta.internal.JtaTransactionCoordinatorImpl.joinJtaTransaction(JtaTransactionCoordinatorImpl.java:170)
    at deployment.kie-server.war//org.hibernate.resource.transaction.backend.jta.internal.JtaTransactionCoordinatorImpl.pulse(JtaTransactionCoordinatorImpl.java:158)
    at deployment.kie-server.war//org.hibernate.internal.AbstractSharedSessionContract.pulseTransactionCoordinator(AbstractSharedSessionContract.java:480)
    at deployment.kie-server.war//org.hibernate.internal.AbstractSharedSessionContract.checkTransactionSynchStatus(AbstractSharedSessionContract.java:474)
    at deployment.kie-server.war//org.hibernate.internal.SessionImpl.fireMerge(SessionImpl.java:902)
    ... 117 more
Caused by: java.lang.IllegalStateException: ARJUNA016082: Synchronizations are not allowed! Transaction status isActionStatus.RUNNING
    at org.jboss.jts//com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.registerSynchronizationImple(TransactionImple.java:400)
    at org.jboss.jts//com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.registerSynchronization(TransactionImple.java:376)
    at org.wildfly.tra...@1.1.9.Final//org.wildfly.transaction.client.LocalTransaction.registerSynchronization(LocalTransaction.java:178)
    at deployment.kie-server.war//org.hibernate.engine.transaction.jta.platform.internal.TransactionManagerBasedSynchronizationStrategy.registerSynchronization(TransactionManagerBasedSynchronizationStrategy.java:30)
    ... 123 more...@2.1.0.Final//io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:99)
    at io.under...@2.1.0.Final//io.undertow.server.Connectors.executeRootHandler(Connectors.java:370)
    at io.under...@2.1.0.Final//io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
    at org.jbos...@2.3.3.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
    at org.jbos...@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
    at org.jbos...@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
    at org.jbos...@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
    at java.base/java.lang.Thread.run(Thread.java:834)

Caused by: org.hibernate.engine.transaction.jta.platform.spi.JtaPlatformException: Could not access JTA Transaction to register synchronization
    at deployment.kie-server.war//org.hibernate.engine.transaction.jta.platform.internal.TransactionManagerBasedSynchronizationStrategy.registerSynchronization(TransactionManagerBasedSynchronizationStrategy.java:33)
    at deployment.kie-server.war//org.hibernate.engine.transaction.jta.platform.internal.AbstractJtaPlatform.registerSynchronization(AbstractJtaPlatform.java:126)
    at deployment.kie-server.war//org.hibernate.resource.transaction.backend.jta.internal.JtaTransactionCoordinatorImpl.joinJtaTransaction(JtaTransactionCoordinatorImpl.java:170)
    at deployment.kie-server.war//org.hibernate.resource.transaction.backend.jta.internal.JtaTransactionCoordinatorImpl.pulse(JtaTransactionCoordinatorImpl.java:158)
    at deployment.kie-server.war//org.hibernate.internal.AbstractSharedSessionContract.pulseTransactionCoordinator(AbstractSharedSessionContract.java:480)
    at deployment.kie-server.war//org.hibernate.internal.AbstractSharedSessionContract.checkTransactionSynchStatus(AbstractSharedSessionContract.java:474)
    at deployment.kie-server.war//org.hibernate.internal.SessionImpl.fireMerge(SessionImpl.java:902)
    ... 117 more
Caused by: java.lang.IllegalStateException: ARJUNA016082: Synchronizations are not allowed! Transaction status isActionStatus.RUNNING
    at org.jboss.jts//com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.registerSynchronizationImple(TransactionImple.java:400)
    at org.jboss.jts//com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.registerSynchronization(TransactionImple.java:376)
    at org.wildfly.tra...@1.1.9.Final//org.wildfly.transaction.client.LocalTransaction.registerSynchronization(LocalTransaction.java:178)
    at deployment.kie-server.war//org.hibernate.engine.transaction.jta.platform.internal.TransactionManagerBasedSynchronizationStrategy.registerSynchronization(TransactionManagerBasedSynchronizationStrategy.java:30)
    ... 123 more



Ondra Chaloupka

unread,
Jan 28, 2021, 6:49:11 AM1/28/21
to narayana-users
@nnm.china thanks for the details.

I can only try to rephrase what Jonhathan already said. The code tries  to register a new synchronization at time when transaction is finishing. The registration seems to happen during the `beforeCompletion`. There is under execution the interposed synchronizations (https://docs.oracle.com/javaee/7/api/javax/transaction/TransactionSynchronizationRegistry.html#registerInterposedSynchronization-javax.transaction.Synchronization-) ie. org.jboss.as.txn.service.internal.tsr.JCAOrderedLastSynchronizationList. At that point the code is not permitted to add any new synchronization for the transaction.

From the stacktrace[1] it seems to me the listed strategy code (net.app.CustomJPAPlaceholderResolverStrategy) makes some changes at the hibernate entity. When the entity changes are run within the transaction then the transaction commit makes them to be flushed. This is done during the `beforeCompletion`. Because of that the changes on the entity needs to be registered as a transaction synchronization (as the write to database may happen for it). Maybe do the data processing in a separate transaction could help...
Still it really depends on your case.


[1]
...
    at deployment.kie-server.war//org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:188)
    at deployment.kie-server.war//org.hibernate.internal.SessionImpl.fireMerge(SessionImpl.java:917)
    at deployment.kie-server.war//org.hibernate.internal.SessionImpl.merge(SessionImpl.java:891)
    at net.app.CustomJPAPlaceholderResolverStrategy.marshallObject(CustomJPAPlaceholderResolverStrategy.java:185)
    at net.app.CustomJPAPlaceholderResolverStrategy.marshal(CustomJPAPlaceholderResolverStrategy.java:272)
    at deployment.kie-server.war//org.jbpm.marshalling.impl.ProtobufProcessMarshaller.marshallVariable(ProtobufProcessMarshaller.java:269)
    at deployment.kie-server.war//org.jbpm.marshalling.impl.AbstractProtobufProcessInstanceMarshaller.writeProcessInstance(AbstractProtobufProcessInstanceMarshaller.java:164)
    at deployment.kie-server.war//org.jbpm.marshalling.impl.AbstractProtobufProcessInstanceMarshaller.writeProcessInstance(AbstractProtobufProcessInstanceMarshaller.java:75)
    at deployment.kie-server.war//org.jbpm.persistence.processinstance.ProcessInstanceInfo.transform(ProcessInstanceInfo.java:244)
    at deployment.kie-server.war//org.drools.persistence.TriggerUpdateTransactionSynchronization.beforeCompletion(TriggerUpdateTransactionSynchronization.java:61)
    at deployment.kie-server.war//org.drools.persistence.jta.JtaTransactionSynchronizationAdapter.beforeCompletion(JtaTransactionSynchronizationAdapter.java:54)
    at org.jboss.as...@19.1.0.Final//org.jboss.as.txn.service.internal.tsr.JCAOrderedLastSynchronizationList.beforeCompletion(JCAOrderedLastSynchronizationList.java:113)
...
Reply all
Reply to author
Forward
0 new messages