The Source for Java Technology Collaboration

Home » java.net Forums » GlassFish » Metro and JAXB

Thread: Problem with inheritance

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 1 - Last Post: Jun 11, 2009 4:07 AM by: aitdx
aitdx

Posts: 2
Problem with inheritance
Posted: Jun 11, 2009 3:55 AM
  Click to reply to this thread Reply

Hi

I use Glassfish and metro for cretating a web service. My problem is that two classes (LegalEntity and NaturalPerson) extends a abstrac class Person. When metro generates the wsdl, the Person's class is referenced but the others (Natural and Legal) not.

When I execute a find method, I get the following error:

[java] Exception in thread "main" com.sun.xml.ws.encoding.soap.DeserializationException: Failed to read a response: javax.xml.bind.UnmarshalException
[java] - with linked exception:
[java] [javax.xml.bind.UnmarshalException: Unable to create an instance of es.corunet.facturgal.client.Person
[java] - with linked exception:

It's true, becouse Peson is abstract.

Any, idea??

Thanks

aitdx

Posts: 2
Re: Problem with inheritance
Posted: Jun 11, 2009 4:06 AM   in response to: aitdx
  Click to reply to this thread Reply

I answered myself:

I have to use:

@WebService
@XmlSeeAlso({LegalEntity.class,NaturalPerson.class})

Thanks

Message was edited by: aitdx




 XML java.net RSS