Search code examples
jtajbpmaudit-logging

jbpm audit log always looking for jta transaction


Am trying to pull records from JBPM AuditLog but am getting

SEVERE: Servlet.service() for servlet [dispatcher] in context with path [/dms] threw exception [Request processing failed; nested exception is java.lang.IllegalStateException: Unable to find JTA transaction.] with root cause
java.lang.IllegalStateException: Unable to find JTA transaction.
    at org.jbpm.process.audit.strategy.StandaloneJtaStrategy.joinTransaction(StandaloneJtaStrategy.java:45)
    at org.jbpm.process.audit.JPAAuditLogService.joinTransaction(JPAAuditLogService.java:319)
    at org.jbpm.process.audit.JPAAuditLogService.executeQuery(JPAAuditLogService.java:327)
    at org.jbpm.process.audit.JPAAuditLogService.findVariableInstancesByNameAndValue(JPAAuditLogService.java:280)
    at com.softech.dms.workflow.WorkflowUtil.getAuditLog(WorkflowUtil.java:237)
    at com.softech.dms.workflow.WorkflowUtil$$FastClassBySpringCGLIB$$73d95f1.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)

looking at trace it is still using the JTA strategy instead of local transaction strategy

am using jbpm v6.2.0.CR2 and my persistence.xml is as follows

<persistence-unit name="dms-jbpm" transaction-type="RESOURCE_LOCAL">
        <provider>org.hibernate.ejb.HibernatePersistence</provider>

        <mapping-file>META-INF/JBPMorm.xml</mapping-file>
        <mapping-file>META-INF/Taskorm.xml</mapping-file>
        <mapping-file>META-INF/TaskAuditorm.xml</mapping-file>

        <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
        <class>org.drools.persistence.info.SessionInfo</class>
        <class>org.drools.persistence.info.WorkItemInfo</class>
        <class>org.jbpm.process.audit.ProcessInstanceLog</class>
        <class>org.jbpm.process.audit.NodeInstanceLog</class>
        <class>org.jbpm.process.audit.VariableInstanceLog</class>
        <class>org.jbpm.persistence.correlation.CorrelationKeyInfo</class>
        <class>org.jbpm.persistence.correlation.CorrelationPropertyInfo</class>
        <class>org.jbpm.runtime.manager.impl.jpa.ContextMappingInfo</class>
        <class>org.jbpm.services.task.impl.model.AttachmentImpl</class>
        <class>org.jbpm.services.task.impl.model.ContentImpl</class>
        <class>org.jbpm.services.task.impl.model.BooleanExpressionImpl</class>
        <class>org.jbpm.services.task.impl.model.CommentImpl</class>
        <class>org.jbpm.services.task.impl.model.DeadlineImpl</class>
        <class>org.jbpm.services.task.impl.model.DelegationImpl</class>
        <class>org.jbpm.services.task.impl.model.EscalationImpl</class>
        <class>org.jbpm.services.task.impl.model.GroupImpl</class>
        <class>org.jbpm.services.task.impl.model.I18NTextImpl</class>
        <class>org.jbpm.services.task.impl.model.NotificationImpl</class>
        <class>org.jbpm.services.task.impl.model.EmailNotificationImpl</class>
        <class>org.jbpm.services.task.impl.model.EmailNotificationHeaderImpl</class>
        <class>org.jbpm.services.task.impl.model.PeopleAssignmentsImpl</class>
        <class>org.jbpm.services.task.impl.model.ReassignmentImpl</class>
        <class>org.jbpm.services.task.impl.model.TaskImpl</class>
        <class>org.jbpm.services.task.impl.model.TaskDataImpl</class>
        <class>org.jbpm.services.task.impl.model.UserImpl</class>
        <class>org.jbpm.services.task.audit.impl.model.BAMTaskSummaryImpl</class>
        <class>org.jbpm.services.task.audit.impl.model.TaskEventImpl</class>
        <class>org.jbpm.services.task.audit.impl.model.AuditTaskImpl</class>
        <properties>
            <property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.BitronixJtaPlatform" />
        </properties>
    </persistence-unit>

Solution

  • jBPM persistence is using JTA to manage the transaction. As a result, you should use JTA as transaction type in your persistence.xml and use a JTA data source. The only exception is Spring, where we also integrate with the Spring transaction manager to support local transactions as well.