5 Replies Latest reply: Feb 16, 2012 9:43 AM by Ali Abbas RSS

HelpDesk jBPM example not working

Ali Abbas Newbie

Hi,

 

I deployed HelpDesk .jar into switchyard 0.3 (following this example: https://community.jboss.org/wiki/SwitchYardBPMComponent) but when I make an xml request using soap UI I get the following exception:

 

15:31:37,689 WARNING [org.apache.cxf.phase.PhaseInterceptorChain] (pool-6-thread-1) Application {urn:switchyard-quickstart-demo:helpdesk:1.0}HelpDeskService#{urn:swi

tchyard-quickstart-demo:helpdesk:1.0}openTicket has thrown exception, unwinding now: org.apache.cxf.interceptor.Fault

        at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:155) [cxf-rt-core-2.4.1.jar:2.4.1]

        at org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.createFault(AbstractJAXWSMethodInvoker.java:86) [cxf-rt-frontend-jaxws-2.4.1.jar:2.4.1]

        at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:121) [cxf-rt-core-2.4.1.jar:2.4.1]

        at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:61) [cxf-rt-frontend-jaxws-2.4.1.jar:2.4.1]

        at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:75) [cxf-rt-core-2.4.1.jar:2.4.1]

        at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58) [cxf-rt-core-2.4.1.jar:2.4.1]

        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [:1.6.0_30]

        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [:1.6.0_30]

        at java.util.concurrent.FutureTask.run(FutureTask.java:138) [:1.6.0_30]

        at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37) [cxf-rt-core-2.4.1.jar:2.4.1]

        at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106) [cxf-rt-core-2.4.1.jar:2.4.1]

        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263) [cxf-api-2.4.1.jar:2.4.1]

        at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:118) [cxf-rt-core-2.4.1.jar:2.4.1]

        at org.apache.cxf.transport.http_jaxws_spi.JAXWSHttpSpiDestination.serviceRequest(JAXWSHttpSpiDestination.java:147) [cxf-rt-frontend-jaxws-2.4.1.jar:2.4.1]

        at org.apache.cxf.transport.http_jaxws_spi.JAXWSHttpSpiDestination.doService(JAXWSHttpSpiDestination.java:123) [cxf-rt-frontend-jaxws-2.4.1.jar:2.4.1]

        at org.apache.cxf.transport.http_jaxws_spi.HttpHandlerImpl.handle(HttpHandlerImpl.java:61) [cxf-rt-frontend-jaxws-2.4.1.jar:2.4.1]

        at org.jboss.wsf.stack.cxf.addons.transports.httpserver.HttpServerDestination$Handler.handle(HttpServerDestination.java:154) [jbossws-cxf-transports-httpserv

er-4.0.0.Beta3.jar:4.0.0.Beta3]

        at org.jboss.com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:78)

        at org.jboss.sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:80)

        at org.jboss.com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:81)

        at org.jboss.sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:689)

        at org.jboss.com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:78)

        at org.jboss.sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:661)

        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_30]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_30]

        at java.lang.Thread.run(Thread.java:662) [:1.6.0_30]

