Sergey Beryozkin wrote:
> Ok... Can you try to use JAXB ? in 1.1-SNAPSHOT, you can provide a
> property :
>
> 'org.apache.cxf.ws.databinding' with the value 'jaxb'. Add
> '@XmlRootElement'
> to MathHelperImpl, and you'll probably also need to import the
> javax.xml.bind.annotation.* to client/server bundles.
> If it will work then it will confirm it's an Aegis issue, if not then it
> will point to some other DOSGi issue.

Thanks for your help!

I tried this. I added @XmlRootElement on MathHelperImpl (and later also on
PassObjectImpl) and imported packages javax.xml.bind.annotation and
javax.xml.bind.annotation.adapters in both client and server bundles.

Unfortunately the server now throws an exception (see attachement) when
method passAnObject is called by the client. Thus it doesn't even get as
far as before.

Is it correct to set the databinding-property on the (PassObject) service
when registering? If so, how does the client know about the server using
JAXB?


Greetings,
Saul


Attached is the stacktrace for the exception thrown by the server:

org.apache.cxf.interceptor.Fault: Unmarshalling Error: unexpected element
(uri:"http://interfaces.passobject/";, local:"arg0"). Expected elements are
(none)
        at
org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:625)
10.09.2009 14:30:46 org.apache.cxf.phase.PhaseInterceptorChain doIntercept
WARNUNG: Interceptor has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Unmarshalling Error: unexpected element 
(uri:"http://interfaces.passobject/";, local:"arg0"). Expected elements are 
(none) 
        at 
org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:625)
        at 
org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:530)
        at org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:114)
        at 
org.apache.cxf.interceptor.DocLiteralInInterceptor.getPara(DocLiteralInInterceptor.java:240)
        at 
org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:117)
        at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
        at 
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:104)
        at 
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:302)
        at 
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:266)
        at 
org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
        at 
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
        at 
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)
        at 
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
        at org.mortbay.jetty.Server.handle(Server.java:324)
        at 
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
        at 
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
        at 
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
        at 
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
Caused by: javax.xml.bind.UnmarshalException
 - with linked exception:
[javax.xml.bind.UnmarshalException: unexpected element 
(uri:"http://interfaces.passobject/";, local:"arg0"). Expected elements are 
(none)]
        at 
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamException(UnmarshallerImpl.java:421)
        at 
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:360)
        at 
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:330)
        at 
org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:610)
        ... 20 more
Caused by: javax.xml.bind.UnmarshalException: unexpected element 
(uri:"http://interfaces.passobject/";, local:"arg0"). Expected elements are 
(none)
        at 
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:603)
        at 
com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:244)
        at 
com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:239)
        at 
com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildElement(Loader.java:116)
        at 
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext$DefaultRootLoader.childElement(UnmarshallingContext.java:1009)
        at 
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:446)
        at 
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:427)
        at 
com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleStartElement(StAXStreamConnector.java:275)
        at 
com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:209)
        at 
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:358)
        ... 22 more
Caused by: javax.xml.bind.UnmarshalException: unexpected element 
(uri:"http://interfaces.passobject/";, local:"arg0"). Expected elements are 
(none)
        ... 32 more


Reply via email to