Freeman,
I was using smx 3.2.3 earlier, just tried it with 3.2.1 and I get a different error.

ERROR - CxfSeComponent                 - Error processing exchange InOut[
 id: ID:192.168.2.79-11f360dcc63-12:0
 status: Active
 role: provider
 service: {http://example.com/exampleService}ExampleService
 endpoint: ExampleServicePort
 operation: {http://example.com/exampleService}sayHello
in: <?xml version="1.0" encoding="UTF-8"?><jbi:message xmlns:jbi="http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper"; xmlns:msg="http://example.com/exampleService"; name="sayHello" type="msg:sayHello" version="1.0"><jbi:part><exam:sayHello xmlns:exam="http://example.com/exampleService";>
        <!--Optional:-->
        <arg0>qw</arg0>
     </exam:sayHello></jbi:part></jbi:message>
]
java.lang.NullPointerException
at org.apache.servicemix.cxfse.CxfSeEndpoint.process(CxfSeEndpoint.java:180) at org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:538) at org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:490) at org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLifeCycle.java:46) at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610) at org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:170) at org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:167) at org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134) 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)

smx 3.2.1writes to the log as well.

Sylvester

Freeman Fang wrote:
Sylvester wrote:
Nothing in the servicemix.log file, but it shows me this big stacktrace:

Feb 2, 2009 1:26:42 PM org.apache.cxf.transport.jbi.JBITransportFactory setDeliv
eryChannel
INFO: configuring DeliveryChannel: org.apache.servicemix.common.EndpointDel
iverychan...@f45ec3
Feb 2, 2009 1:26:42 PM org.apache.cxf.phase.PhaseInterceptorChain doIntercept
INFO: Interceptor has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Unmarshalling Error: unexpected element (uri:"
http://example.com/exampleService";, local:"blah"). Expected elem
ents are (none)
at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.
java:631)
at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.
java:532)
at org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:40) at org.apache.cxf.binding.jbi.interceptor.JBIWrapperInInterceptor.handle
Message(JBIWrapperInInterceptor.java:124)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercept
orChain.java:220)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainIniti
ationObserver.java:77)
at org.apache.cxf.transport.jbi.JBIDispatcherUtil.dispatch(JBIDispatcher
Util.java:156)
at org.apache.servicemix.cxfse.CxfSeEndpoint.process(CxfSeEndpoint.java:
284)
at org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLi
feCycle.java:538)
at org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(Async
BaseLifeCycle.java:490)
at org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLife
Cycle.java:46)
at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBoun
d(DeliveryChannelImpl.java:620)
at org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlo
w.java:172)
at org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.j
ava:167)
at org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.jav
a:134)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:675)
       at java.lang.Thread.run(Thread.java:595)
Caused by: javax.xml.bind.UnmarshalException
- with linked exception:
[javax.xml.bind.UnmarshalException: unexpected element (uri:"http://example.com/
exampleService", local:"blah"). Expected elements are (none)]
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStrea
mException(UnmarshallerImpl.java:400)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(
UnmarshallerImpl.java:339)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(U
nmarshallerImpl.java:309)
at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.
java:616)
       ... 17 more
Caused by: javax.xml.bind.UnmarshalException: unexpected element (uri:"http://ex
ample.com/exampleService", local:"blah"). Expected elements are
(none)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleE
vent(UnmarshallingContext.java:525)
at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.ja
va:199)
at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.ja
va:194)
at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChild
Element(Loader.java:71)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext$Default
RootLoader.childElement(UnmarshallingContext.java:922)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startE
lement(UnmarshallingContext.java:366)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startEl
ement(UnmarshallingContext.java:347)
at com.sun.xml.bind.v2.runtime.unmarshaller.InterningXmlVisitor.startEle
ment(InterningXmlVisitor.java:35)
at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleSt
artElement(StAXStreamConnector.java:201)
at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(S
tAXStreamConnector.java:135)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(
UnmarshallerImpl.java:337)
       ... 19 more
Caused by: javax.xml.bind.UnmarshalException: unexpected element (uri:"http://ex
ample.com/exampleService", local:"blah"). Expected elements are
(none)
       ... 30 more
Feb 2, 2009 1:26:42 PM org.apache.cxf.phase.PhaseInterceptorChain doIntercept
INFO: Interceptor has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Unmarshalling Error: unexpected element (uri:"
http://example.com/exampleService";, local:"blah"). Expected elem
ents are (none)
at org.apache.servicemix.cxfbc.CxfBcConsumer$JbiPostInvokerInterceptor.h
andleMessage(CxfBcConsumer.java:626)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercept
orChain.java:220)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainIniti
ationObserver.java:77)
at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceReque
st(JettyHTTPDestination.java:278)
at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(Je
ttyHTTPDestination.java:252)
at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTP
Handler.java:70)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:7
57)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHand
lerCollection.java:206)
at org.mortbay.jetty.handler.HandlerList.handle(HandlerList.java:49) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:1
52)
       at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:50
