users@jaxb.java.net

Re: _at_XmlRootElement disappearing

From: Rick Blair <rick.blair_at_boeing.com>
Date: Tue, 02 Oct 2007 08:51:43 -0700

Hi all,

The question is why is the @XmlRootElement annotation not being placed on
the element. I had a similar problem and found it has to do with how I
defined types in my xsd. If I had an xsd file that had both elements and
type definitions, then none of the elements had the @XmlRootElement
annotation. However, if I changed the elements to use inline(anonymous)
definitions, then they would get the annotation.

I found the following article helpful:


http://weblogs.java.net/blog/kohsuke/archive/2006/03/index.html

Go like 5 pages down, the title "Why does JAXB put @XmlRootElement sometimes
but not always?".

There is also an entry near the top using the -extension flag on xcj that
builds on it.


Cheers

Rick



On 10/2/07 3:24 AM, "Guilhem Legal" <legal.g_at_hotmail.fr> wrote:

>
>
> I'm not sure of that. I m gone explain better what i did.
> after generated my classes with xjc, i put all of them in a .jar.
>
> then the Jax WS webservice have the jar and use it for his operations.
> so the webService create some xsl FROM my classes in the jar ( There is
> where i can be wrong).
> and after the webservice client recreate the classes from the xsl generate
> par the WS.
> so if i'm not wrong my @XmlRootElement don't have to disappear.
>
> as a proof when i modify my classe by changing the type of an attribute for
> example this works.
> it's only the who disappear
>
> Guilhem Legal
>
>
>
> Aleksei Valikov wrote:
>>
>>
>> The classes are all generated anew. JAXB schema compiler does not
>> consider changes made to the source code of the generated classes
>> since this is way too complex.
>>
>> So if you generate classes, modify them and generate them again, all
>> your modifications are gone. Quite naturally.
>>
>> Bye.
>> /lexi
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
>> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>>
>>
>>