-
Bug
-
Resolution: Done
-
Major
-
None
-
6.0.2
-
None
Description of problem:
Spring integration fails with exception under following circumstances:
- kie-spring
- deployed on tomcat
- no jta is used (transactions are resource_local)
- strategy for runtimeManager is PER_PROCESS_INSTANCE / PER_REQUEST
Version-Release number of selected component (if applicable):
BPM 6.0.3
How reproducible:
always
Steps to Reproduce:
1. Download attached reproducer, and built the parent project
2. deploy kie-spring-webapp onto BPM 603 deployed on Tomcat
3. This app exposes rest endpoint. If you invoke it it will try to run the process.
You can invoke it like this:
curl -X POST -HAccept:application/json -H "Content-Type: application/json" -d "
{\"orderRef\" : \"test\"}" "localhost:8080/kie-spring-webapp-0.0.1-SNAPSHOT/orders/create"
Actual results:
Starting process in the environment described above fails with
java.lang.IllegalStateException: Unable to find transaction: Cannot create resource instance
org.drools.persistence.jta.JtaTransactionManager.findUserTransaction(JtaTransactionManager.java:140)
org.drools.persistence.jta.JtaTransactionManager.<init>(JtaTransactionManager.java:79)
org.jbpm.runtime.manager.impl.AbstractRuntimeManager.registerDisposeCallback(AbstractRuntimeManager.java:113)
org.jbpm.runtime.manager.impl.PerProcessInstanceRuntimeManager.getRuntimeEngine(PerProcessInstanceRuntimeManager.java:112)
Expected results:
Process is started without issuse
Additional info:
Singleton works fine. I believe this is fixed via following JIRA in the upstream
https://issues.jboss.org/browse/JBPM-4338
If I replace line 113 in
org.jbpm.runtime.manager.impl.AbstractRuntimeManager
JtaTransactionManager tm = new JtaTransactionManager(null, null, null);
with
TransactionManager tm = (TransactionManager)
runtime.getKieSession().getEnvironment().get(EnvironmentName.TRANSACTION_MANAGER);
The issue seems to be solved, which seems to be consistent with the fix made in the JIRA mentioned above.
Possibly the fix only needs to be backported to the 6.0.x branch.
Looking at related JIRA
https://issues.jboss.org/browse/JBPM-4369
seems like the fix was made in master (6.2.x) and then backported to 6.1.x