2)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnectio
n.java:840)
       at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:657)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:377) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.ja
va:409)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.j
ava:497)
Caused by: org.apache.cxf.interceptor.Fault: Unmarshalling Error: unexpected ele
ment (uri:"http://example.com/exampleService";, local:"blah"). Ex
pected elements are (none)
at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.
java:631)
at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.
java:532)
at org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:40) at org.apache.cxf.binding.jbi.interceptor.JBIWrapperInInterceptor.handle
Message(JBIWrapperInInterceptor.java:124)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercept
orChain.java:220)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainIniti
ationObserver.java:77)
at org.apache.cxf.transport.jbi.JBIDispatcherUtil.dispatch(JBIDispatcher
Util.java:156)
at org.apache.servicemix.cxfse.CxfSeEndpoint.process(CxfSeEndpoint.java:
284)
at org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLi
feCycle.java:538)
at org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(Async
BaseLifeCycle.java:490)
at org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLife
Cycle.java:46)
at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBoun
d(DeliveryChannelImpl.java:620)
at org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlo
w.java:172)
at org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.j
ava:167)
at org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.jav
a:134)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:675)
       at java.lang.Thread.run(Thread.java:595)
Caused by: javax.xml.bind.UnmarshalException
- with linked exception:
[javax.xml.bind.UnmarshalException: unexpected element (uri:"http://example.com/
exampleService", local:"blah"). Expected elements are (none)]
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStrea
mException(UnmarshallerImpl.java:400)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(
UnmarshallerImpl.java:339)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(U
nmarshallerImpl.java:309)
at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.
java:616)
       ... 17 more
Caused by: javax.xml.bind.UnmarshalException: unexpected element (uri:"http://ex
ample.com/exampleService", local:"blah"). Expected elements are
(none)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleE
vent(UnmarshallingContext.java:525)
at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.ja
va:199)
at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.ja
va:194)
at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChild
Element(Loader.java:71)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext$Default
RootLoader.childElement(UnmarshallingContext.java:922)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startE
lement(UnmarshallingContext.java:366)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startEl
ement(UnmarshallingContext.java:347)
at com.sun.xml.bind.v2.runtime.unmarshaller.InterningXmlVisitor.startEle
ment(InterningXmlVisitor.java:35)
at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleSt
artElement(StAXStreamConnector.java:201)
at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(S
tAXStreamConnector.java:135)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(
UnmarshallerImpl.java:337)
       ... 19 more
