0 Replies Latest reply on Jan 6, 2014 9:22 AM by Ramesh Routray

    jbpm 5.4 with Oracle integration - Error - Could not connect task client

    Ramesh Routray Newbie

      I am trying to integrate oracle database with jbpm 5 instead of using its own h2 database. 

      I am using the following tools/APIs. I have provided the code and error below. Can any body help me understand and resolve the issue?

      jbpm 5.4 

      eclipse juno sr1 

      websphere 7 

      oracle 10g 

       

       

      Java Code: 

      Code for Knowledge Session creation: 

      EntityManagerFactory emf = Persistence.createEntityManagerFactory( "org.jbpm.persistence.jpa" );

      Environment env = KnowledgeBaseFactory.newEnvironment();

      System.out.println(emf);

      System.out.println(EnvironmentName.ENTITY_MANAGER_FACTORY);

      env.set( EnvironmentName.ENTITY_MANAGER_FACTORY, emf );

      env.set( EnvironmentName.TRANSACTION_MANAGER, TransactionManagerServices.getTransactionManager() );

      env.set( EnvironmentName.GLOBALS, new MapGlobalResolver() );

      Properties properties = new Properties();

      properties.put("drools.processInstanceManagerFactory", "org.jbpm.persistence.processinstance.JPAProcessInstanceManagerFactory");

      properties.put("drools.processSignalManagerFactory", "org.jbpm.persistence.processinstance.JPASignalManagerFactory");

      KnowledgeSessionConfiguration config = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(properties);

      System.out.println("config ** "+config);

      System.out.println("kbase ** "+kbase);

      System.out.println("env ** "+env);

      System.out.println("env transaction manager: "+env.get("drools.transaction.TransactionManager"));

      StatefulKnowledgeSession newStatefulKnowledgeSession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase,config,env);

       

       

      Code for task handler connect: 

      KnowledgeBase kbase = readKnowledgeBase("HelloProcess.bpmn");

      StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);

      CommandBasedWSHumanTaskHandler taskHandler = new CommandBasedWSHumanTaskHandler(ksession);

      ksession.getWorkItemManager().registerWorkItemHandler("Human Task", taskHandler);

      taskHandler.connect();

      ksession.startProcess("Hello");

      ksession.fireAllRules();

       

       

      persistence.xml: 

      <persistence-unit name="org.jbpm.persistence.jpa">

      <provider>org.hibernate.ejb.HibernatePersistence</provider>

      <class>org.drools.persistence.info.SessionInfo</class>

      <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>

      <class>org.jbpm.persistence.processinstance.ProcessInstanceEventInfo</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.task.Task</class>

      <class>org.jbpm.task.Comment</class>

      <class>org.jbpm.task.Attachment</class>

      <class>org.jbpm.task.I18NText</class>

      <class>org.jbpm.task.SubTasksStrategy</class>

      <class>org.jbpm.task.Deadline</class>

      <class>org.jbpm.task.Escalation</class>

      <class>org.jbpm.task.Reassignment</class>

      <class>org.jbpm.task.Notification</class>

      <class>org.jbpm.task.BooleanExpression</class>

      <class>org.jbpm.task.User</class>

      <class>org.jbpm.task.PeopleAssignments</class>

       

      <properties>   

      <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>

      <property name="hibernate.connection.driver_class" value="oracle.jdbc.driver.OracleDriver"/>

      <property name="hibernate.connection.url" value="jdbc:oracle:thin:@192.192.192.192:1521:abcd" />

      <property name="hibernate.connection.username" value="jbpm"/>

      <property name="hibernate.connection.password" value="jbpm"/>    

      <property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect"/>

      <property name="hibernate.connection.autocommit" value="false"/>

      <property name="hibernate.max_fetch_depth" value="3"/>

      <property name="hibernate.hbm2ddl.auto" value="create" />

      <property name="hibernate.show_sql" value="true" />

      </properties>

      </persistence-unit>

       

      <persistence-unit name="org.jbpm.task">

      <provider>org.hibernate.ejb.HibernatePersistence</provider>

      <class>org.jbpm.task.Attachment</class>

      <class>org.jbpm.task.Content</class>

      <class>org.jbpm.task.BooleanExpression</class>

      <class>org.jbpm.task.Comment</class>

      <class>org.jbpm.task.Deadline</class>

      <class>org.jbpm.task.Comment</class>

      <class>org.jbpm.task.Deadline</class>

      <class>org.jbpm.task.Delegation</class>

      <class>org.jbpm.task.Escalation</class>

      <class>org.jbpm.task.Group</class>

      <class>org.jbpm.task.I18NText</class>

      <class>org.jbpm.task.Notification</class>

      <class>org.jbpm.task.EmailNotification</class>

      <class>org.jbpm.task.EmailNotificationHeader</class>

      <class>org.jbpm.task.PeopleAssignments</class>

      <class>org.jbpm.task.Reassignment</class>

      <class>org.jbpm.task.Status</class>

      <class>org.jbpm.task.Task</class>

      <class>org.jbpm.task.TaskData</class>

      <class>org.jbpm.task.SubTasksStrategy</class>

      <class>org.jbpm.task.OnParentAbortAllSubTasksEndStrategy</class>

      <class>org.jbpm.task.OnAllSubTasksEndParentEndStrategy</class>

      <class>org.jbpm.task.User</class>

      <class>org.drools.persistence.info.SessionInfo</class>

      <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>

      <class>org.jbpm.persistence.processinstance.ProcessInstanceEventInfo</class>

      <class>org.drools.persistence.info.WorkItemInfo</class>

       

      <properties>

      <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>

      <property name="hibernate.connection.driver_class" value="oracle.jdbc.driver.OracleDriver"/>

      <property name="hibernate.connection.url" value="jdbc:oracle:thin:@192.192.192.192:1521:abcd" />

      <property name="hibernate.connection.username" value="jbpmtask"/>

      <property name="hibernate.connection.password" value="jbpmtask"/>    

      <property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect"/>

      <property name="hibernate.connection.autocommit" value="false"/>

      <property name="hibernate.max_fetch_depth" value="3"/>

      <property name="hibernate.hbm2ddl.auto" value="create" />

      <property name="hibernate.show_sql" value="true" />

      </properties>

      </persistence-unit>

      </persistence>

       

       

      ERROR Stack Trace: 

      WARNING: Found unrecognized persistence provider "org.hibernate.ejb.HibernatePersistence" in place of OpenJPA provider.  This provider's properties will not be used.

      Hibernate: select SESSIONINFO_ID_SEQ.nextval from dual

      java.lang.IllegalArgumentException: Could not connect task client

        at org.jbpm.process.workitem.wsht.CommandBasedWSHumanTaskHandler.connect(CommandBasedWSHumanTaskHandler.java:123)

        at com.sample.execute.MigrateDB.dbMIgration(MigrateDB.java:50)

        at com.servlets.AServlet.doPost(AServlet.java:41)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)

        at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1657)

        at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:939)

        at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:502)

        at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:179)

        at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3935)

        at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276)

        at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:931)

        at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583)

        at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186)

        at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452)

        at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511)

        at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305)

        at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)

        at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)

        at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)

        at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)

        at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)

        at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)

        at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)

        at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)

        at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1604)