users@jaxb.java.net

Re: xjc on windows emits bogus Type is already defined errors

From: William Simons <william.simons_at_childrens.harvard.edu>
Date: Mon, 19 Dec 2005 15:39:49 -0500

Hey Chris,

I had a similar problem and worked around it by excluding the schemas that I
import. For example, if you import schema B into schema A, you would use
the "exclude" element in the xjc ant task to exclude schema B.

The source for schema B will still be generated during the import.

Not sure why its working on one and not the other...

Bill


On 12/19/05 3:35 PM, "Christoph Sturm" <christoph.sturm_at_gmail.com> wrote:

> Hey people!
>
> I have a strange problem with xjc. It works perfectly on unix and mac
> osx, but when i try to build on windows i get a lot of errormessages
> saying "xxxType" is already defined.
>
> this is how my xjc task looks like:
>
> <xjc target="target/xjc" package="blabla" extension="true">
> <schema dir="xsd">
> <include name="*.xsd"/>
> </schema>
> </xjc>
>
> It seems that the problems happens like this:
> one schema file imports the namespace of another schemafile, and that
> makes xjc load the imported schema file. Later when it processes the
> file that was imported by the other file it parses it again, and finds
> all types already defined, and thats why it outputs the error.
>
> These schema files compile fine with the xmlbeans 2 compiler. and they
> compile fine with xjc on unix. Just on windows i get this nasty error.
> Any idea what i can do to avoid this?
>
> thanks
> chris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>