0 Replies Latest reply on Nov 21, 2012 4:18 AM by ganesh r

    Unable to run the business process using JBPM 5.4

    ganesh r Newbie

      I have downloaded latest JBPM 5.4 final full installer. After installing in my local machine, developed a business process with human task, start event -> user task -> end event.

      To run the business process I have used the following code,

       

      public static final void main(String[] args) throws Exception {
        // load up the knowledge base
        //startUp();
        KnowledgeBase kbase = readKnowledgeBase();
        StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
        HornetQHTWorkItemHandler humanTaskHandler = new HornetQHTWorkItemHandler(
          ksession);
        humanTaskHandler.setIpAddress("127.0.0.1");
        humanTaskHandler.setPort(5445);
        ksession.getWorkItemManager().registerWorkItemHandler("Human Task",
          humanTaskHandler);
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("title", "ESS");
        params.put("businessKey", "ESS-Key");
        // start a new process instance
        ksession.startProcess("com.sample.bpmn.hello",params);
      }

      private static KnowledgeBase readKnowledgeBase() throws Exception {
        KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
        kbuilder.add(ResourceFactory.newClassPathResource("sample.bpmn"), ResourceType.BPMN2);
        return kbuilder.newKnowledgeBase();
      }

       

      But it is throwing the following exception,

       

      0    21/11 03:07:38,030[main] ERROR service.hornetq.HornetQTaskClientConnector.connect  - Unable to connect to server using configuration org-hornetq-core-remoting-impl-netty-NettyConnectorFactory?port=5445&host=127-0-0-1

      Exception in thread "main" org.jbpm.workflow.instance.WorkflowRuntimeException: [com.sample.bpmn.hello:1 - User Task:4] -- Could not connect task client: on ip: 127.0.0.1 - port: 5445

      at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:132)

      at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:279)

      at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:238)

      at org.jbpm.workflow.instance.node.ActionNodeInstance.triggerCompleted(ActionNodeInstance.java:55)

      at org.jbpm.workflow.instance.node.ActionNodeInstance.internalTrigger(ActionNodeInstance.java:51)

      at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:126)

      at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:279)

      at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:238)

      at org.jbpm.workflow.instance.node.StartNodeInstance.triggerCompleted(StartNodeInstance.java:49)

      at org.jbpm.workflow.instance.node.StartNodeInstance.internalTrigger(StartNodeInstance.java:41)

      at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:126)

      at org.jbpm.ruleflow.instance.RuleFlowProcessInstance.internalStart(RuleFlowProcessInstance.java:35)

      at org.jbpm.process.instance.impl.ProcessInstanceImpl.start(ProcessInstanceImpl.java:194)

      at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.start(WorkflowProcessInstanceImpl.java:309)

      at org.jbpm.process.instance.ProcessRuntimeImpl.startProcessInstance(ProcessRuntimeImpl.java:170)

      at org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:140)

      at org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1098)

      at org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:320)

      at com.sample.ProcessMain.main(ProcessMain.java:35)

      Caused by: java.lang.IllegalArgumentException: Could not connect task client: on ip: 127.0.0.1 - port: 5445

      at org.jbpm.process.workitem.wsht.GenericHTWorkItemHandler.connect(GenericHTWorkItemHandler.java:158)

      at org.jbpm.process.workitem.wsht.GenericHTWorkItemHandler.executeWorkItem(GenericHTWorkItemHandler.java:180)

      at org.drools.process.instance.impl.DefaultWorkItemManager.internalExecuteWorkItem(DefaultWorkItemManager.java:70)

      at org.jbpm.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:107)

      at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:126)

      ... 18 more

       

      Before running the business process I have started h2, jboss and task service using ant start.demo

       

      Do I'm missing anything here?