我已按照此链接https://apurvasingh67.wordpress.com/2014/03/03/how-to-install-jbpm6-on-tomcat7-x/
中提供的步骤在tomcat 8 + Bitronix事务管理器+ Oracle 11G上成功配置了jBPM 6.5此外,我设法使用脚本和用户任务创建示例业务流程。
现在,当我尝试声明并完成用户任务时,我得到空指针异常。
任何人都可以对此有所了解。
2017-03-17 16:22:25 WARN http-apr-9012-exec-10 bitronix.tm.twopc.Preparer - executing transaction with 0 enlisted resource
2017-03-17 11:01:47 WARN http-apr-9012-exec-4 org.drools.persistence.SingleSessionCommandService - Could not commit session
java.lang.NullPointerException
at java.io.ByteArrayInputStream.<init>(ByteArrayInputStream.java:106)
at org.drools.persistence.info.WorkItemInfo.getWorkItem(WorkItemInfo.java:116)
at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.internalGetWorkItem(JPAWorkItemManager.java:213)
at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.completeWorkItem(JPAWorkItemManager.java:141)
at org.drools.core.command.runtime.process.CompleteWorkItemCommand.execute(CompleteWorkItemCommand.java:75)
at org.drools.core.command.runtime.process.CompleteWorkItemCommand.execute(CompleteWorkItemCommand.java:35)
at org.drools.core.command.impl.DefaultCommandService.execute(DefaultCommandService.java:36)
at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)
at org.drools.persistence.SingleSessionCommandService$TransactionInterceptor.execute(SingleSessionCommandService.java:604)
at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)
at org.drools.persistence.jpa.OptimisticLockRetryInterceptor.execute(OptimisticLockRetryInterceptor.java:82)
at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)
at org.drools.persistence.jta.TransactionLockInterceptor.execute(TransactionLockInterceptor.java:73)
at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:397)
at org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession$1.completeWorkItem(CommandBasedStatefulKnowledgeSession.java:166)
at org.jbpm.services.task.wih.ExternalTaskEventListener.processTaskState(ExternalTaskEventListener.java:61)
at org.jbpm.services.task.wih.ExternalTaskEventListener.afterTaskCompletedEvent(ExternalTaskEventListener.java:107)
at org.jbpm.services.task.events.TaskEventSupport.fireAfterTaskCompleted(TaskEventSupport.java:251)
at org.jbpm.services.task.internals.lifecycle.MVELLifeCycleManager.taskOperation(MVELLifeCycleManager.java:386)
at org.jbpm.services.task.impl.TaskInstanceServiceImpl.complete(TaskInstanceServiceImpl.java:188)
at org.jbpm.services.task.commands.CompleteTaskCommand.execute(CompleteTaskCommand.java:79)
at org.jbpm.services.task.commands.CompleteTaskCommand.execute(CompleteTaskCommand.java:40)
at org.jbpm.services.task.commands.CompositeCommand.execute(CompositeCommand.java:147)
at org.jbpm.services.task.commands.TaskCommandExecutorImpl$SelfExecutionCommandService.execute(TaskCommandExecutorImpl.java:65)
at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)
at org.jbpm.services.task.persistence.TaskTransactionInterceptor.execute(TaskTransactionInterceptor.java:69)
at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)
at org.drools.persistence.jta.TransactionLockInterceptor.execute(TransactionLockInterceptor.java:73)
at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)
at org.drools.persistence.jpa.OptimisticLockRetryInterceptor.execute(OptimisticLockRetryInterceptor.java:82)
at org.jbpm.services.task.commands.TaskCommandExecutorImpl.execute(TaskCommandExecutorImpl.java:40)
at org.jbpm.services.task.impl.command.CommandBasedTaskService.complete(CommandBasedTaskService.java:174)
at org.jbpm.runtime.manager.impl.task.SynchronizedTaskService.complete(SynchronizedTaskService.java:119)
at org.jbpm.kie.services.impl.UserTaskServiceImpl.complete(UserTaskServiceImpl.java:189)
at org.jbpm.services.cdi.impl.UserTaskServiceCDIImpl$Proxy$_$$_WeldClientProxy.complete(UserTaskServiceCDIImpl$Proxy$_$$_WeldClientProxy.java)
at org.jbpm.console.ng.ht.backend.server.TaskLifeCycleServiceImpl.complete(TaskLifeCycleServiceImpl.java:52)
at org.jbpm.console.ng.ht.backend.server.TaskLifeCycleServiceImpl$Proxy$_$$_WeldClientProxy.complete(TaskLifeCycleServiceImpl$Proxy$_$$_WeldClientProxy.java)
答案 0 :(得分:0)
最后,经过长时间的努力,我的老板(你知道老板总是对的:D)给了我一个提示,尝试将事务同步注册表添加到CATALINA_OPTS
-Djbpm.tsr.jndi.lookup =的java:comp / env的/ TransactionSynchronizationRegistry
更改后,您的tomcat setenv.sh或setenv.bat应如下所示。
设置CATALINA_OPTS = -Xmx512M -XX:MaxPermSize = 512m -Dbtm.root =%CATALINA_HOME%-Dbitronix.tm.configuration =%CATALINA_HOME%\ conf \ btm-config.properties -Djbpm.tsr.jndi.lookup = java :comp / env / TransactionSynchronizationRegistry -Djava.security.auth.login.config =%CATALINA_HOME%\ webapps \ jbpm-console \ WEB-INF \ classes \ login.config -Dorg.jboss.logging.provider = jdk -Dorg.kie .task.insecure = true -Dorg.kie.server.persistence.ds = java:comp / env / jdbc / jbpm -Dorg.kie.server.persistence.tm = org.hibernate.service.jta.platform.internal.BitronixJtaPlatform -Dorg.kie.server.id = tomcat-kieserver -Dorg.kie.server.location = http://localhost:8080/kie-server/services/rest/server -Dorg.kie.server.controller = http://localhost:8080/jbpm-console/rest/controller -Dkie.maven.settings.custom = / path / to / your / maven / settings.xml -Dorg.drools.server.filter.classes = true