NullPointerException at org.drools.core.marshalling.impl.MarshallerWriteContext.<init> in BPMS 6.0

Solution Unverified - Updated -

Issue

  • Users are running into a bug when creating multiple runtime engines in a single transaction. Every time a runtime engine is created in the PerProcessInstanceRuntimeManager, a transaction synchronization DisposeSessionTransactionSynchronization is registered to dispose the runtime engine when the transaction ends. These synchronizations are all added to a drools container for the transaction synchronizations TransactionSynchronizationContainer. This container uses a TreeSet to store the comparable synchronizations. Multiple instances of DisposeSessionTransactionSynchronization cannot exist in the TreeSet because the order of the comparables is fixed (hardcoded to 10).

This means that after the TransactionSynchronizationContainer has a synchronization for the first runtime engine, no other runtime engine in the transaction can add a synchronization for its disposal to the container (because they all have the same order). So the all but the first runtime engine will not be disposed. Reusing the stale runtime engine then fails with an exception as shown below.

  • Users hit NullPointerException while using multiple-instance supprocess in combination with PerProcessInstanceRuntimeManager while spanning a transaction with BPMS 6.0.3. It's not reproducible with BPMS 6.0.2 release though. What could be the root cause of this issue ?
bitronix.tm.internal.BitronixRollbackException: RuntimeException thrown during beforeCompletion cycle caused transaction rollback
    at bitronix.tm.BitronixTransaction.commit(BitronixTransaction.java:241)
    at bitronix.tm.BitronixTransactionManager.commit(BitronixTransactionManager.java:143)
    at com.sample.ProcessJPATest.testProcess(ProcessJPATest.java:115)
...
Caused by: javax.persistence.PersistenceException: error during managed flush
    at org.hibernate.ejb.AbstractEntityManagerImpl$CallbackExceptionMapperImpl.mapManagedFlushFailure(AbstractEntityManagerImpl.java:1515)
    at org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorImpl.beforeCompletion(SynchronizationCallbackCoordinatorImpl.java:117)
    at org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization.beforeCompletion(RegisteredSynchronization.java:53)
    at bitronix.tm.BitronixTransaction.fireBeforeCompletionEvent(BitronixTransaction.java:532)
    at bitronix.tm.BitronixTransaction.commit(BitronixTransaction.java:235)
    ... 27 more
Caused by: java.lang.NullPointerException
    at org.drools.core.marshalling.impl.MarshallerWriteContext.<init>(MarshallerWriteContext.java:109)
    at org.drools.core.marshalling.impl.MarshallerWriteContext.<init>(MarshallerWriteContext.java:75)
    at org.jbpm.persistence.processinstance.ProcessInstanceInfo.update(ProcessInstanceInfo.java:220)

Environment

  • Red Hat JBoss BPM Suite (BPMS)
    • 6.0.2
    • 6.0.3

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.