Caused by: javax.xml.bind.UnmarshalException: unexpected element (uri:"http://ex
ample.com/exampleService", local:"blah"). Expected elements are
(none)
       ... 30 more


Sylvester

Freeman Fang wrote:
Any exception you get from the log also?
Freeman

Sylvester wrote:
Hi,
Well I managed to figure this one out. In the @Webservice tag I was using (maven generated this, but it doesn't work) name= "blah" I just changed it to serviceName= "blah" and this error went away. However I am still stuck. I can deploy the service etc. but when I send a message I get:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
  <soap:Body>
     <soap:Fault>
        <faultcode>soap:Server</faultcode>
<faultstring>Unmarshalling Error: unexpected element (uri:"http://example.com/exampleService";, local:"sayHello"). Expected elements are (none)</faultstring>
     </soap:Fault>
  </soap:Body>
</soap:Envelope>

and the class which gets invoked is:

You said you set the serviceName as "blah", but here in the annotation it's serviceName = "ExampleService", I'm confused, do I miss sometthing?

@WebService(serviceName = "ExampleService", targetNamespace = "http://example.com/exampleService";)
public class ExampleService {

   @WebMethod
   public String sayHello(String name) {
       return "Hello "+name;
   }
}

I generated the wsdl using the java2ws tool that comes with cxf. The wsdl is:


<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="ExampleService"
   targetNamespace="http://example.com/exampleService";
   xmlns:tns="http://example.com/exampleService";
   xmlns:xsd="http://www.w3.org/2001/XMLSchema";
   xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
   xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";>
   <wsdl:types>
       <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
           xmlns:tns="http://example.com/exampleService";
attributeFormDefault="unqualified" elementFormDefault="unqualified"
           targetNamespace="http://example.com/exampleService";>
           <xs:element name="sayHello" type="tns:sayHello" />
           <xs:element name="sayHelloResponse"
               type="tns:sayHelloResponse" />
           <xs:complexType name="sayHello">
               <xs:sequence>
                   <xs:element minOccurs="0" name="arg0"
                       type="xs:string" />
               </xs:sequence>
           </xs:complexType>
           <xs:complexType name="sayHelloResponse">
               <xs:sequence>
                   <xs:element minOccurs="0" name="return"
                       type="xs:string" />
               </xs:sequence>
           </xs:complexType>
       </xs:schema>
   </wsdl:types>
   <wsdl:message name="sayHelloResponse">
       <wsdl:part name="parameters" element="tns:sayHelloResponse">
       </wsdl:part>
   </wsdl:message>
   <wsdl:message name="sayHello">
<wsdl:part name="parameters" element="tns:sayHello"></wsdl:part>
   </wsdl:message>
   <wsdl:portType name="ExampleService">
       <wsdl:operation name="sayHello">
           <wsdl:input name="sayHello" message="tns:sayHello">
           </wsdl:input>
           <wsdl:output name="sayHelloResponse"
               message="tns:sayHelloResponse">
           </wsdl:output>
       </wsdl:operation>
   </wsdl:portType>
   <wsdl:binding name="ExampleServiceSoapBinding"
       type="tns:ExampleService">
       <soap:binding style="document"
           transport="http://schemas.xmlsoap.org/soap/http"; />
       <wsdl:operation name="sayHello">
           <soap:operation soapAction="" style="document" />
           <wsdl:input name="sayHello">
               <soap:body use="literal" />
           </wsdl:input>
           <wsdl:output name="sayHelloResponse">
               <soap:body use="literal" />
           </wsdl:output>
       </wsdl:operation>
   </wsdl:binding>
   <wsdl:service name="ExampleService">
       <wsdl:port name="ExampleServicePort"
           binding="tns:ExampleServiceSoapBinding">
           <soap:address
               location="http://localhost:9090/ExampleServicePort"; />
       </wsdl:port>
   </wsdl:service>
</wsdl:definitions>

Adding operation name or web param etc didn't help either.

Thanks,
Sylvester


Freeman Fang wrote:
Hi,

Would you append your wsdl also?
Freeman

Sylvester wrote:
Hi,
I've run into a problem with CXF today. I have a CXF BC communicating with a CXF SE. No problem building and deploying. I can see the wsdl in the browser as well. I am using smx 3.2.3 for this.

My cxf bc xbean is:

beans xmlns="http://www.springframework.org/schema/beans";
   xmlns:cxfbc="http://servicemix.apache.org/cxfbc/1.0";
   xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance";
   xmlns:myservice="http://example.com/exampleService";
xsi:schemaLocation="http://servicemix.apache.org/cxfbc/1.0 http://servicemix.apache.org/schema/servicemix-cxfbc-3.2.3.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd";>

   <cxfbc:consumer wsdl="classpath:service.wsdl"
       targetService="myservice:ExampleService" />

</beans>

CXF se xbean:

<beans xmlns:cxfse="http://servicemix.apache.org/cxfse/1.0";
      xmlns="http://www.springframework.org/schema/beans";
      xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://servicemix.apache.org/cxfse/1.0 http://servicemix.apache.org/schema/servicemix-cxfse-3.2.3.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd";>

   <cxfse:endpoint>
       <cxfse:pojo>
         <bean class="com.ExampleService" />
       </cxfse:pojo>
   </cxfse:endpoint>

</beans>
and com.ExampleService is annotated as:

@WebService(name = "ExampleService", targetNamespace = "http://example.com/exampleService";)
public class ExampleService {

   @WebMethod
public String getHighLevelBusinessFlow (String CIId, String StateId){
...
}

I generated the wsdl using the .class file from the target folder of my SE with the java2ws utility that came with my CXF 2.1.3.

The response to my soap request is like:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
  <soap:Body>
     <soap:Fault>
        <faultcode>soap:Server</faultcode>
<faultstring><![CDATA[Could not find route for exchange: InOut[
 id: ID:blah-blah-
 status: Active
 role: provider
 service: {http://example.com/exampleService}ExampleService
operation: {http://example.com/exampleService}getHighLevelBusinessFlow in: <?xml version="1.0" encoding="UTF-8"?><jbi:message xmlns:jbi="http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper"; xmlns:msg="http://example.com/exampleService"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; name="getHighLevelBusinessFlow" type="msg:getHighLevelBusinessFlow" version="1.0"><jbi:part><exam:getHighLevelBusinessFlow xmlns:exam="http://example.com/exampleService";>
        <!--Optional:-->
        <arg0 xmlns="">1</arg0>
        <!--Optional:-->
        <arg1 xmlns="">2</arg1>
     </exam:getHighLevelBusinessFlow></jbi:part></jbi:message>
] for service: {http://example.com/exampleService}ExampleService and interface: null]]></faultstring>
     </soap:Fault>
  </soap:Body>
</soap:Envelope>

I see:

] for service: {http://example.com/exampleService}ExampleService and interface:
null
at org.apache.servicemix.cxfbc.CxfBcConsumer$JbiInvokerInterceptor.handl
eMessage(CxfBcConsumer.java:608)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercept
orChain.java:220)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainIniti
ationObserver.java:77)
at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceReque
st(JettyHTTPDestination.java:278)
at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(Je
ttyHTTPDestination.java:252)

and the log has:
qtp0-0 | DefaultBroker | rvicemix.jbi.nmr.DefaultBroker 344 | ServiceName ({http://example.com/exampleService}ExampleService) specified for routing, but can't find it registered

I tried changing the targetNamespace and the name but that didn't work either. What could be going wrong?

Thanks,
Sylvester











Reply via email to