0 Replies Latest reply on Jun 22, 2015 1:46 PM by Tajiri Ujasiri

    AsyncWorkItemHandler Failing

    Tajiri Ujasiri Newbie

      I'm using an AsynchWorkItemHandler to invoke a JBPM process.

       

      In executeWorkItem I encounter:

       

      15:45:37,111 ERROR [stderr] (Thread-120) Exception in thread "Thread-120" java.lang.IllegalStateException: Unable to find or open a transaction: No local transaction to join

       

      I was fortunate enough to not explicitly encounter JTA exceptions until now.  If I use a synchronous workItemhandler, I don't encounter any JTA crap.  The process executes just fine.

       

      I've not been successful at executing my process synchronously and resuming from a failed node.  As I understand it has to be an async workitem execution to make this happen.


      Any advice in navigating?


      -TU

      swiderski.maciej Full Stack Trace(UPDATED):


      
      
      


       

      11:55:10,811 INFO  [stdout] (default task-3) User Transaction started==>

      11:55:10,816 INFO  [stdout] (default task-3) Configuring ExecutorService...

      11:55:10,835 INFO  [stdout] (default task-3) JNDI User Transaction Name==>java:comp/UserTransaction

      11:55:10,835 INFO  [stdout] (default task-3)

      11:55:10,836 INFO  [stdout] (default task-3) Resource Config File==>null

      11:55:10,837 INFO  [stdout] (default task-3) UT Status==>  0

      11:55:10,837 INFO  [stdout] (default task-3)

      11:55:11,250 WARN  [org.kie.scanner.embedder.MavenSettings] (default task-3) Environment variable M2_HOME is not set

      11:55:13,431 ERROR [stderr] (default task-3) ScriptEngineManager providers.next(): javax.script.ScriptEngineFactory: Provider apple.applescript.AppleScriptEngineFactory not found

      11:55:13,433 ERROR [stderr] (default task-3) ScriptEngineManager providers.next(): javax.script.ScriptEngineFactory: Provider jdk.nashorn.api.scripting.NashornScriptEngineFactory not found

      11:55:14,197 INFO  [org.drools.compiler.kie.builder.impl.KieRepositoryImpl] (default task-3) KieModule was added:MemoryKieModule[ ReleaseId=org.default:artifact:1.0.0-SNAPSHOT]

      11:55:17,076 INFO  [stdout] (pool-15-thread-2)  wagon http use multi threaded http connection manager maxPerRoute 20, max total 40

      11:55:20,118 WARN  [org.kie.scanner.MavenRepository] (default task-3) Unable to resolve artifact: org.default:artifact:1.0.0-SNAPSHOT: org.sonatype.aether.resolution.ArtifactResolutionException: Could not find artifact org.default:artifact:jar:1.0.0-SNAPSHOT in local (file:/var/root/.m2/repository/)

        at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:538) [aether-impl-1.13.1.jar:]

        at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:216) [aether-impl-1.13.1.jar:]

        at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:193) [aether-impl-1.13.1.jar:]

        at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:286) [aether-impl-1.13.1.jar:]

        at org.kie.scanner.MavenRepository.resolveArtifact(MavenRepository.java:205) [kie-ci-6.1.0.Final.jar:6.1.0.Final]

        at org.kie.scanner.MavenRepository.resolveArtifact(MavenRepository.java:194) [kie-ci-6.1.0.Final.jar:6.1.0.Final]

        at org.kie.scanner.ArtifactResolver.resolveArtifact(ArtifactResolver.java:51) [kie-ci-6.1.0.Final.jar:6.1.0.Final]

        at org.kie.scanner.KieRepositoryScannerImpl.getArtifactVersion(KieRepositoryScannerImpl.java:108) [kie-ci-6.1.0.Final.jar:6.1.0.Final]

        at org.drools.compiler.kie.builder.impl.KieRepositoryImpl$KieModuleRepo.load(KieRepositoryImpl.java:281) [drools-compiler-6.1.0.Final.jar:6.1.0.Final]

        at org.drools.compiler.kie.builder.impl.KieRepositoryImpl$KieModuleRepo.load(KieRepositoryImpl.java:267) [drools-compiler-6.1.0.Final.jar:6.1.0.Final]

        at org.drools.compiler.kie.builder.impl.KieRepositoryImpl.getKieModule(KieRepositoryImpl.java:90) [drools-compiler-6.1.0.Final.jar:6.1.0.Final]

        at org.drools.compiler.kie.builder.impl.KieRepositoryImpl.getKieModule(KieRepositoryImpl.java:77) [drools-compiler-6.1.0.Final.jar:6.1.0.Final]

        at org.drools.compiler.kie.builder.impl.KieServicesImpl.newKieContainer(KieServicesImpl.java:97) [drools-compiler-6.1.0.Final.jar:6.1.0.Final]

        at org.kie.internal.utils.KieHelper.build(KieHelper.java:49) [kie-internal-6.1.0.Final.jar:6.1.0.Final]

        at com.sample.ProcessTestSpring.testProcess(ProcessTestSpring.java:317) [classes:]

        at org.apache.jsp.runProcess_jsp._jspService(runProcess_jsp.java:86)

        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:69) [jastow-1.0.0.Final.jar:1.0.0.Final]

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]

        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:366) [jastow-1.0.0.Final.jar:1.0.0.Final]

        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:326) [jastow-1.0.0.Final.jar:1.0.0.Final]

        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259) [jastow-1.0.0.Final.jar:1.0.0.Final]

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

        at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.security.handlers.AuthenticationCallHandler.handleRequest(AuthenticationCallHandler.java:52) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

        at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:240) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:73) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:146) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.server.Connectors.executeRootHandler(Connectors.java:168) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:687) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_60]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_60]

        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_60]

      Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Could not find artifact org.default:artifact:jar:1.0.0-SNAPSHOT in local (file:/var/root/.m2/repository/)

        at org.sonatype.aether.connector.file.FileRepositoryWorker.run(FileRepositoryWorker.java:257) [aether-connector-file-1.13.1.jar:]

        at org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:60) [aether-util-1.13.1.jar:]

        ... 3 more

       

      11:55:27,172 INFO  [stdout] (default task-3) UT Status b4 kession==>  0

      11:55:27,174 INFO  [stdout] (default task-3)

      11:55:27,940 INFO  [stdout] (default task-3) Hibernate: insert into SessionInfo (lastModificationDate, rulesByteArray, startDate, OPTLOCK) values (?, ?, ?, ?)

      11:55:28,502 INFO  [stdout] (default task-3) HERE@@@@!@@

      11:55:28,507 WARN  [org.jbpm.shared.services.impl.TransactionalCommandService] (default task-3) Could not commit session: javax.persistence.TransactionRequiredException: No local transaction to join

        at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.doJoinTransaction(ExtendedEntityManagerCreator.java:407) [spring-orm-3.0.7.RELEASE.jar:3.0.7.RELEASE]

        at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:350) [spring-orm-3.0.7.RELEASE.jar:3.0.7.RELEASE]

        at com.sun.proxy.$Proxy91.joinTransaction(Unknown Source)

        at org.jbpm.shared.services.impl.JpaPersistenceContext.joinTransaction(JpaPersistenceContext.java:169) [jbpm-shared-services-6.1.0.Final.jar:6.1.0.Final]

        at org.jbpm.shared.services.impl.TransactionalCommandService.execute(TransactionalCommandService.java:37) [jbpm-shared-services-6.1.0.Final.jar:6.1.0.Final]

        at org.jbpm.executor.impl.jpa.ExecutorRequestAdminServiceImpl.requeue(ExecutorRequestAdminServiceImpl.java:77) [jbpm-executor-6.2.0.Final.jar:6.2.0.Final]

        at org.jbpm.executor.impl.ExecutorServiceImpl.requeue(ExecutorServiceImpl.java:218) [jbpm-executor-6.2.0.Final.jar:6.2.0.Final]

        at org.jbpm.executor.impl.ExecutorServiceImpl.init(ExecutorServiceImpl.java:131) [jbpm-executor-6.2.0.Final.jar:6.2.0.Final]

        at com.sample.ProcessTestSpring.testProcess(ProcessTestSpring.java:359) [classes:]

        at org.apache.jsp.runProcess_jsp._jspService(runProcess_jsp.java:86)

        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:69) [jastow-1.0.0.Final.jar:1.0.0.Final]

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]

        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:366) [jastow-1.0.0.Final.jar:1.0.0.Final]

        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:326) [jastow-1.0.0.Final.jar:1.0.0.Final]

        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259) [jastow-1.0.0.Final.jar:1.0.0.Final]

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

        at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.security.handlers.AuthenticationCallHandler.handleRequest(AuthenticationCallHandler.java:52) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

        at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:240) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:73) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:146) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.server.Connectors.executeRootHandler(Connectors.java:168) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:687) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_60]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_60]

        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_60]

       

      11:55:28,515 ERROR [stderr] (default task-3) WorkitemHandler==>javax.persistence.TransactionRequiredException: No local transaction to join

      11:55:28,515 INFO  [stdout] (default task-3) before process instance start

      11:55:28,526 INFO  [stdout] (default task-3) Session ID ==>197

      11:55:28,573 INFO  [stdout] (default task-3) Hibernate: insert into ProcessInstanceInfo (lastModificationDate, lastReadDate, processId, processInstanceByteArray, startDate, state, OPTLOCK) values (?, ?, ?, ?, ?, ?, ?)

      11:55:28,619 INFO  [stdout] (default task-3) Hibernate: insert into ProcessInstanceLog (duration, end_date, externalId, user_identity, outcome, parentProcessInstanceId, processId, processInstanceId, processName, processVersion, start_date, status) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

      11:55:28,623 INFO  [stdout] (default task-3) Hibernate: insert into ProcessInstanceLog (duration, end_date, externalId, user_identity, outcome, parentProcessInstanceId, processId, processInstanceId, processName, processVersion, start_date, status) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

      11:55:28,653 INFO  [stdout] (default task-3) Hibernate: insert into NodeInstanceLog (connection, log_date, externalId, nodeId, nodeInstanceId, nodeName, nodeType, processId, processInstanceId, type, workItemId) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

      11:55:28,660 INFO  [stdout] (default task-3) Hibernate: insert into NodeInstanceLog (connection, log_date, externalId, nodeId, nodeInstanceId, nodeName, nodeType, processId, processInstanceId, type, workItemId) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

      11:55:28,668 INFO  [stdout] (default task-3) Hibernate: insert into NodeInstanceLog (connection, log_date, externalId, nodeId, nodeInstanceId, nodeName, nodeType, processId, processInstanceId, type, workItemId) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

      11:55:28,671 INFO  [stdout] (default task-3) Hibernate: insert into NodeInstanceLog (connection, log_date, externalId, nodeId, nodeInstanceId, nodeName, nodeType, processId, processInstanceId, type, workItemId) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

      11:55:28,679 INFO  [stdout] (default task-3) Hibernate: insert into WorkItemInfo (creationDate, name, processInstanceId, state, OPTLOCK, workItemByteArray) values (?, ?, ?, ?, ?, ?)

      11:55:28,720 INFO  [stdout] (default task-3) Hibernate: select workitemin0_.workItemId as workItem1_31_0_, workitemin0_.creationDate as creation2_31_0_, workitemin0_.name as name3_31_0_, workitemin0_.processInstanceId as processI4_31_0_, workitemin0_.state as state5_31_0_, workitemin0_.OPTLOCK as OPTLOCK6_31_0_, workitemin0_.workItemByteArray as workItem7_31_0_ from WorkItemInfo workitemin0_ where workitemin0_.workItemId=?

      11:55:28,758 INFO  [stdout] (default task-3) Hibernate: select correlatio0_.keyId as keyId1_5_, correlatio0_.name as name2_5_, correlatio0_.processInstanceId as processI3_5_, correlatio0_.OPTLOCK as OPTLOCK4_5_ from CorrelationKeyInfo correlatio0_ where correlatio0_.processInstanceId=?

      11:55:28,775 INFO  [stdout] (default task-3) Hibernate: select processins0_.InstanceId as col_0_0_ from ProcessInstanceInfo processins0_ inner join EventTypes eventtypes1_ on processins0_.InstanceId=eventtypes1_.InstanceId where eventtypes1_.element=?

      11:55:28,784 WARN  [org.drools.persistence.SingleSessionCommandService] (default task-3) Could not commit session: org.jbpm.workflow.instance.WorkflowRuntimeException: [ServiceProcess:191 - Say Hello:2] -- Could not find work item handler for Service Task

        at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:168) [jbpm-flow-6.1.0.Final.jar:6.1.0.Final]

        at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:354) [jbpm-flow-6.1.0.Final.jar:6.1.0.Final]

        at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:313) [jbpm-flow-6.1.0.Final.jar:6.1.0.Final]

        at org.jbpm.workflow.instance.node.StartNodeInstance.triggerCompleted(StartNodeInstance.java:66) [jbpm-flow-6.1.0.Final.jar:6.1.0.Final]

        at org.jbpm.workflow.instance.node.StartNodeInstance.internalTrigger(StartNodeInstance.java:43) [jbpm-flow-6.1.0.Final.jar:6.1.0.Final]

        at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:162) [jbpm-flow-6.1.0.Final.jar:6.1.0.Final]

        at org.jbpm.ruleflow.instance.RuleFlowProcessInstance.internalStart(RuleFlowProcessInstance.java:35) [jbpm-flow-6.1.0.Final.jar:6.1.0.Final]

        at org.jbpm.process.instance.impl.ProcessInstanceImpl.start(ProcessInstanceImpl.java:226) [jbpm-flow-6.1.0.Final.jar:6.1.0.Final]

        at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.start(WorkflowProcessInstanceImpl.java:363) [jbpm-flow-6.1.0.Final.jar:6.1.0.Final]

        at org.jbpm.process.instance.ProcessRuntimeImpl.startProcessInstance(ProcessRuntimeImpl.java:187) [jbpm-flow-6.1.0.Final.jar:6.1.0.Final]

        at org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:169) [jbpm-flow-6.1.0.Final.jar:6.1.0.Final]

        at org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:161) [jbpm-flow-6.1.0.Final.jar:6.1.0.Final]

        at org.drools.core.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:1850) [drools-core-6.1.0.Final.jar:6.1.0.Final]

        at org.drools.core.command.runtime.process.StartProcessCommand.execute(StartProcessCommand.java:121) [drools-core-6.1.0.Final.jar:6.1.0.Final]

        at org.drools.core.command.runtime.process.StartProcessCommand.execute(StartProcessCommand.java:40) [drools-core-6.1.0.Final.jar:6.1.0.Final]

        at org.drools.core.command.impl.DefaultCommandService.execute(DefaultCommandService.java:36) [drools-core-6.1.0.Final.jar:6.1.0.Final]

        at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41) [drools-core-6.1.0.Final.jar:6.1.0.Final]

        at org.drools.persistence.SingleSessionCommandService$TransactionInterceptor.execute(SingleSessionCommandService.java:509) [drools-persistence-jpa-6.1.0.Final.jar:6.1.0.Final]

        at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:353) [drools-persistence-jpa-6.1.0.Final.jar:6.1.0.Final]

        at org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:230) [drools-core-6.1.0.Final.jar:6.1.0.Final]

        at org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:221) [drools-core-6.1.0.Final.jar:6.1.0.Final]

        at com.sample.ProcessTestSpring.testProcess(ProcessTestSpring.java:386) [classes:]

        at org.apache.jsp.runProcess_jsp._jspService(runProcess_jsp.java:86)

        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:69) [jastow-1.0.0.Final.jar:1.0.0.Final]

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]

        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:366) [jastow-1.0.0.Final.jar:1.0.0.Final]

        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:326) [jastow-1.0.0.Final.jar:1.0.0.Final]

        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259) [jastow-1.0.0.Final.jar:1.0.0.Final]

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

        at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.security.handlers.AuthenticationCallHandler.handleRequest(AuthenticationCallHandler.java:52) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

        at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:240) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:73) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:146) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.server.Connectors.executeRootHandler(Connectors.java:168) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:687) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_60]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_60]

        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_60]

      Caused by: org.drools.core.WorkItemHandlerNotFoundException: Could not find work item handler for Service Task

        at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.throwWorkItemNotFoundException(JPAWorkItemManager.java:61) [drools-persistence-jpa-6.1.0.Final.jar:6.1.0.Final]

        at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.internalExecuteWorkItem(JPAWorkItemManager.java:56) [drools-persistence-jpa-6.1.0.Final.jar:6.1.0.Final]

        at org.jbpm.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:133) [jbpm-flow-6.1.0.Final.jar:6.1.0.Final]

        at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:162) [jbpm-flow-6.1.0.Final.jar:6.1.0.Final]

        ... 52 more

       

      11:55:28,801 ERROR [stderr] (default task-3) org.jbpm.workflow.instance.WorkflowRuntimeException: [ServiceProcess:191 - Say Hello:2] -- Could not find work item handler for Service Task

      11:55:28,801 ERROR [stderr] (default task-3) at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:168)

      11:55:28,801 ERROR [stderr] (default task-3) at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:354)

      11:55:28,801 ERROR [stderr] (default task-3) at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:313)

      11:55:28,801 ERROR [stderr] (default task-3) at org.jbpm.workflow.instance.node.StartNodeInstance.triggerCompleted(StartNodeInstance.java:66)

      11:55:28,801 ERROR [stderr] (default task-3) at org.jbpm.workflow.instance.node.StartNodeInstance.internalTrigger(StartNodeInstance.java:43)

      11:55:28,802 ERROR [stderr] (default task-3) at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:162)

      11:55:28,802 ERROR [stderr] (default task-3) at org.jbpm.ruleflow.instance.RuleFlowProcessInstance.internalStart(RuleFlowProcessInstance.java:35)

      11:55:28,802 ERROR [stderr] (default task-3) at org.jbpm.process.instance.impl.ProcessInstanceImpl.start(ProcessInstanceImpl.java:226)

      11:55:28,803 ERROR [stderr] (default task-3) at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.start(WorkflowProcessInstanceImpl.java:363)

      11:55:28,803 ERROR [stderr] (default task-3) at org.jbpm.process.instance.ProcessRuntimeImpl.startProcessInstance(ProcessRuntimeImpl.java:187)

      11:55:28,803 ERROR [stderr] (default task-3) at org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:169)

      11:55:28,803 ERROR [stderr] (default task-3) at org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:161)

      11:55:28,804 ERROR [stderr] (default task-3) at org.drools.core.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:1850)

      11:55:28,805 ERROR [stderr] (default task-3) at org.drools.core.command.runtime.process.StartProcessCommand.execute(StartProcessCommand.java:121)

      11:55:28,806 ERROR [stderr] (default task-3) at org.drools.core.command.runtime.process.StartProcessCommand.execute(StartProcessCommand.java:40)

      11:55:28,806 ERROR [stderr] (default task-3) at org.drools.core.command.impl.DefaultCommandService.execute(DefaultCommandService.java:36)

      11:55:28,806 ERROR [stderr] (default task-3) at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)

      11:55:28,807 ERROR [stderr] (default task-3) at org.drools.persistence.SingleSessionCommandService$TransactionInterceptor.execute(SingleSessionCommandService.java:509)

      11:55:28,807 ERROR [stderr] (default task-3) at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:353)

      11:55:28,807 ERROR [stderr] (default task-3) at org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:230)

      11:55:28,807 ERROR [stderr] (default task-3) at org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:221)

      11:55:28,808 ERROR [stderr] (default task-3) at com.sample.ProcessTestSpring.testProcess(ProcessTestSpring.java:386)

      11:55:28,808 ERROR [stderr] (default task-3) at org.apache.jsp.runProcess_jsp._jspService(runProcess_jsp.java:86)

      11:55:28,808 ERROR [stderr] (default task-3) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:69)

      11:55:28,809 ERROR [stderr] (default task-3) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

      11:55:28,809 ERROR [stderr] (default task-3) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:366)

      11:55:28,809 ERROR [stderr] (default task-3) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:326)

      11:55:28,810 ERROR [stderr] (default task-3) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259)

      11:55:28,810 ERROR [stderr] (default task-3) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

      11:55:28,810 ERROR [stderr] (default task-3) at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)

      11:55:28,810 ERROR [stderr] (default task-3) at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61)

      11:55:28,811 ERROR [stderr] (default task-3) at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)

      11:55:28,811 ERROR [stderr] (default task-3) at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)

      11:55:28,812 ERROR [stderr] (default task-3) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)

      11:55:28,812 ERROR [stderr] (default task-3) at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113)

      11:55:28,812 ERROR [stderr] (default task-3) at io.undertow.security.handlers.AuthenticationCallHandler.handleRequest(AuthenticationCallHandler.java:52)

      11:55:28,813 ERROR [stderr] (default task-3) at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45)

      11:55:28,813 ERROR [stderr] (default task-3) at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61)

      11:55:28,813 ERROR [stderr] (default task-3) at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70)

      11:55:28,814 ERROR [stderr] (default task-3) at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)

      11:55:28,814 ERROR [stderr] (default task-3) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)

      11:55:28,814 ERROR [stderr] (default task-3) at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

      11:55:28,814 ERROR [stderr] (default task-3) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)

      11:55:28,814 ERROR [stderr] (default task-3) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)

      11:55:28,815 ERROR [stderr] (default task-3) at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:240)

      11:55:28,817 ERROR [stderr] (default task-3) at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227)

      11:55:28,817 ERROR [stderr] (default task-3) at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:73)

      11:55:28,817 ERROR [stderr] (default task-3) at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:146)

      11:55:28,818 ERROR [stderr] (default task-3) at io.undertow.server.Connectors.executeRootHandler(Connectors.java:168)

      11:55:28,818 ERROR [stderr] (default task-3) at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:687)

      11:55:28,818 ERROR [stderr] (default task-3) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

      11:55:28,818 ERROR [stderr] (default task-3) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

      11:55:28,819 ERROR [stderr] (default task-3) at java.lang.Thread.run(Thread.java:745)

      11:55:28,819 ERROR [stderr] (default task-3) Caused by: org.drools.core.WorkItemHandlerNotFoundException: Could not find work item handler for Service Task

      11:55:28,819 ERROR [stderr] (default task-3) at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.throwWorkItemNotFoundException(JPAWorkItemManager.java:61)

      11:55:28,819 ERROR [stderr] (default task-3) at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.internalExecuteWorkItem(JPAWorkItemManager.java:56)

      11:55:28,820 ERROR [stderr] (default task-3) at org.jbpm.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:133)

      11:55:28,820 ERROR [stderr] (default task-3) at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:162)

      11:55:28,820 ERROR [stderr] (default task-3) ... 52 more

      11:55:28,821 INFO  [stdout] (default task-3) Cause==>org.drools.core.WorkItemHandlerNotFoundException: Could not find work item handler for Service Task

      11:55:28,821 INFO  [stdout] (default task-3)

      11:55:28,825 ERROR [org.jboss.as.txn] (default task-3) JBAS010152: APPLICATION ERROR: transaction still active in request with status 1

      11:55:29,507 ERROR [stderr] (Thread-256) Exception in thread "Thread-256" java.lang.RuntimeException: Could not create the log file.  Please make sure that directory that the log file should be placed in does exist.

      11:55:29,509 ERROR [stderr] (Thread-256) at org.drools.core.audit.WorkingMemoryFileLogger.initializeLog(WorkingMemoryFileLogger.java:164)

      11:55:29,509 ERROR [stderr] (Thread-256) at org.drools.core.audit.WorkingMemoryFileLogger.writeToDisk(WorkingMemoryFileLogger.java:120)

      11:55:29,509 ERROR [stderr] (Thread-256) at org.drools.core.audit.ThreadedWorkingMemoryFileLogger.writeToDisk(ThreadedWorkingMemoryFileLogger.java:54)

      11:55:29,509 ERROR [stderr] (Thread-256) at org.drools.core.audit.ThreadedWorkingMemoryFileLogger$Writer.run(ThreadedWorkingMemoryFileLogger.java:69)

      11:55:29,510 ERROR [stderr] (Thread-256) at java.lang.Thread.run(Thread.java:745)

       

      
      

       

      public class ProcessTestSpring   {

       

      private int processInstanceId=0;

      static EntityManagerFactory emf = null;

       

      public ProcessTestSpring(int processInstanceId ) {

        this.processInstanceId = processInstanceId ;

       

      }

       

        public void testProcess() throws Exception  {

        Map transMap = null;

        Iterator it;

       

        UserTransaction ut = null;

       

        if(TransactionManagerServices.isTransactionManagerRunning())

        System.out.println("Transaction Manager is running!");

        else

        System.out.println("Transaction Manager is NOT running!");

       

       

        InitialContext initialContext = new InitialContext();

       

       

       

        Environment env = KnowledgeBaseFactory.newEnvironment();

       

        ut = (UserTransaction) new InitialContext().lookup( "java:comp/UserTransaction" );

       

        ApplicationContext context = new ClassPathXmlApplicationContext("/WEB-INF/config/applicationContextBPMN.xml");

       

        emf = (EntityManagerFactory)context.getBean("jbpmEMF");

       

       

        org.springframework.orm.jpa.JpaTransactionManager  jtm = (org.springframework.orm.jpa.JpaTransactionManager)context.getBean("jbpmTxManager");

       

       

        try {

        ut.begin();

        System.out.println(String.format("User Transaction started==>"));

       

        } catch (Exception e) {

        // TODO Auto-generated catch block

        e.printStackTrace();

        System.out.println(String.format("start transaction failed ==>%s",e.getMessage().toString()));

        }

       

        ExecutorService executorService = ExecutorServiceFactory_SPRING.newExecutorService(emf);

        executorService.setThreadPoolSize(5);

       

            System.out.println(String.format("JNDI User Transaction Name==>%s\n", TransactionManagerServices.getConfiguration().getJndiUserTransactionName()));

            System.out.println(String.format("Resource Config File==>%s",TransactionManagerServices.getConfiguration().getResourceConfigurationFilename()));

            //System.out.println(String.format("EM ==> %s\n\nEMF Config ==>  %s\n",em.toString(), emf.getProperties().toString()));

            System.out.println(String.format("UT Status==>  %s\n",ut.getStatus()));

          

            //System.out.println(String.format("jtm info ==> %s\n", jtm.toString(),jtm.getJndiEnvironment().toString()));

       

        env.set( EnvironmentName.ENTITY_MANAGER_FACTORY, emf );

        env.set( EnvironmentName.TRANSACTION_MANAGER, jtm);

       

       

        KieHelper kieHelper = new KieHelper();

       

          KieBase kbase = kieHelper.addResource(ResourceFactory

        .newClassPathResource("briefverify_3nodes.bpmn2"))

        .build();

       

       

        

        // create a new knowledge session that uses JPA to store the runtime state

            System.out.println(String.format("UT Status b4 kession==>  %s\n",ut.getStatus()));

          

          StatefulKnowledgeSession ksession = null;

        

          if (this.processInstanceId == 0){

          //StatefulKnowledgeSession ksession = JPAKnowledgeService.newStatefulKnowledgeSession( kbase, null, env );

          ksession = JPAKnowledgeService.newStatefulKnowledgeSession( kbase, null, env );

          }

          else{

          //StatefulKnowledgeSession ksession = JPAKnowledgeService.loadStatefulKnowledgeSession(this.processInstanceId, kbase, null, env);

          ksession = JPAKnowledgeService.loadStatefulKnowledgeSession(this.processInstanceId, kbase, null, env);

          }

       

        AbstractAuditLogger auditLogger = AuditLoggerFactory.newJPAInstance();

       

        JPAWorkingMemoryDbLogger JPADbLogger = new JPAWorkingMemoryDbLogger(ksession);

       

       

        //AbstractAuditLogger auditLogger = AuditLoggerFactory.newJPAInstance(emf);

       

       

        ksession.addEventListener(auditLogger);

       

       

        KieRuntimeLogger logger = KieServices.Factory.get().getLoggers()

        .newThreadedFileLogger(ksession, "src/main/resources/mylogfile", 1000);

       

       

        try{

       

       

        executorService.init();

       

       

        ksession.getWorkItemManager().registerWorkItemHandler("Service Task"new AsyncWorkItemHandler(executorService));

       

       

       

       

       

       

        }

        catch (Exception ex){

        System.err.println("WorkitemHandler==>"+ex.toString());

        }

        System.out.println("before process instance start");

       

       

        System.out.println("Session ID ==>"+ksession.getId());

       

       

        //ut.begin();

       

       

       

        ProcessInstance processInstance = ksession.startProcess("ServiceProcess");

       

       

       

       

        System.out.println("process instance started");

       

        ksession.dispose();

        //logger.close();

        //ut.commit();

       

       

       

       

        System.out.println("reached the end...");

        }

       

       

       

      }