Hi Ian, I'm afraid this is a bug. you're not at fault. I've filled an issue to track it: https://issues.apache.org/jira/browse/ODE-614. Could you try the patch attached to the issue? I can't think of any workaround, except using the webapp instead of JBI. sorry.
Alexis On Wed, May 27, 2009 at 12:06 AM, Ian Harrigan <[email protected]>wrote: > Hi All, > > Im wondering if someone might be able to help me. Im trying to invoke an > external axis2 web service from a ODE BPEL project deployed inside a > ServiceMix JBI container but every time i try to invoke i get the following > errors. > > java.lang.ClassCastException: org.apache.ode.jbi.JbiEndpointReference > at > org.apache.ode.jbi.EndpointReferenceContextImpl.getConfigLookup(EndpointReferenceContextImpl.java:116) > at > org.apache.ode.store.ProcessConfImpl.getEndpointProperties(ProcessConfImpl.java:417) > at > org.apache.ode.bpel.engine.BpelProcess.getTimeout(BpelProcess.java:1089) > at > org.apache.ode.bpel.engine.BpelRuntimeContextImpl.scheduleInvokeCheck(BpelRuntimeContextImpl.java:839) > at > org.apache.ode.bpel.engine.BpelRuntimeContextImpl.invoke(BpelRuntimeContextImpl.java:777) > at org.apache.ode.bpel.runtime.INVOKE.run(INVOKE.java:100) > at sun.reflect.GeneratedMethodAccessor61.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:870) > at > org.apache.ode.bpel.engine.PartnerLinkMyRoleImpl.invokeNewInstance(PartnerLinkMyRoleImpl.java:206) > at > org.apache.ode.bpel.engine.BpelProcess.invokeProcess(BpelProcess.java:237) > at > org.apache.ode.bpel.engine.BpelProcess.handleWorkEvent(BpelProcess.java:408) > at > org.apache.ode.bpel.engine.BpelEngineImpl.onScheduledJob(BpelEngineImpl.java:439) > at > org.apache.ode.bpel.engine.BpelServerImpl.onScheduledJob(BpelServerImpl.java:441) > at > org.apache.ode.scheduler.simple.SimpleScheduler$4$1.call(SimpleScheduler.java:411) > at > org.apache.ode.scheduler.simple.SimpleScheduler$4$1.call(SimpleScheduler.java:405) > at > org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:218) > at > org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:404) > at > org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:401) > 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) > ERROR - BpelEngineImpl - Scheduled job failed; > jobDetail={type=INVOKE_INTERNAL, mexid=hqejbhcnphr4b38pwtl5vq, pid={ > http://xmlns.apache.ode.com/DynamicPLTest}DynamicPLTest-145<http://xmlns.apache.ode.com/DynamicPLTest%7DDynamicPLTest-145> > } > java.lang.RuntimeException: java.lang.ClassCastException: > org.apache.ode.jbi.JbiEndpointReference > at > org.apache.ode.jacob.vpu.JacobVPU$JacobThreadImpl.run(JacobVPU.java:464) > at org.apache.ode.jacob.vpu.JacobVPU.execute(JacobVPU.java:139) > at > org.apache.ode.bpel.engine.BpelRuntimeContextImpl.execute(BpelRuntimeContextImpl.java:870) > at > org.apache.ode.bpel.engine.PartnerLinkMyRoleImpl.invokeNewInstance(PartnerLinkMyRoleImpl.java:206) > at > org.apache.ode.bpel.engine.BpelProcess.invokeProcess(BpelProcess.java:237) > at > org.apache.ode.bpel.engine.BpelProcess.handleWorkEvent(BpelProcess.java:408) > at > org.apache.ode.bpel.engine.BpelEngineImpl.onScheduledJob(BpelEngineImpl.java:439) > at > org.apache.ode.bpel.engine.BpelServerImpl.onScheduledJob(BpelServerImpl.java:441) > at > org.apache.ode.scheduler.simple.SimpleScheduler$4$1.call(SimpleScheduler.java:411) > at > org.apache.ode.scheduler.simple.SimpleScheduler$4$1.call(SimpleScheduler.java:405) > at > org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:218) > at > org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:404) > at > org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:401) > 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) > > The service im just trying to invoke at the moment is a simple echo server > (just to get the most simple idea working first). The [generated] WSDL is as > follows: > > <?xml version="1.0" encoding="UTF-8"?> > <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" > xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:ns0=" > http://ws.test" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" > xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:ns1=" > http://org.apache.axis2/xsd" xmlns:wsaw=" > http://www.w3.org/2006/05/addressing/wsdl" xmlns:xs=" > http://www.w3.org/2001/XMLSchema" xmlns:soap=" > http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://ws.test"> > <wsdl:documentation>EchoService</wsdl:documentation> > <wsdl:types> > <xs:schema xmlns:ns="http://ws.test" > attributeFormDefault="qualified" elementFormDefault="qualified" > targetNamespace="http://ws.test"> > <xs:complexType name="Exception"> > <xs:sequence> > <xs:element minOccurs="0" name="Exception" > nillable="true" type="xs:anyType"/> > </xs:sequence> > > </xs:complexType> > <xs:element name="Exception"> > <xs:complexType> > <xs:sequence> > <xs:element minOccurs="0" name="Exception" > nillable="true" type="ns:Exception"/> > </xs:sequence> > </xs:complexType> > </xs:element> > <xs:element name="echo"> > > <xs:complexType> > <xs:sequence> > <xs:element minOccurs="0" name="input" > nillable="true" type="xs:string"/> > </xs:sequence> > </xs:complexType> > </xs:element> > <xs:element name="echoResponse"> > <xs:complexType> > <xs:sequence> > > <xs:element minOccurs="0" name="return" > nillable="true" type="xs:string"/> > </xs:sequence> > </xs:complexType> > </xs:element> > </xs:schema> > </wsdl:types> > <wsdl:message name="echoRequest"> > <wsdl:part name="parameters" element="ns0:echo"/> > </wsdl:message> > > <wsdl:message name="echoResponse"> > <wsdl:part name="parameters" element="ns0:echoResponse"/> > </wsdl:message> > <wsdl:message name="Exception"> > <wsdl:part name="parameters" element="ns0:Exception"/> > </wsdl:message> > <wsdl:portType name="EchoServicePortType"> > <wsdl:operation name="echo"> > <wsdl:input message="ns0:echoRequest" wsaw:Action="urn:echo"/> > > <wsdl:output message="ns0:echoResponse" > wsaw:Action="urn:echoResponse"/> > <wsdl:fault message="ns0:Exception" name="Exception" > wsaw:Action="urn:echoException"/> > </wsdl:operation> > </wsdl:portType> > <wsdl:binding name="EchoServiceSOAP11Binding" > type="ns0:EchoServicePortType"> > <soap:binding transport="http://schemas.xmlsoap.org/soap/http" > style="document"/> > <wsdl:operation name="echo"> > <soap:operation soapAction="urn:echo" style="document"/> > <wsdl:input> > > <soap:body use="literal"/> > </wsdl:input> > <wsdl:output> > <soap:body use="literal"/> > </wsdl:output> > <wsdl:fault name="Exception"> > <soap:fault use="literal" name="Exception"/> > </wsdl:fault> > </wsdl:operation> > > </wsdl:binding> > <wsdl:binding name="EchoServiceSOAP12Binding" > type="ns0:EchoServicePortType"> > <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" > style="document"/> > <wsdl:operation name="echo"> > <soap12:operation soapAction="urn:echo" style="document"/> > <wsdl:input> > <soap12:body use="literal"/> > </wsdl:input> > <wsdl:output> > > <soap12:body use="literal"/> > </wsdl:output> > <wsdl:fault name="Exception"> > <soap12:fault use="literal" name="Exception"/> > </wsdl:fault> > </wsdl:operation> > </wsdl:binding> > <wsdl:binding name="EchoServiceHttpBinding" > type="ns0:EchoServicePortType"> > <http:binding verb="POST"/> > > <wsdl:operation name="echo"> > <http:operation location="EchoService/echo"/> > <wsdl:input> > <mime:content type="text/xml" part="echo"/> > </wsdl:input> > <wsdl:output> > <mime:content type="text/xml" part="echo"/> > </wsdl:output> > </wsdl:operation> > > </wsdl:binding> > <wsdl:service name="EchoService"> > <wsdl:port name="EchoServiceSOAP11port_http" > binding="ns0:EchoServiceSOAP11Binding"> > <soap:address location=" > http://localhost:8080/axis2/services/EchoService"/> > </wsdl:port> > <wsdl:port name="EchoServiceSOAP12port_http" > binding="ns0:EchoServiceSOAP12Binding"> > <soap12:address location=" > http://localhost:8080/axis2/services/EchoService"/> > </wsdl:port> > <wsdl:port name="EchoServiceHttpport" > binding="ns0:EchoServiceHttpBinding"> > > <http:address location=" > http://localhost:8080/axis2/services/EchoService"/> > </wsdl:port> > </wsdl:service> > </wsdl:definitions> > > To get this to work, since there are no partner link types i added a new > file and imported this generated one, that one looks like: > > <definitions > > targetNamespace="http://ws.test" > xmlns="http://schemas.xmlsoap.org/wsdl/" > xmlns:ns0="http://ws.test" > xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > > > <import namespace="http://ws.test" location="EchoService.wsdl"/> > > <plnk:partnerLinkType name="EchoServicePartnerLinkType"> > <plnk:role name="EchoServiceProvider" > portType="ns0:EchoServicePortType"/> > </plnk:partnerLinkType> > </definitions> > > I have also made a copy of the first WSDL, moved it to the appropriate > http-provider service unit and added the required > > <smix:endpoint role="provider" defaultMep="in-out"/> > > Line in the correct place. > > Also, the BPEL source that calls it looks something like this (irrelevant > parts removed): > > <bpws:import importType="http://schemas.xmlsoap.org/wsdl/" > location="EchoServiceRef.wsdl" namespace="http://ws.test"/> > .... > <bpws:partnerLinks> > <bpws:partnerLink partnerRole="EchoServiceProvider" > name="EchoServicePartnerLink" > partnerLinkType="echo:EchoServicePartnerLinkType"/> > </bpws:partnerLinks> > .... > <bpws:variable name="echoInput" messageType="echo:echoRequest"/> > <bpws:variable name="echoOutput" messageType="echo:echoResponse"/> > .... > <bpws:invoke name="invokeEcho" partnerLink="EchoServicePartnerLink" > portType="echo:EchoServicePortType" operation="echo" > inputVariable="echoInput" outputVariable="echoOutput"/> > > finally my deploy.xml is as follows: > > <?xml version="1.0" encoding="utf-8"?> > <deploy xmlns="http://ode.fivesight.com/schemas/2006/06/27/dd" > xmlns:lpe="http://xmlns.apache.ode.com/LookupPracticeEndpoint" > xmlns:echo="http://ws.test" > xmlns:tns="http://xmlns.apache.ode.com/DynamicPLTest"> > <process name="tns:DynamicPLTest"> > <active>true</active> > <provide partnerLink="TestPartnerLink"> > <service name="tns:TestProvider" port="TestPort"/> > </provide> > <invoke partnerLink="LookupPracticeEndpointPartnerLink"> > <service name="lpe:LookupPracticeEndpointProvider" > port="LookupPracticeEndpointPort"/> > </invoke> > <invoke partnerLink="EchoServicePartnerLink"> > <service name="echo:EchoService" > port="EchoServiceSOAP11port_http"/> > </invoke> > </process> > </deploy> > > If anyone can see what im doing wrong id be very grateful some pointers > information as im certainly stuck! > > Thanks in advance, > Ian Harrigan > > (PS: sorry about the HUGE post!) >
