Hi all,
I tried to modify the HelloWorld sample to invoke an external service.
The external service was invoked successfully and the response was
received to ODE..
At this point the process fails with a NPE.
PartnerLinkPartnerRoleImpl line 62..
PartnerRoleMessageExchangeImpl createPartnerRoleMex(MessageExchangeDAO mexdao) {
InvocationStyle istyle = mexdao.getInvocationStyle();
......
switch (istyle) {
NPE occurs due to the style being NULL.
Am I doing anything wrong?.. (BPEL & the WSDL docs are attached).
But IMHO the NPE needs be checked and should throw a meaningful
exception.. Also the value for getInvocationStyle() in all of the
MessageExchangeDAO implementations have the possibility to be NULL..
thanks,
Thilina
org.apache.ode.bpel.iapi.BpelEngineException: java.lang.NullPointerException
at
org.apache.ode.bpel.engine.BpelServerImpl.getMessageExchange(BpelServerImpl.java:597)
at org.apache.ode.axis2.ExternalService.reply(ExternalService.java:282)
at org.apache.ode.axis2.ExternalService.invoke(ExternalService.java:145)
at
org.apache.ode.axis2.MessageExchangeContextImpl.invokePartnerUnreliable(MessageExchangeContextImpl.java:67)
at
org.apache.ode.bpel.engine.PartnerLinkPartnerRoleImpl.invokeInMem(PartnerLinkPartnerRoleImpl.java:208)
at
org.apache.ode.bpel.engine.PartnerLinkPartnerRoleImpl.invokeIL(PartnerLinkPartnerRoleImpl.java:120)
at
org.apache.ode.bpel.engine.BpelProcess.invokePartner(BpelProcess.java:1290)
at
org.apache.ode.bpel.engine.BpelRuntimeContextImpl.invoke(BpelRuntimeContextImpl.java:731)
at org.apache.ode.bpel.runtime.INVOKE.run(INVOKE.java:96)
at sun.reflect.GeneratedMethodAccessor57.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.apache.ode.jacob.vpu.JacobVPU$JacobThreadImpl.run(JacobVPU.java:451)
at org.apache.ode.jacob.vpu.JacobVPU.execute(JacobVPU.java:139)
at
org.apache.ode.bpel.engine.BpelRuntimeContextImpl.execute(BpelRuntimeContextImpl.java:762)
at
org.apache.ode.bpel.engine.BpelProcess.executeCreateInstance(BpelProcess.java:314)
at org.apache.ode.bpel.engine.BpelProcess$2.call(BpelProcess.java:261)
at org.apache.ode.bpel.engine.BpelProcess$2.call(BpelProcess.java:260)
at
org.apache.ode.bpel.engine.BpelProcess$ProcessCallable.call(BpelProcess.java:1128)
at
org.apache.ode.bpel.engine.BpelInstanceWorker.doInstanceWork(BpelInstanceWorker.java:174)
at
org.apache.ode.bpel.engine.BpelInstanceWorker.execInCurrentThread(BpelInstanceWorker.java:108)
at
org.apache.ode.bpel.engine.BpelProcess.doInstanceWork(BpelProcess.java:420)
at
org.apache.ode.bpel.engine.BpelProcess.invokeProcess(BpelProcess.java:259)
at
org.apache.ode.bpel.engine.MyRoleMessageExchangeImpl.doInvoke(MyRoleMessageExchangeImpl.java:132)
at
org.apache.ode.bpel.engine.UnreliableMyRoleMessageExchangeImpl$1.call(UnreliableMyRoleMessageExchangeImpl.java:48)
at
org.apache.ode.bpel.engine.UnreliableMyRoleMessageExchangeImpl$1.call(UnreliableMyRoleMessageExchangeImpl.java:47)
at
org.apache.ode.bpel.engine.BpelProcess$ProcessCallable.call(BpelProcess.java:1128)
at
org.apache.ode.bpel.engine.Contexts.execTransaction(Contexts.java:105)
at
org.apache.ode.bpel.engine.BpelServerImpl$TransactedCallable.call(BpelServerImpl.java:833)
at
org.apache.ode.bpel.engine.BpelServerImpl$ServerCallable.call(BpelServerImpl.java:811)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.NullPointerException
at
org.apache.ode.bpel.engine.PartnerLinkPartnerRoleImpl.createPartnerRoleMex(PartnerLinkPartnerRoleImpl.java:66)
at
org.apache.ode.bpel.engine.BpelProcess.createPartnerRoleMex(BpelProcess.java:889)
at
org.apache.ode.bpel.engine.BpelServerImpl$3.call(BpelServerImpl.java:578)
at
org.apache.ode.bpel.engine.BpelServerImpl$3.call(BpelServerImpl.java:555)
at
org.apache.ode.bpel.engine.BpelServerImpl.getMessageExchange(BpelServerImpl.java:591)
... 34 more
12:58:19,997 ERROR [ExternalService] Error executing reply
transaction; reply will be lost.
org.apache.ode.bpel.iapi.BpelEngineException: java.lang.NullPointerException
at
org.apache.ode.bpel.engine.BpelServerImpl.getMessageExchange(BpelServerImpl.java:597)
at org.apache.ode.axis2.ExternalService.reply(ExternalService.java:282)
at org.apache.ode.axis2.ExternalService.invoke(ExternalService.java:145)
at
org.apache.ode.axis2.MessageExchangeContextImpl.invokePartnerUnreliable(MessageExchangeContextImpl.java:67)
at
org.apache.ode.bpel.engine.PartnerLinkPartnerRoleImpl.invokeInMem(PartnerLinkPartnerRoleImpl.java:208)
at
org.apache.ode.bpel.engine.PartnerLinkPartnerRoleImpl.invokeIL(PartnerLinkPartnerRoleImpl.java:120)
at
org.apache.ode.bpel.engine.BpelProcess.invokePartner(BpelProcess.java:1290)
at
org.apache.ode.bpel.engine.BpelRuntimeContextImpl.invoke(BpelRuntimeContextImpl.java:731)
at org.apache.ode.bpel.runtime.INVOKE.run(INVOKE.java:96)
at sun.reflect.GeneratedMethodAccessor57.invoke(Unknown Source)
--
Thilina Gunarathne - http://thilinag.blogspot.com
<?xml version="1.0" encoding="utf-8" ?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<wsdl:definitions targetNamespace="http://ode/bpel/unit-test.wsdl"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://ode/bpel/unit-test.wsdl"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:typens="http://www.extreme.indiana.edu/xbaya/Complex_math_workflow_20070723_162045_798/xsd/"
xmlns:p0="http://www.extreme.indiana.edu/math/"
xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype">
<wsdl:import location="adder.wsdl" namespace="http://www.extreme.indiana.edu/math/"></wsdl:import>
<wsdl:types>
<schema targetNamespace="http://ode/bpel/unit-test.wsdl"
xmlns="http://www.w3.org/2001/XMLSchema"
elementFormDefault="unqualified">
<element name="Hello" type="tns:RunType" />
<complexType name="RunType">
<sequence>
<element name="a" type="xsd:string"></element>
</sequence>
</complexType>
<element name="HelloOut" type="tns:RunOutType" />
<complexType name="RunOutType">
<sequence>
<element name="a" type="xsd:string" />
<element name="b" type="xsd:string" />
</sequence>
</complexType>
</schema>
</wsdl:types>
<wsdl:message name="HelloMessage">
<wsdl:part name="TestPart" element="tns:Hello" />
</wsdl:message>
<wsdl:message name="HelloMessageOut">
<wsdl:part name="TestPart" element="tns:HelloOut" />
</wsdl:message>
<wsdl:portType name="HelloPortType">
<wsdl:operation name="hello">
<wsdl:input message="tns:HelloMessage" name="TestIn" />
<wsdl:output message="tns:HelloMessageOut" name="TestOut" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="HelloSoapBinding" type="tns:HelloPortType">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="hello">
<wsdl:input>
<soap:body namespace="http://ode/bpel/unit-test.wsdl"
use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body namespace="http://ode/bpel/unit-test.wsdl"
use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="HelloService">
<wsdl:port name="HelloPort" binding="tns:HelloSoapBinding">
<soap:address
location="http://localhost:8080/ode/processes/helloWorld" />
</wsdl:port>
</wsdl:service>
<plnk:partnerLinkType name="Adder_addLT">
<plnk:role name="Adder_addService" portType="p0:Adder" />
</plnk:partnerLinkType>
<plnk:partnerLinkType name="HelloPartnerLinkType">
<plnk:role name="me" portType="tns:HelloPortType" />
<plnk:role name="you" portType="tns:HelloPortType" />
</plnk:partnerLinkType>
</wsdl:definitions>
<definitions name="Adder"
targetNamespace="http://www.extreme.indiana.edu/math/"
xmlns:tns="http://www.extreme.indiana.edu/math/"
xmlns:typens="http://www.extreme.indiana.edu/math/adder/xsd/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<documentation>
A service for adding two numbers
</documentation>
<types>
<schema elementFormDefault="unqualified"
targetNamespace="http://www.extreme.indiana.edu/math/adder/xsd/"
xmlns="http://www.w3.org/2001/XMLSchema">
<element name="AddInput" type="typens:AddInputType" />
<complexType name="AddInputType">
<sequence>
<element name="x" type="xsd:int">
<annotation>
<documentation xml:lang="en">
This is the first input
</documentation>
</annotation>
</element>
<element name="y" type="xsd:int">
<annotation>
<documentation xml:lang="en">
This is the second input
</documentation>
</annotation>
</element>
</sequence>
</complexType>
<element name="AddOutput" type="typens:AddOutputType" />
<complexType name="AddOutputType">
<sequence>
<element name="z" type="xsd:int">
<annotation>
<documentation xml:lang="en">
This is the result
</documentation>
</annotation>
</element>
</sequence>
</complexType>
</schema>
</types>
<message name="AddInputMessage">
<part name="AddInputMessagePart" element="typens:AddInput" />
</message>
<message name="AddOutputMessage">
<part name="AddOutputMessagePart" element="typens:AddOutput" />
</message>
<portType name="Adder">
<operation name="add">
<documentation >Run the adder</documentation>
<input name="AddInput" message="tns:AddInputMessage" />
<output name="AddOutput" message="tns:AddOutputMessage" />
</operation>
</portType>
<binding name="AdderBinding" type="tns:Adder">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<operation name="add">
<soap:operation
soapAction="http://www.extreme.indiana.edu/math/add"
style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<service name="AdderService">
<port name="AdderSoapPort" binding="tns:AdderBinding">
<soap:address
location="http://localhost:8080/axis2/services/AdderService" />
</port>
</service>
</definitions>