You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Eoghan Glynn <eo...@gmail.com> on 2009/07/22 13:44:41 UTC

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  <ah...@remainsoftware.com>:
> 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.
>
>
>
>
>
>

Re: [DOSGi]"Could not determine how to read type" exception under DOSGi, How to solve?

Posted by Sergey Beryozkin <sb...@progress.com>.
Hi Eoghan



> Hi Sergey,
>
>> should we also get the bus from it, as well as conduit/transports
>
> Wouldn't we already need to have a reference to the bus, probably just
> the default bus, in order to call
> Bus.getExtension(ApplicationContext.class)?
>
> Or is there a more direct way of grabbing this application context?

I don't remember. May be Spring DM has some utility class which can return the context given the calling/application BundleContext ?

>
> On the conduit issue, there would be the potential for inferring with
> the normal mechanism for setting the conduit configuration via the
> intents map.

Adding custom intents is one way to go - but I feel it would a bit restricting to ask users to always do it. I'd rather drop the 
existing beans.xml which sets the default bus interceptors, http:conduit/transport, etc into MTEA-INF/spring and be done with it 
:-), unless I do want the consuming bundle to know about these configurations....I feel it won't contradict the DOSGI intents 
approach

Cheers, Sergey


>
> Cheers,
> Eoghan
>
> 2009/7/22 Sergey Beryozkin <sb...@progress.com>:
>> 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" <eo...@gmail.com>
>> To: <us...@cxf.apache.org>
>> 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  <ah...@remainsoftware.com>:
>>>
>>> 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.
>>>
>>>
>>>
>>>
>>>
>>>
>>
>> 


Re: [DOSGi]"Could not determine how to read type" exception under DOSGi, How to solve?

Posted by Eoghan Glynn <eo...@gmail.com>.
Hi Sergey,

> should we also get the bus from it, as well as conduit/transports

Wouldn't we already need to have a reference to the bus, probably just
the default bus, in order to call
Bus.getExtension(ApplicationContext.class)?

Or is there a more direct way of grabbing this application context?

On the conduit issue, there would be the potential for inferring with
the normal mechanism for setting the conduit configuration via the
intents map.

Cheers,
Eoghan

2009/7/22 Sergey Beryozkin <sb...@progress.com>:
> 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" <eo...@gmail.com>
> To: <us...@cxf.apache.org>
> 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  <ah...@remainsoftware.com>:
>>
>> 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.
>>
>>
>>
>>
>>
>>
>
>

Re: [DOSGi]"Could not determine how to read type" exception under DOSGi, How to solve?

Posted by Sergey Beryozkin <sb...@progress.com>.
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" <eo...@gmail.com>
To: <us...@cxf.apache.org>
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  <ah...@remainsoftware.com>:
> 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.
>
>
>
>
>
>