users@jaxb.java.net

Re: nor any of its super class is known to this context ..problem...

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Wed, 22 Nov 2006 14:11:24 -0800

Meir Yanovich wrote:
> hi all
>
> i have simple complex object in jave that looks like this :
>
>
> @XmlAccessorType(XmlAccessType.FIELD)
> public class MyID{
> @XmlAttribute
> public short dbnum = (short)0;
> @XmlAttribute
> public short usernum= (short)0;
> @XmlAttribute
> public long userid = (long)0;
>
> public MyId(){
> }
> }
>
> i converted it with jaxb and it generete me corespanding java object
> with the propreate geters and seters
> now when i try to in the server side to insert this object into
> List<Object> im geting error saing :
> ......
> .....
> .....
> Caused by: javax.xml.bind.JAXBException:
> com.WebServices.datastructures.MyID nor any of its super class is known
> to this context
> at
> com.sun.xml.bind.v2.runtime.JAXBContextImpl.getBeanInfo(JAXBContextImpl.
> java:474)
> at
> com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.j
> ava:557)
> .. 47 more

The error message says it all, really. The JAXBContext is not created
with MyID class.

How do you create JAXBContext?

>
>
>
> i must say that if i send back only this object (MyID) the unmarsheling
> passed successfully


-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com