Hi  Eoghan,
I just tried placing Aegis xml mappings into the same concerned sevice 
package but in vain.

Creating an AegisDatabinding in PojoConfigurationTypeHandler this way is 
too frozen!

 if("jaxb".equals(dataBindingImpl)) {
          databinding = new JAXBDataBinding();
        } else {
          databinding = new AegisDatabinding();
        }


A pure osgi approach would be a nice dream. For instance, in this case, 
registering our own  Databinding instance  (currently Aegis or JAXB of 
course, with own configs as service  properties) as an osgi service so 
that  we can easily  manipulate beforehand and hook-listen to. Or pushing 
needed props into  ServiceImpl through its  (unused) method:

 public void setProperties(Map<String, Object> properties) {
        this.putAll(properties);
    }

Many thanks though.
Ahmed
Remainsoftware.com




From:
"Sergey Beryozkin" <[email protected]>
To:
"Sergey Beryozkin" <[email protected]>, <[email protected]>
Date:
22-07-2009 14:06
Subject:
Re: [DOSGi]"Could not determine how to read type" exception under DOSGi, 
How to solve?



By the way, Ahmed, can you try instead putting Aegis XML mappings file (as 
opposed to using Spring for configuring Aegis) into the 
same package where your service class is located ? The default Aegis 
context should probably find it

cheers, Sergey
----- Original Message ----- 
From: "Sergey Beryozkin" <[email protected]>
To: <[email protected]>
Sent: Wednesday, July 22, 2009 1:03 PM
Subject: Re: [DOSGi]"Could not determine how to read type" exception under 
DOSGi, How to solve?


> Hi Eoghan
>
> great catch - should we also get the bus from it, as well as 
conduit/transports ? One might want to use Spring DM to preconfigure 
> the default bus/etc ?
>
> cheers, Sergey
>
> ----- Original Message ----- 
> From: "Eoghan Glynn" <[email protected]>
> To: <[email protected]>
> Sent: Wednesday, July 22, 2009 12:44 PM
> Subject: Re: [DOSGi]"Could not determine how to read type" exception 
under DOSGi, How to solve?
>
>
> 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.
>>
>>
>>
>>
>>
>>
> 



Reply via email to