1 Reply Latest reply on Jun 29, 2011 9:12 PM by priyakpandey

    JBPM 5.1 Final Release with jboss-5.1.0.GA - Service Task

    priyakpandey Newbie

      Hi,

      I have created and process which has a Service Task.

      Start -> Servicet Task -> End

       

      When i run this through a java test program it works fine.It uses org.jbpm.bpmn2.handler.ServiceTaskHandler which is present in jbpm-bpmn2-5.1.0.Final.jar and is deployed on to the jbpm-gwt-console-server.war

       

      public class ProcessTest {

                  public static final void main(String[] args) {

                          System.out.println("ProcessTest.main()");

                          try {

                                    // load up the knowledge base

                                    KnowledgeBase kbase = readKnowledgeBase();

                                    StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();

                                    KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory.newFileLogger(ksession, "test");

                                    ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new WSHumanTaskHandler());

                                    ksession.getWorkItemManager().registerWorkItemHandler("Service Task", new ServiceTaskHandler());

                                    System.out.println("ProcessTest.main()...executed");

                                    // start a new process instance

                                    ksession.startProcess("com.sample.bpmn.hello.service");

                                    logger.close();

                          } catch (Throwable t) {

                                    t.printStackTrace();

                          }

                }

       

       

                private static KnowledgeBase readKnowledgeBase() throws Exception {

                          KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();

                          kbuilder.add(ResourceFactory.newClassPathResource("ServiceSample.bpmn"), ResourceType.BPMN2);

                          return kbuilder.newKnowledgeBase();

                }

       

      }

       

      The issue is when i try to start the process from jbpm-console i get following erro in <jboss>\servers\default\logs\server.log,

      2011-06-29 16:07:58,802 INFO  [STDOUT] (http-localhost%2F127.0.0.1-8080-1) 16:07:58,802 ERROR [SynchronousDispatcher] failed to execute

      javax.ws.rs.WebApplicationException: org.drools.WorkItemHandlerNotFoundException: Could not find work item handler for Service Task

                at org.jboss.bpm.console.server.ProcessMgmtFacade.newInstance(ProcessMgmtFacade.java:209)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:117)

                at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:260)

                at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:232)

                at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:166)

                at org.jboss.resteasy.core.DispatcherUtilities.getJaxrsResponse(DispatcherUtilities.java:142)

                at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356)

                at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:173)

                at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:93)

                at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:68)

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

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)

                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

                at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)

                at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)

                at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)

                at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)

                at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)

                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

                at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)

                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)

                at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)

                at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)

                at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)

                at java.lang.Thread.run(Thread.java:662)

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

                at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.throwWorkItemNotFoundException(JPAWorkItemManager.java:60)

                at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.internalExecuteWorkItem(JPAWorkItemManager.java:55)

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

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

                at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerConnection(NodeInstanceImpl.java:185)

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

                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:122)

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

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

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

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

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

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

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

                at org.drools.command.runtime.process.StartProcessCommand.execute(StartProcessCommand.java:119)

                at org.drools.command.runtime.process.StartProcessCommand.execute(StartProcessCommand.java:38)

                at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:292)

                at org.drools.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:222)

                at org.jbpm.integration.console.CommandDelegate.startProcess(CommandDelegate.java:245)

                at org.jbpm.integration.console.ProcessManagement.newInstance(ProcessManagement.java:75)

                at org.jboss.bpm.console.server.ProcessMgmtFacade.newInstance(ProcessMgmtFacade.java:204)

                ... 38 more