Hi Ahmed, The problem is that dOSGi just just news up a fresh Aegis or JAXB databinding instance (the type depending on a property), instead of using a spring-loaded databinding if available. See [1] for the context. We could I guess just grab the injected databinding from the Bus ApplicationContext instead.
Please raise a JIRA for this. Cheers, Eoghan [1] http://svn.apache.org/repos/asf/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandler.java 2009/7/22 <[email protected]>: > I'm stuck with this problem. Please help. > > To make it short: > > Given the following method in a published service interface: > > Object getResult(); > > and a service implementation and some class Foo: > > public Object getResult(){ > return new Foo(); > } > > > When the remote consumer tries calling getResult via the service proxy it > gets this akin exception: > org.apache.cxf.interceptor.Fault: Could not determine how to read type: > {..some qname..} Foo > > > I tried to let aegis know about the extra type (Foo) customizing the > AegisConext object by putting the following code in > my_bundle/META-INF/spring/context.xml: > > <?xml version="1.0" encoding="UTF-8"?> > > <beans xmlns="http://www.springframework.org/schema/beans" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:context="http://www.springframework.org/schema/context" > xmlns:cxf="http://cxf.apache.org/core" xmlns:jaxws=" > http://cxf.apache.org/jaxws" > xsi:schemaLocation="http://www.springframework.org/schema/beans > http://www.springframework.org/schema/beans/spring-beans-2.5.xsd > http://www.springframework.org/schema/context > > http://www.springframework.org/schema/context/spring-context-2.5.xsd > http://cxf.apache.org/core > http://cxf.apache.org/schemas/core.xsd > http://cxf.apache.org/jaxws > http://cxf.apache.org/schemas/jaxws.xsd" > default-autowire="byName"> > <import resource="classpath:META-INF/cxf/cxf.xml" /> > <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" > /> > <import resource="classpath:META-INF/cxf/cxf-servlet.xml" /> > > <bean id="aegisDatabinding" > class="org.apache.cxf.aegis.databinding.AegisDatabinding"> > <property name="aegisContext"> > <bean class="org.apache.cxf.aegis.AegisContext"> > <property name="writeXsiTypes" > value="true" /> > <property name="rootClassNames"> > <set> > <value>some.package.Foo</value> > > </set> > </property> > </bean> > </property> > </bean> > </beans> > > When debugging it seems this is picked up by spring, so an AegisContext > object is instantiated with the good values of writeXsiTypes and > rootClassNames props. Yet another instance of AegisDatabinding with the > "wrong" AegisContext is created, bound to my service then used when the > remote consumer is interacting with my osgi service through the proxy! > > Is this the right way to solve such problems under DOSGi? if so what am I > doing wrong? > > Please help, we're initially stuck at this very point while integrating > DOSGi with our osgi app. > > > - We are using DOSGi snapshot 1.1 with zooKeeper based discovery. > - The only point our osgi app comes in touch with Spring or cxf > webservices is through DOSGi. > - I didn't change any xml file in the META-INF/cxf/ of the Snapshot DSW. > > Any help is kindly appreciated :) > Many thanks. > > > > > >
