ERROR org.flowable.engine.common.impl.interceptor.CommandContext - Error while closing command context java.lang.NullPointerException at org.flowable.engine.impl.bpmn.data.ItemDefinition.createInstance(ItemDefinition.java:42)

Hi I have Created the sample bpmn file with two tasks.One is Script task and another one is webservice task. Please find bpmn xml file in below image. bpmn20

wsdl file,

<?xml version="1.0" encoding="UTF-8"?>

<wsdl:definitions targetNamespace=“http://test.fico.com” xmlns:apachesoap=“http://xml.apache.org/xml-soap
xmlns:impl=“http://test.fico.com” xmlns:intf=“http://test.fico.com” xmlns:wsdl=“http://schemas.xmlsoap.org/wsdl/
xmlns:wsdlsoap=“http://schemas.xmlsoap.org/wsdl/soap/” xmlns:xsd=“http://www.w3.org/2001/XMLSchema”>

wsdl:types












</wsdl:types>

<wsdl:message name=“sayHelloWorldRequest”>

  <wsdl:part element="impl:sayHelloWorld" name="parameters">

  </wsdl:part>

</wsdl:message>

<wsdl:message name=“sayHelloWorldResponse”>

  <wsdl:part element="impl:sayHelloWorldResponse" name="parameters">

  </wsdl:part>

</wsdl:message>

<wsdl:portType name=“HelloWorldImpl”>

  <wsdl:operation name="sayHelloWorld">

     <wsdl:input message="impl:sayHelloWorldRequest" name="sayHelloWorldRequest">

   </wsdl:input>

     <wsdl:output message="impl:sayHelloWorldResponse" name="sayHelloWorldResponse">

   </wsdl:output>

  </wsdl:operation>

</wsdl:portType>

<wsdl:binding name=“HelloWorldImplSoapBinding” type=“impl:HelloWorldImpl”>

  <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

  <wsdl:operation name="sayHelloWorld">

     <wsdlsoap:operation soapAction=""/>

     <wsdl:input name="sayHelloWorldRequest">

        <wsdlsoap:body use="literal"/>

     </wsdl:input>

     <wsdl:output name="sayHelloWorldResponse">

        <wsdlsoap:body use="literal"/>

     </wsdl:output>

  </wsdl:operation>

</wsdl:binding>

<wsdl:service name=“HelloWorldImplService”>

  <wsdl:port binding="impl:HelloWorldImplSoapBinding" name="HelloWorldImpl">

     <wsdlsoap:address location="http://localhost:9090/SimpleSOAPExample/services/HelloWorldImpl"/>

  </wsdl:port>

</wsdl:service>

</wsdl:definitions>

================================================
Here , when execute this process, script task executed successfully and web service task got failed with below error message,

12:39:29,887 [http-apr-8080-exec-2] INFO org.apache.cxf.endpoint.dynamic.DynamicClientFactory - Created classes: com.fico.test.ObjectFactory, com.fico.test.SayHelloWorld, com.fico.test.Say
HelloWorldResponse, org.w3._2001.xmlschema.Adapter1, org.w3._2001.xmlschema.Adapter2, org.w3._2001.xmlschema.Adapter3
12:39:30,459 [http-apr-8080-exec-2] ERROR org.flowable.engine.common.impl.interceptor.CommandContext - Error while closing command context
java.lang.NullPointerException
at org.flowable.engine.impl.bpmn.data.ItemDefinition.createInstance(ItemDefinition.java:42)
at org.flowable.engine.impl.bpmn.webservice.MessageDefinition.createInstance(MessageDefinition.java:34)
at org.flowable.engine.impl.bpmn.behavior.WebServiceActivityBehavior.execute(WebServiceActivityBehavior.java:129)
at org.flowable.engine.impl.agenda.ContinueProcessOperation.executeActivityBehavior(ContinueProcessOperation.java:248)
at org.flowable.engine.impl.agenda.ContinueProcessOperation.executeSynchronous(ContinueProcessOperation.java:154)
at org.flowable.engine.impl.agenda.ContinueProcessOperation.continueThroughFlowNode(ContinueProcessOperation.java:111)
at org.flowable.engine.impl.agenda.ContinueProcessOperation.continueThroughSequenceFlow(ContinueProcessOperation.java:295)
at org.flowable.engine.impl.agenda.ContinueProcessOperation.run(ContinueProcessOperation.java:77)
at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperation(CommandInvoker.java:88)
at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperations(CommandInvoker.java:72)
at org.flowable.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:56)
at org.flowable.engine.impl.interceptor.BpmnOverrideContextInterceptor.execute(BpmnOverrideContextInterceptor.java:25)
at org.flowable.engine.common.impl.interceptor.TransactionContextInterceptor.execute(TransactionContextInterceptor.java:53)
at org.flowable.engine.common.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:72)
at org.flowable.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:49)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
at org.flowable.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:46)
at org.flowable.engine.common.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)
at org.flowable.engine.common.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56)
at org.flowable.engine.common.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:51)
at org.flowable.engine.impl.RuntimeServiceImpl.startProcessInstance(RuntimeServiceImpl.java:654)
at org.flowable.engine.impl.runtime.ProcessInstanceBuilderImpl.start(ProcessInstanceBuilderImpl.java:139)
at org.flowable.rest.service.api.runtime.process.ProcessInstanceCollectionResource.createProcessInstance(ProcessInstanceCollectionResource.java:238)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

Please help me on this.

Thanks,
Subbu

Hi,

In the flowable-cxf module there are quite a number of unit tests showing how to use the web service task in Flowable. Maybe it’s a good idea to have a look at these unit tests and compare them with your implementation. The NPE is thrown because the StructureDefinition is null I think, and that should never happen.

Best regards,

Tijs

Hi,
Thanks for your quick reply. I have gone through the flowable-cxf examples, based on that i executed the above example.I have created soap project and running in 9090 port.that i am trying to access through web service task in bpmn. Can any on help on this.

Thanks,
Subbu

Does the wsdl posted above contain everything?
Can you post both the .bpmn20.xml (instead of an image) and .wsdl file (or upload it somewhere) so we can run the test. Looking at the exception, the structure of the message is null, which means the message hasn’t been properly defined. But the actual test files would help a lot here.

Hi joram,

I have uploaded the bpmn and wsdl files in github public repository. Please check below link to access the files,

  1. HelloWorldImpl.wsdl
  2. SoapTest.bpmn20.xml

Please let me know if you need more info.

Regards,
Subbu

Hi Subbu did you resolve Null pointer exception

Hi,
Please check out my working code from git hub.