I'm not using the discovery service. I suppose, I have to set the property
in the OSGI-INF/remote-service/*.xml file, too. After doing that, I get an
exception on the client side:

10.09.2009 18:05:56
org.apache.cxf.service.factory.ReflectionServiceFactoryBean
buildServiceFromClass
INFO: Creating Service {http://interfaces.passobject/}PassObject from
class passobject.interfaces.PassObject
PassObject service found
10.09.2009 18:05:56 org.apache.cxf.phase.PhaseInterceptorChain doIntercept
WARNUNG: Interceptor has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Marshalling Error:
passobject.interfaces.MathHelper is not known to this context
        at
org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:159)
        at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:169)
        at
org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:105)
        at
org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68)
        at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:472)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:302)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254)
        at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
        at org.apache.cxf.frontend.ClientProxy.invoke(ClientProxy.java:68)
        at $Proxy34.passAnObject(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.apache.cxf.dosgi.dsw.handlers.ServiceInvocationHandler.invoke(ServiceInvocationHandler.java:59)
        at $Proxy34.passAnObject(Unknown Source)
        at passobject.client.Activator$1.addingService(Activator.java:21)
        at
org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:896)
        at
org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:261)
        at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:233)
        at
org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:840)
        at
org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:124)
        at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:930)
        at
org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:220)
        at
org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:149)
        at
org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:757)
        at
org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:712)
        at
org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:129)
        at
org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:206)
        at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:506)
        at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:524)
        at
org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook.proxifyMatchingInterface(AbstractClientHook.java:118)
        at
org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook.processNotification(AbstractClientHook.java:91)
        at
org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook$DiscoveryCallback.serviceChanged(AbstractClientHook.java:297)
        at
org.apache.cxf.dosgi.discovery.local.LocalDiscoveryService.triggerCallbacks(LocalDiscoveryService.java:340)
        at
org.apache.cxf.dosgi.discovery.local.LocalDiscoveryService.triggerCallbacks(LocalDiscoveryService.java:313)
        at
org.apache.cxf.dosgi.discovery.local.LocalDiscoveryService.addedServiceDescription(LocalDiscoveryService.java:152)
        at
org.apache.cxf.dosgi.discovery.local.LocalDiscoveryService.findDeclaredRemoteServices(LocalDiscoveryService.java:137)
        at
org.apache.cxf.dosgi.discovery.local.LocalDiscoveryService.bundleChanged(LocalDiscoveryService.java:111)
        at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:916)
        at
org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:220)
        at
org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:330)
Caused by: javax.xml.bind.MarshalException
 - with linked exception:
[javax.xml.bind.JAXBException: passobject.interfaces.MathHelper is not
known to this context]
        at 
com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:331)
        at
com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:257)
        at
javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:100)
        at
org.apache.cxf.jaxb.JAXBEncoderDecoder.writeObject(JAXBEncoderDecoder.java:444)
        at
org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:138)
        ... 42 more
Caused by: javax.xml.bind.JAXBException: passobject.interfaces.MathHelper
is not known to this context
        at
com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:242)
        at
com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:257)
        at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:143)
        at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:185)
        at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeBody(ElementBeanInfoImpl.java:305)
        at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:312)
        at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:71)
        at
com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:490)
        at 
com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:328)
        ... 46 more
Caused by: javax.xml.bind.JAXBException: passobject.interfaces.MathHelper
is not known to this context
        at
com.sun.xml.bind.v2.runtime.JAXBContextImpl.getBeanInfo(JAXBContextImpl.java:587)
        at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:140)
        ... 52 more


> This property must've been published by the discovery service, the logging
> on
> the server side should tell which properties have been published;  if
> you're
> not using the discovery service then the client-side properties should
> also
> include a databinding property...
>
> cheers, Sergey
>
>
> Saul Goode wrote:
>>
>> 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
>>
>>
>>
>>
>
> --
> View this message in context:
> http://www.nabble.com/-DOSGi--Server-side-proxy-doesn%27t-work-correctly-tp25365318p25383348.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>
> ____________________________________________________________________________________
> Introducing Branchr
> Super Simple Advertising
> http://click.lavabit.com/?pub=78&ad=0023&url=aHR0cDovL2JyYW5jaHIuY29tLw==
> ____________________________________________________________________________________
>



Reply via email to