我试图从JBPM AuditLog中提取记录但是我正在
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)
查看跟踪它仍然使用JTA策略而不是本地事务策略
我正在使用 jbpm v6.2.0.CR2 ,我的persistence.xml如下
<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>
答案 0 :(得分:2)
jBPM持久性正在使用JTA来管理事务。因此,您应该在persistence.xml中使用JTA作为事务类型并使用JTA数据源。唯一的例外是Spring,我们还与Spring事务管理器集成以支持本地事务。