It's possible to embed jBPM inside an application that executes in Container Managed Transaction (CMT) mode. We use Jboss EAP 6.4 so we adapted our persistence.xml with:
<property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform" /> <property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.CMTTransactionFactory" /> <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />
If the process calls an EJB service and this throws an exception (e.g: technical error), the process and the EJB are correctly roll-backed (the process returns at its starting point and if the service had changed an entity, the change is cancelled). But the exception thrown at the end of the process is not the one expected:
Caused by: java.lang.NullPointerException at org.drools.persistence.jta.JtaTransactionManager.rollback(JtaTransactionManager.java:255) ... 101 more
This EJB service is a dummy service that throws a NoSuchMethodException wrapped in a WorkItemHandlerRuntimeException.
However, in the log there is a a null pointer in the drools persistence. It is expected to see only WorkItemHandlerRuntimeException. Is this a configuration issue? How to fix this?
- Red Hat JBoss BPM Suite
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.