users@jaxb.java.net

RE: Duplicate classes and schema types

From: Kevin and Louise . <kevin_pepper_at_hotmail.com>
Date: Wed, 12 Jan 2011 10:38:33 +0000

I can't see from the customisations how to do it other than perhaps through creating adapters which would be rather long-winded and not very elegant.
Do you know what customisation you used?
 
> From: xavier_at_wflogistics.com
> To: users_at_jaxb.java.net
> Subject: Re: Duplicate classes and schema types
> Date: Tue, 11 Jan 2011 10:21:41 -0600
>
> On Mar 11 Ene 2011 10:10:47 Kevin and Louise . escribió:
> > Hi,
> >
> > I have a number of schemas that include some common types - hence when I
> > run xjc on them I get the same classes repeated in different packages. If
> > I run the compilation on all schemas at once xjc complains about duplicate
> > classes. If I pull them all out into a common.xsd schema and include that
> > in the others then I think that would solve the problem but I would like
> > to avoid changing the schemas if possible. Anyone know of a good way to
> > provide a generic interface to these duplicate generated classes that
> > doesn't involve schema changes/editing the classes? Or a way of only
> > generating one of each duplicated type?
> > Cheers.
>
> You could use JAXB customizing:
>
> http://download.oracle.com/docs/cd/E17802_01/webservices/webservices/docs/1.5/tutorial/doc/JAXBUsing4.html
>
> I have used this when I do not want to duplicate the model classes, too. For
> example, I have a .jar containing JPA entity classes that I will use also in
> the client, I use the same .jar in the server but also in the client, I must
> tell, for example, to JAX-WS to use the existing classes when compiling a web
> server client.
>
> I have not done this in a while so I cannot tell you in more details.
>
> Regards.
>
> Xavier.