0 Replies Latest reply on Sep 11, 2015 11:18 AM by Tajiri Ujasiri

    Need Help Understanding AsyncWIH Implementation

    Tajiri Ujasiri Newbie

      I'm striving to run a process defined in BPMN2.  I'd like to execute each node of the process and if one fails, I'd like to be able to stop the process, fix the problem that caused the crash and resume the process at the failed node.  I was advised to use the AsyncWIH for this.  I have a Spring configuration, and I'm using Hibernate 4, Spring 3.6, and JBPM 6.1.0, but the executor is from JBPM 6.2.0.

       

      Here's where I create the environment and session:

       

      
      package com.sample;
      
      import java.util.HashMap;
      import java.util.Iterator;
      import java.util.Map;
      
      import javax.annotation.Resource;
      import javax.jms.Queue;
      import javax.naming.InitialContext;
      import javax.naming.NamingException;
      import javax.persistence.EntityManager;
      import javax.persistence.EntityManagerFactory;
      import javax.persistence.Persistence;
      import javax.persistence.PersistenceContext;
      import javax.transaction.HeuristicMixedException;
      import javax.transaction.HeuristicRollbackException;
      import javax.transaction.NotSupportedException;
      import javax.transaction.RollbackException;
      import javax.transaction.SystemException;
      import javax.transaction.TransactionManager;
      import javax.transaction.UserTransaction;
      
      import org.drools.persistence.jta.JtaTransactionManager;
      //import org.jbpm.executor.ExecutorServiceFactory;
      import org.jbpm.persistence.JpaProcessPersistenceContextManager;
      import org.jbpm.persistence.jta.ContainerManagedTransactionManager;
      import org.jbpm.process.audit.AbstractAuditLogger;
      import org.jbpm.process.audit.AuditLoggerFactory;
      import org.jbpm.process.audit.AuditLoggerFactory.Type;
      import org.jbpm.process.audit.JPAWorkingMemoryDbLogger;
      import org.jbpm.process.workitem.bpmn2.ServiceTaskHandler;
      import org.jbpm.services.task.persistence.JPATaskPersistenceContextManager;
      //import org.jbpm.test.JbpmJUnitBaseTestCase;
      //import org.junit.Test;
      import org.kie.api.KieBase;
      import org.kie.api.KieServices;
      import org.kie.api.logger.KieRuntimeLogger;
      import org.kie.api.persistence.jpa.KieStoreServices;
      import org.kie.api.runtime.Environment;
      import org.kie.api.runtime.EnvironmentName;
      import org.kie.api.runtime.KieSession;
      import org.kie.api.runtime.KieSessionConfiguration;
      import org.kie.api.runtime.process.ProcessInstance;
      import org.kie.internal.KnowledgeBaseFactory;
      import org.kie.internal.executor.api.ExecutorService;
      import org.kie.internal.io.ResourceFactory;
      import org.kie.internal.persistence.jpa.JPAKnowledgeService;
      import org.kie.internal.runtime.StatefulKnowledgeSession;
      import org.kie.internal.utils.KieHelper;
      
      import javax.jms.ConnectionFactory;
      
      
      
      
      import bitronix.tm.BitronixTransactionManager;
      import bitronix.tm.TransactionManagerServices;
      import bitronix.tm.internal.XAResourceHolderState;
      import bitronix.tm.journal.Journal;
      import bitronix.tm.resource.jdbc.PoolingDataSource;
      
      import org.springframework.context.ApplicationContext;
      import org.springframework.context.support.ClassPathXmlApplicationContext;
      
      import java.sql.Connection;
      import java.sql.DriverManager;
      import java.sql.ResultSet;
      import java.sql.SQLException;
      import java.util.Properties;
      
      import com.sample.SQLCRUD;
      import com.ExecutorServiceFactory_SPRING;
      
      /**
       * This is a sample file to test a process.
       */
      
      public class ProcessTestSpring   {
      
      private int processInstanceId=0;
      static EntityManagerFactory emf = null;
      
      public ProcessTestSpring(int processInstanceId ) {
        this.processInstanceId = processInstanceId ;
      
      
        public static void main(String[] args) throws Throwable {
      
        public void testProcess() throws Exception  {
        Map transMap = null;
        Iterator it;
      
        UserTransaction ut = null;
      
      
        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");
      
      
        ExecutorService executorService = ExecutorServiceFactory_SPRING.newExecutorService(emf);
      
      
        org.springframework.orm.jpa.JpaTransactionManager  jtm = (org.springframework.orm.jpa.JpaTransactionManager)context.getBean("jbpmTxManager");
      
        jtm.setEntityManagerFactory(emf);
      
      
        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()));
        }
      
        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();
      
          StatefulKnowledgeSession ksession = null;
         
          if (this.processInstanceId == 0){
      
          try {
        ksession = JPAKnowledgeService.newStatefulKnowledgeSession( kbase, null, env );
        } catch (Exception e) {
        e.printStackTrace();
        System.out.println(String.format("HERE@@@@!@@ EXCEPTION AFTER ksession creation...%s",e.toString()));
        }
         
          }
          else{
      
          ksession = JPAKnowledgeService.loadStatefulKnowledgeSession(this.processInstanceId, kbase, null, env);
          }
      
        AbstractAuditLogger auditLogger = AuditLoggerFactory.newJPAInstance();
      
        JPAWorkingMemoryDbLogger JPADbLogger = new JPAWorkingMemoryDbLogger(ksession);
      
      
        ksession.addEventListener(auditLogger);
      
      
        KieRuntimeLogger logger = KieServices.Factory.get().getLoggers() 
        .newThreadedFileLogger(ksession, "src/main/resources/mylogfile", 1000);
      
      
        try{
      
        AsyncWorkItemHandler asyncWIH = new AsyncWorkItemHandler(executorService);
      
        ksession.getWorkItemManager().registerWorkItemHandler("Service Task", asyncWIH);
      
        executorService.init();
      
        }
        catch (Exception ex){
        System.err.println("WorkitemHandler==>"+ex.toString());
        }
        ProcessInstance processInstance = ksession.startProcess("ServiceProcess");
      
        ksession.dispose();
        }
      
      
      }//end
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      

       

       

      Spring config:

       

      
      <?xml version="1.0" encoding="UTF-8"?>
      <beans xmlns="http://www.springframework.org/schema/beans"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xmlns:util="http://www.springframework.org/schema/util"
          xmlns:tx="http://www.springframework.org/schema/tx"
             xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                                http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">
      
        <bean id="jbpmEMF" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
          <property name="persistenceUnitName" value="org.persistence.unit"/>
          <property name="persistenceXmlLocation" value="classpath:META-INF/persistence.xml"/>
        </bean>
      
        <bean id="jbpmTxManager" class="org.springframework.orm.jpa.JpaTransactionManager">
          <property name="entityManagerFactory" ref="jbpmEMF"/>
        </bean>
        
        <bean id="logService" class="org.jbpm.process.audit.JPAAuditLogService">
          <constructor-arg>
            <ref bean="jbpmEMF"/>
          </constructor-arg>
          <!-- <constructor-arg>
            <value>STANDALONE_LOCAL_SPRING_SHARED_EM</value>
          </constructor-arg> -->
        </bean>
      
      </beans>
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      

       

      Stack Trace:

       

      
      2015-09-11 09:32:31,451 WARN  [org.kie.scanner.MavenRepository] (default task-6) 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:336) [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
      
      
      
      
      2015-09-11 09:32:32,026 INFO  [stdout] (default task-6) Hibernate: insert into SessionInfo (lastModificationDate, rulesByteArray, startDate, OPTLOCK) values (?, ?, ?, ?)
      2015-09-11 09:32:32,101 INFO  [stdout] (default task-6) HERE@@@@!@@ AFTER ksession creation...
      2015-09-11 09:32:32,139 INFO  [stdout] (default task-6) HERE@@@@!@@
      2015-09-11 09:32:32,154 WARN  [com.sample.TransactionalCommandService] (default task-6) 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.$Proxy94.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 com.sample.TransactionalCommandService.execute(TransactionalCommandService.java:41) [classes:]
              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:397) [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]
      
      2015-09-11 09:32:32,158 ERROR [stderr] (default task-6) WorkitemHandler==>javax.persistence.TransactionRequiredException: No local transaction to join
      2015-09-11 09:32:32,158 INFO  [stdout] (default task-6) before process instance start
      2015-09-11 09:32:32,164 INFO  [stdout] (default task-6) Session ID ==>261
      2015-09-11 09:32:32,202 INFO  [stdout] (default task-6) Hibernate: insert into ProcessInstanceInfo (lastModificationDate, lastReadDate, processId, processInstanceByteArray, startDate, state, OPTLOCK) values (?, ?, ?, ?, ?, ?, ?)
      2015-09-11 09:32:32,224 INFO  [stdout] (default task-6) Hibernate: insert into ProcessInstanceLog (duration, end_date, externalId, user_identity, outcome, parentProcessInstanceId, processId, processInstanceId, processName, processVersion, start_date, status) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
      2015-09-11 09:32:32,229 INFO  [stdout] (default task-6) Hibernate: insert into ProcessInstanceLog (duration, end_date, externalId, user_identity, outcome, parentProcessInstanceId, processId, processInstanceId, processName, processVersion, start_date, status) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
      2015-09-11 09:32:32,247 INFO  [stdout] (default task-6) Hibernate: insert into NodeInstanceLog (connection, log_date, externalId, nodeId, nodeInstanceId, nodeName, nodeType, processId, processInstanceId, type, workItemId) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
      2015-09-11 09:32:32,250 INFO  [stdout] (default task-6) Hibernate: insert into NodeInstanceLog (connection, log_date, externalId, nodeId, nodeInstanceId, nodeName, nodeType, processId, processInstanceId, type, workItemId) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
      2015-09-11 09:32:32,256 INFO  [stdout] (default task-6) Hibernate: insert into NodeInstanceLog (connection, log_date, externalId, nodeId, nodeInstanceId, nodeName, nodeType, processId, processInstanceId, type, workItemId) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
      2015-09-11 09:32:32,258 INFO  [stdout] (default task-6) Hibernate: insert into NodeInstanceLog (connection, log_date, externalId, nodeId, nodeInstanceId, nodeName, nodeType, processId, processInstanceId, type, workItemId) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
      2015-09-11 09:32:32,264 INFO  [stdout] (default task-6) Hibernate: insert into WorkItemInfo (creationDate, name, processInstanceId, state, OPTLOCK, workItemByteArray) values (?, ?, ?, ?, ?, ?)
      2015-09-11 09:32:32,281 INFO  [stdout] (default task-6) RUNNING in EXECUTOR!
      2015-09-11 09:32:32,282 WARN  [org.drools.persistence.SingleSessionCommandService] (default task-6) Could not commit session: org.jbpm.workflow.instance.WorkflowRuntimeException: [ServiceProcess:233 - Say Hello:2] -- Executor is not set or is not active
      
      
      
      
      
      
      
      2015-09-11 09:32:32,282 WARN  [org.drools.persistence.SingleSessionCommandService] (default task-6) Could not commit session: org.jbpm.workflow.instance.WorkflowRuntimeException: [ServiceProcess:233 - Say Hello:2] -- Executor is not set or is not active
              at org.jbpm.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:144) [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.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:419) [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: java.lang.IllegalStateException: Executor is not set or is not active        at com.sample.AsyncWorkItemHandler.executeWorkItem(AsyncWorkItemHandler.java:84) [classes:]
              at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.internalExecuteWorkItem(JPAWorkItemManager.java:54) [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]
              ... 53