Red Hat Bugzilla – Bug 1316966
OSGi: drools-persistence-jpa throws NPE when starting a process via RuntimeManager
Last modified: 2016-04-18 10:16:10 EDT
Created attachment 1135261 [details]
Description of problem:
When starting a jBPM process using RuntimeManager in OSGi environment, I have to specify in the environment the references to all of the following:
If only TransactionManager and EntityManagerFactory are specified, Drools JtaTransactionManager throws the following NPE (see attachment for the full stacktrace):
Caused by: java.lang.NullPointerException
The root cause might be that it tries to retrieve UserTransaction or TSR from JNDI which fails in OSGi environment (probably different lookup method is needed).
The problem for users is that when using blueprint XML for <kie:environment> definition, the user is not allowed to specify the latter two references (UserTransaction and TSR).
I would probably suggest that:
1) JtaTransactionManager is able to work even when not all 4 references are set in the Environment,
2) kie-aries-blueprint allows for specifying UserTransaction and TSR in <kie:environment> in blueprint xml.
If 1) is not possible to achieve, we should at least fix 2).
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. run 'mvn clean test -Dtest=KieBlueprintjBPMPersistenceKarafIntegrationTest' from PR https://github.com/droolsjbpm/droolsjbpm-integration/pull/315
The NPE is thrown.
You can uncomment setting of UserTransaction and TSR at org.drools.karaf.itest.beans.ProcessWithPersistenceBean, line 79, and see that the test passes.
fixed with excellent collaboration with Marek (so big thanks!)
Verified in BRMS 6.3.0 ER3.
It is now possible to declare <kie:environment> element in KIE-Aries-Blueprint XML with the following child elements:
jBPM persistence using environment with all the above properties works in Fuse 6.2.1.