I added @XmlSeeAlso(MathHelper.class) to MathHelperImpl and vice versa
with no success.

And i tried to set the osgi.remote.interfaces-property to
"passobject.interfaces.PassObject" instead of "*" on the remote service
and in the OSGI-INF/remote-service/*.xml-file. Unfortunately this didn't
change nything, too. (Did you mean this by "You may need to limit the
support for PathObject interface only"?)

But I tried something different. Instead of using the interface type
MathHelper to declare the method argument, I directly used MathHelperImpl.
The remote service interface now looks like this:

public interface PassObject {
    public void passAnObject(MathHelperImpl helper);
    // instead of: public void passAnObject(MathHelper helper);
}

Moreover I moved the package containing MathHelperImpl into the interface
bundle (PassObjectInterface) which is installed on the server and the
client.

Now it works with both JAXB and Aegis. Well, Aegis complains about a
missing setter (as you already suggested), which I had to add to get it
working.

Thus the problem are arguments in a remote service, which are of an
interface type. Somehow DOSGi can't resolve their type or sth like that.


Greetings,
Saul


Sergey Beryozkin wrote:
> It appears there's some progress anyway. It's a JAXB-specific issue now.
> You
> can probably add @XmlSeeAlso(MathHelper.class) to MathHelperImpl.class or
> tell JAXB to ignore MathHelper alltogether (not sure how...). Now, another
> thing to check is : do you allow for all services be handled by DOSGi on
> the
> server side ? If yes then may be DOSGi does indeed tries to create a proxy
> on MathHelper...You may need to limit the support for PathObject interface
> only...
>
> Sergey
>
>
> Saul Goode wrote:
>> 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)
>> [...]
>>
>>
>> Sergey Beryozkin wrote:
>>> 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==
>>> ____________________________________________________________________________________
>>>
>>
>>
>>
>>
>>
>
> --
> View this message in context:
> http://www.nabble.com/-DOSGi--Server-side-proxy-doesn%27t-work-correctly-tp25365318p25387009.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