users@jaxb.java.net

Re: jaxb1.0 -> 1.0.1 Cannot compile several schemas with same simpleType

From: Ed Mooney <Ed.Mooney_at_sun.com>
Date: Thu, 19 Jun 2003 16:22:44 -0400

Hi Yakov,

This indicates a name collision that you can fix with an external
binding customization. Search subjects in the archive for "Name
collisions" and have a look at samples/external-customize. That you
didn't see this in JAXB 1.0 was due to a bug, if I remember correctly.

Regards,
--
Ed Mooney         |Sun Microsystems, Inc.|Time flies like
Java Web Services |UBUR02-201            |an arrow, but
Ed.Mooney_at_Sun.COM |1 Network Drive       |fruit flies like
781-442-0459      |Burlington, MA  01803 |a banana. Groucho
Yakov Polonsky wrote:
> Hi,
> One more unexpected behavior change during migration:
>
> I have several schemas with the same <simpleType> in each of them:
>
> <xs:simpleType name="rth_xml_vdouble">
>    <xs:restriction base="xs:string" >
>             ...
>    </xs:restriction>
> </xs:simpleType>
>
> xjc 1.0 compiles everything successfully, creating a single copy of the generated class RthXmlVDouble.java
> xjc 1.0.1 cannot handle it anymore.  It throws errors and does not generate java files.
> The errors look like this:
>
> [ERROR] 'rth_xml_vdouble' is already defined
>   line 58 of Batch.xsd
>
> [ERROR] (related to above error) the first definition appears here
>   line 119 of AG-FolderTree.xsd
>    .....
>
> Is there any workaround (like undocumented command option) ?  Why does it prevent me to generate java files if the simpleType structure is the same in all schema files
>
> I cannot change schema files (like to take out the same type into the separate schema) because other product generates them.
>
> Any suggestions?
> Thanks