You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "G.Long" <jd...@gmail.com> on 2013/04/30 09:48:44 UTC

can't unmarshal an EObject from EMF

Hi :)

I'm trying to use a webservice generated with CXF 2.5. The methods of my 
webservice take an EObject as parameter. The problem is that I always 
get the following error:

javax.xml.ws.soap.SOAPFaultException: Unmarshalling Error: Unable to 
create an instance of xxx.yyy.myObjectImpl...

my model is :

(interface) myObject > (abstract class) myObjectImpl > (class) myPObjectImpl

I read a lot of topics about jaxb and annotations (using @XmlSeeAlso, 
@XmlRootElement) but I didn't find the right solution :/

Currently, my interface has the following annotation: 
@XmlJavaTypeAdapter(myObjectImplAdapter.class).
My abstract class has :

@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement
@XmlType(name = "myObjectImpl")

And the webservice interface has : @XmlSeeAlso({myObjectImpl.class,...})

I don't know if there is something to do with the class myPObjectImpl...

Is anything wrong with these annotations? I would like my webservice to 
use only objects of type myObject.

Thank you :)




Re: can't unmarshal an EObject from EMF

Posted by "G.Long" <jd...@gmail.com>.
hi :)

No it hasn't because it's an abstract class.

Le 02/05/2013 07:25, Freeman Fang a écrit :
> Hi,
>
> Does xxx.yyy.myObjectImpl has a default constructor?
> -------------
> Freeman(Yue) Fang
>
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Web: http://fusesource.com | http://www.redhat.com/
> Twitter: freemanfang
> Blog: http://freemanfang.blogspot.com
> http://blog.sina.com.cn/u/1473905042
> weibo: @Freeman小屋
>
> On 2013-4-30, at 下午3:48, G.Long wrote:
>
>> Hi :)
>>
>> I'm trying to use a webservice generated with CXF 2.5. The methods of my webservice take an EObject as parameter. The problem is that I always get the following error:
>>
>> javax.xml.ws.soap.SOAPFaultException: Unmarshalling Error: Unable to create an instance of xxx.yyy.myObjectImpl...
>>
>> my model is :
>>
>> (interface) myObject > (abstract class) myObjectImpl > (class) myPObjectImpl
>>
>> I read a lot of topics about jaxb and annotations (using @XmlSeeAlso, @XmlRootElement) but I didn't find the right solution :/
>>
>> Currently, my interface has the following annotation: @XmlJavaTypeAdapter(myObjectImplAdapter.class).
>> My abstract class has :
>>
>> @XmlAccessorType(XmlAccessType.FIELD)
>> @XmlRootElement
>> @XmlType(name = "myObjectImpl")
>>
>> And the webservice interface has : @XmlSeeAlso({myObjectImpl.class,...})
>>
>> I don't know if there is something to do with the class myPObjectImpl...
>>
>> Is anything wrong with these annotations? I would like my webservice to use only objects of type myObject.
>>
>> Thank you :)
>>
>>
>>
>


Re: can't unmarshal an EObject from EMF

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

Does xxx.yyy.myObjectImpl has a default constructor?
-------------
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋

On 2013-4-30, at 下午3:48, G.Long wrote:

> Hi :)
> 
> I'm trying to use a webservice generated with CXF 2.5. The methods of my webservice take an EObject as parameter. The problem is that I always get the following error:
> 
> javax.xml.ws.soap.SOAPFaultException: Unmarshalling Error: Unable to create an instance of xxx.yyy.myObjectImpl...
> 
> my model is :
> 
> (interface) myObject > (abstract class) myObjectImpl > (class) myPObjectImpl
> 
> I read a lot of topics about jaxb and annotations (using @XmlSeeAlso, @XmlRootElement) but I didn't find the right solution :/
> 
> Currently, my interface has the following annotation: @XmlJavaTypeAdapter(myObjectImplAdapter.class).
> My abstract class has :
> 
> @XmlAccessorType(XmlAccessType.FIELD)
> @XmlRootElement
> @XmlType(name = "myObjectImpl")
> 
> And the webservice interface has : @XmlSeeAlso({myObjectImpl.class,...})
> 
> I don't know if there is something to do with the class myPObjectImpl...
> 
> Is anything wrong with these annotations? I would like my webservice to use only objects of type myObject.
> 
> Thank you :)
> 
> 
> 


Re: can't unmarshal an EObject from EMF

Posted by Daniel Kulp <dk...@apache.org>.
On Apr 30, 2013, at 3:48 AM, G.Long <jd...@gmail.com> wrote:

> Hi :)
> 
> I'm trying to use a webservice generated with CXF 2.5. The methods of my webservice take an EObject as parameter. The problem is that I always get the following error:
> 
> javax.xml.ws.soap.SOAPFaultException: Unmarshalling Error: Unable to create an instance of xxx.yyy.myObjectImpl...
> 
> my model is :
> 
> (interface) myObject > (abstract class) myObjectImpl > (class) myPObjectImpl
> 
> I read a lot of topics about jaxb and annotations (using @XmlSeeAlso, @XmlRootElement) but I didn't find the right solution :/
> 
> Currently, my interface has the following annotation: @XmlJavaTypeAdapter(myObjectImplAdapter.class).

I don't think that should be on the interface.   I believe that needs to be on the parameter itself or on the method itself is used as a return type.

Dan



> My abstract class has :
> 
> @XmlAccessorType(XmlAccessType.FIELD)
> @XmlRootElement
> @XmlType(name = "myObjectImpl")
> 
> And the webservice interface has : @XmlSeeAlso({myObjectImpl.class,...})
> 
> I don't know if there is something to do with the class myPObjectImpl...
> 
> Is anything wrong with these annotations? I would like my webservice to use only objects of type myObject.
> 
> Thank you :)
> 
> 
> 

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com