Caused by: java.lang.NullPointerException

        at org.jbpm.task.service.mina.MinaTaskClientConnector.write(MinaTaskClientConnector.java:118)

        at org.jbpm.task.service.TaskClient.addTask(TaskClient.java:68)

        at org.jbpm.process.workitem.wsht.CommandBasedWSHumanTaskHandler.executeWorkItem(CommandBasedWSHumanTaskHandler.java:215)

        at org.switchyard.component.bpm.task.drools.DroolsTaskHandler.executeTask(DroolsTaskHandler.java:97)

        at org.switchyard.component.bpm.task.jbpm.CommandBasedWSHumanTaskHandler.executeTask(CommandBasedWSHumanTaskHandler.java:61)

        at org.switchyard.component.bpm.task.drools.DroolsWorkItemHandler.executeWorkItem(DroolsWorkItemHandler.java:55)

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

        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.JoinInstance.triggerCompleted(JoinInstance.java:152)

        at org.jbpm.workflow.instance.node.JoinInstance.internalTrigger(JoinInstance.java:52)

        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.impl.ExtendedNodeInstanceImpl.triggerCompleted(ExtendedNodeInstanceImpl.java:47)

        at org.jbpm.workflow.instance.node.StateBasedNodeInstance.triggerCompleted(StateBasedNodeInstance.java:162)

        at org.jbpm.workflow.instance.node.StateBasedNodeInstance.triggerCompleted(StateBasedNodeInstance.java:143)

        at org.jbpm.workflow.instance.node.WorkItemNodeInstance.triggerCompleted(WorkItemNodeInstance.java:239)

        at org.jbpm.workflow.instance.node.WorkItemNodeInstance.workItemCompleted(WorkItemNodeInstance.java:301)

        at org.jbpm.workflow.instance.node.WorkItemNodeInstance.signalEvent(WorkItemNodeInstance.java:277)

        at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.signalEvent(WorkflowProcessInstanceImpl.java:333)

        at org.drools.process.instance.impl.DefaultWorkItemManager.completeWorkItem(DefaultWorkItemManager.java:116)

        at org.switchyard.component.bpm.task.drools.DroolsTaskManager.completeTask(DroolsTaskManager.java:61)

        at org.switchyard.component.bpm.task.SwitchYardServiceTaskHandler.executeTask(SwitchYardServiceTaskHandler.java:134)

        at org.switchyard.component.bpm.task.drools.DroolsWorkItemHandler.executeWorkItem(DroolsWorkItemHandler.java:55)

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

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

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

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

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

        at org.switchyard.component.bpm.exchange.drools.DroolsBPMExchangeHandler.handleMessage(DroolsBPMExchangeHandler.java:183)

        at org.switchyard.internal.DefaultHandlerChain.handleMessage(DefaultHandlerChain.java:146)

        at org.switchyard.internal.DefaultHandlerChain.handle(DefaultHandlerChain.java:121)

        at org.switchyard.internal.LocalDispatcher.dispatch(LocalExchangeBus.java:72)

        at org.switchyard.internal.ExchangeImpl.sendInternal(ExchangeImpl.java:253)

        at org.switchyard.internal.ExchangeImpl.send(ExchangeImpl.java:176)

        at org.switchyard.component.soap.InboundHandler.invoke(InboundHandler.java:229) [switchyard-component-soap-0.3.0.Final.jar:0.3.0.Final]

        at org.switchyard.component.soap.BaseWebService.invoke(BaseWebService.java:69) [switchyard-component-soap-0.3.0.Final.jar:0.3.0.Final]

        at org.switchyard.component.soap.BaseWebService.invoke(BaseWebService.java:34) [switchyard-component-soap-0.3.0.Final.jar:0.3.0.Final]

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_30]

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_30]

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_30]

        at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_30]

        at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:173) [cxf-rt-core-2.4.1.jar:2.4.1]

        at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:89) [cxf-rt-core-2.4.1.jar:2.4.1

 

Using

- java 1.6.30

- switchyard 0.3

- maven 3.0.4

 

I copied the .jar from the demo directory to the deployment folder so I am not sure where it went wrong.

 

Thanks.

  • 1. Re: HelpDesk jBPM example not working
    Keith Babo Master

    I see the same thing.  I'm pretty sure there was a bug in the helpdesk app when it was deployed outside the test framework in 0.3.  Had something to do with the human tasks not being completed automatically.  Looking at the message trace activity when running the app just now, that may indeed be the culprit.  I know that David fixed the underlying issue and a new version of the quickstart which makes it easier to take care of the human tasks through a web form.  He likely didn't see this thread, so I'll poke him to get his attention.

     

    cheers,

    keith

  • 2. Re: HelpDesk jBPM example not working
    Ali Abbas Newbie

    Thanks Keith, I was totally confused and had no idea where to look.

     

    Btw, what from the stacktrace gave you the idea that it had to with the human tasks not being completed automatically?    

  • 3. Re: HelpDesk jBPM example not working
    Keith Babo Master

    It was actually a combo of my gut feeling based on a known issue and the message trace output.  I should have clarified that "message trace" in this context refers to a handler that you can enable in our runtime which dumps message content.  I used forge to enable that on the project:

     

    helpdesk$ forge
        _____                    
       |  ___|__  _ __ __ _  ___ 
       | |_ / _ \| `__/ _` |/ _ \  \\
       |  _| (_) | | | (_| |  __/  //
       |_|  \___/|_|  \__, |\___| 
                       |___/      
    
    [switchyard-quickstart-demo-helpdesk] helpdesk $ switchyard trace-messages --enableTrace 
    Message tracing has been enabled.
    

     

     

    Then I observed the following in the server log when kicking the app from SoapUI:

     

    22:19:14,015 INFO  [org.switchyard.handlers.MessageTrace] (pool-7-thread-2) 
    ------- Begin Message Trace -------
    Service -> {urn:switchyard-quickstart-demo:helpdesk:0.1.0}HelpDeskService
    Phase -> IN
    State -> OK
    Exchange Context -> 
    Message Context -> 
              org.switchyard.messageId : 46a8f026-42a7-4a30-992f-43df4a8bd3a0
              org.switchyard.transform.TransformSequence : org.switchyard.transform.TransformSequence@57669976
              MESSAGE_NAME : openTicket
    Message Content -> 
    <?xml version="1.0" encoding="UTF-8"?><urn:openTicket xmlns:urn="urn:switchyard-quickstart-demo:helpdesk:1.0">
             <ticket>
                <id>40</id>
             </ticket>
          </urn:openTicket>
    ------ End Message Trace -------
    22:19:14,018 INFO  [org.switchyard.handlers.MessageTrace] (pool-7-thread-2) 
    ------- Begin Message Trace -------
    Service -> {urn:switchyard-quickstart-demo:helpdesk:0.1.0}TicketManagementService
    Phase -> IN
    State -> OK
    Exchange Context -> 
    Message Context -> 
              ServiceName : TicketManagementService
              ServiceOperationName : openTicket
              org.switchyard.messageId : 07e4a6da-ab92-4a25-b04c-8941443a9c0c
              ticket : org.switchyard.quickstarts.demos.helpdesk.Ticket@6b9b6541
    Message Content -> 
    org.switchyard.quickstarts.demos.helpdesk.Ticket@6b9b6541
    ------ End Message Trace -------
    22:19:14,019 ERROR [stderr] (pool-7-thread-2) ********** TicketManagementServiceBean: opening ticket **********
    22:19:14,019 INFO  [org.switchyard.handlers.MessageTrace] (pool-7-thread-2) 
    ------- Begin Message Trace -------
    Service -> {urn:switchyard-quickstart-demo:helpdesk:0.1.0}TicketManagementService
    Phase -> OUT
    State -> OK
    Exchange Context -> 
    Message Context -> 
              org.switchyard.relatesTo : 07e4a6da-ab92-4a25-b04c-8941443a9c0c
              org.switchyard.messageId : 00a97dfb-0719-417d-a577-2de957deaf50
    Message Content -> 
    org.switchyard.quickstarts.demos.helpdesk.TicketAck@728d4682
    ------ End Message Trace -------
    22:19:24,047 WARNING [org.apache.cxf.phase.PhaseInterceptorChain] (pool-7-thread-2) Application {urn:switchyard-quickstart-demo:helpdesk:1.0}HelpDeskService#{urn:switchyard-quickstart-demo:helpdesk:1.0}openTicket has thrown exception, unwinding now: org.apache.cxf.interceptor.Fault
              at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:155) [cxf-rt-core-2.4.1.jar:2.4.1]
              at org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.createFault(AbstractJAXWSMethodInvoker.java:86) [cxf-rt-frontend-jaxws-2.4.1.jar:2.4.1]
              at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:121) [cxf-rt-core-2.4.1.jar:2.4.1]
              at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:61) [cxf-rt-frontend-jaxws-2.4.1.jar:2.4.1]
              at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:75) [cxf-rt-core-2.4.1.jar:2.4.1]
              at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58) [cxf-rt-core-2.4.1.jar:2.4.1]
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [:1.6.0_29]
              at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [:1.6.0_29]
              at java.util.concurrent.FutureTask.run(FutureTask.java:138) [:1.6.0_29]
              at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37) [cxf-rt-core-2.4.1.jar:2.4.1]
              at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106) [cxf-rt-core-2.4.1.jar:2.4.1]
              at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263) [cxf-api-2.4.1.jar:2.4.1]
              at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:118) [cxf-rt-core-2.4.1.jar:2.4.1]
              at org.apache.cxf.transport.http_jaxws_spi.JAXWSHttpSpiDestination.serviceRequest(JAXWSHttpSpiDestination.java:147) [cxf-rt-frontend-jaxws-2.4.1.jar:2.4.1]
              at org.apache.cxf.transport.http_jaxws_spi.JAXWSHttpSpiDestination.doService(JAXWSHttpSpiDestination.java:123) [cxf-rt-frontend-jaxws-2.4.1.jar:2.4.1]
              at org.apache.cxf.transport.http_jaxws_spi.HttpHandlerImpl.handle(HttpHandlerImpl.java:61) [cxf-rt-frontend-jaxws-2.4.1.jar:2.4.1]
              at org.jboss.wsf.stack.cxf.addons.transports.httpserver.HttpServerDestination$Handler.handle(HttpServerDestination.java:154) [jbossws-cxf-transports-httpserver-4.0.0.Beta3.jar:4.0.0.Beta3]
              at org.jboss.com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:78)
              at org.jboss.sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:80)
              at org.jboss.com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:81)
              at org.jboss.sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:689)
              at org.jboss.com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:78)
              at org.jboss.sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:661)
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_29]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_29]
              at java.lang.Thread.run(Thread.java:680) [:1.6.0_29]
    Caused by: java.lang.NullPointerException
              at org.jbpm.task.service.mina.MinaTaskClientConnector.write(MinaTaskClientConnector.java:118)
              at org.jbpm.task.service.TaskClient.addTask(TaskClient.java:68)
              at org.jbpm.process.workitem.wsht.CommandBasedWSHumanTaskHandler.executeWorkItem(CommandBasedWSHumanTaskHandler.java:215)
              at org.switchyard.component.bpm.task.drools.DroolsTaskHandler.executeTask(DroolsTaskHandler.java:97)
              at org.switchyard.component.bpm.task.jbpm.CommandBasedWSHumanTaskHandler.executeTask(CommandBasedWSHumanTaskHandler.java:61)
              at org.switchyard.component.bpm.task.drools.DroolsWorkItemHandler.executeWorkItem(DroolsWorkItemHandler.java:55)
              at org.drools.process.instance.impl.DefaultWorkItemManager.internalExecuteWorkItem(DefaultWorkItemManager.java:70)
    

     

    So I can see from the above that the first step in the business process, invocation of TicketManagementService, completed and the state has moved on through the gateway to one of the human task nodes.  The NPE near the bottom of the stack indicates that it's coming from the WSHumanTaskHandler, which seems to confirm that things are going afowl in the human task step.

     

    cheers,

    keith

  • 4. Re: HelpDesk jBPM example not working
    David Ward Master

    Keith is correct that there was indeed an issue in 0.3 wrt human task completion.  However, what he was "more correct" about is the fact that it is being run outside of the test framework. The test framework starts up a MinaTaskServer, and the MinaTaskClient needs to connect to it. Your stack trace is showing the client connector complaining, which points to this.  I am almost done - in 0.4 - putting together a deployable webapp example that can be used outside the test framework. I'm sorry, but for now the answer is "stay tuned for 0.4..." (However, once my change is pushed to github, you'll be able to pull it down yourself and give it a go - which would be great so we have another set of eyes validating it.)  Thanks for contributing feedback; it's much appreciated!

  • 5. Re: HelpDesk jBPM example not working
    Ali Abbas Newbie

    Thanks David and Keith, I appreciate the detailed response.

     

    p.s. I hope 0.4 will be out soon