users@jaxb.java.net

Re: Circular Reference Error?

From: Wolfgang Laun <wolfgang.laun_at_gmail.com>
Date: Tue, 28 Oct 2008 14:23:36 +0100

FWIW, I couldn't reproduce this error with xjc bundled with Java 1.6 or
the one with an older JAXB release. What's the JAXB version you're using?

Line 14 is the last line in LibraryCard.xsd, and that's obviously when the
compiler
does some consistency checks. If that's an old xjc version, then it was bug,
long since
gone, that didn't check for duplicated imports as opposed to name clashes
due
to different type definitions.

On Mon, Oct 27, 2008 at 1:06 PM, MrMasha <craig.marshall_at_uk.experian.com>wrote:

>
> I am trying to split some common JAXB schemas into seperate Netbeans
> modules
> in a prototype and getting the following error when trying to build the
> classes for a ParentObject (the error is strange and I presume some sort of
> reference error as the line number does not actually exist?)
>
> As always any help appreciated!
>
> [ERROR] 'LibraryCard' is already defined
> line 14 of
>
> file:/C:/Experian-Scorex/IDAP%20Prototype/Component%20-%20Framework/src/com/experian/component/framework/transformation/schema/LibraryCard.xsd
>
> [ERROR] (related to above error) the first definition appears here
> line 6 of
>
> file:/C:/Experian-Scorex/IDAP%20Prototype/Component%20-%20Framework/src/com/experian/component/framework/transformation/schema/LibraryCard.xsd
>
>
> 1) LibraryCard.xsd
> <?xml version="1.0" encoding="UTF-8"?>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> targetNamespace="http://xml.netbeans.org/schema/LibraryCard"
> xmlns:tns="http://xml.netbeans.org/schema/LibraryCard"
> elementFormDefault="qualified">
> <xsd:complexType name="LibraryCard">
> <xsd:sequence>
> <xsd:element name="Name" type="xsd:string"/>
> <xsd:element name="URL" type="xsd:string"/>
> <xsd:element name="ComponentType" type="xsd:string"/>
> <xsd:element name="public" type="xsd:boolean"></xsd:element>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:schema>
>
> 2) ComponentObject.xsd
> <?xml version="1.0" encoding="UTF-8"?>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> targetNamespace="http://xml.netbeans.org/schema/ComponentObject
> "
> xmlns:tns="http://xml.netbeans.org/schema/ComponentObject"
> elementFormDefault="qualified"
> xmlns:ns1="http://xml.netbeans.org/schema/LibraryCard">
> <xsd:import schemaLocation="LibraryCard.xsd"
> namespace="http://xml.netbeans.org/schema/LibraryCard"/>
> <xsd:complexType name="ComponentObject">
> <xsd:sequence>
> <xsd:element name="LibCard" type="ns1:LibraryCard"/>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:schema>
>
> 3)ParentObject.xsd
> <?xml version="1.0" encoding="UTF-8"?>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> targetNamespace="http://xml.netbeans.org/schema/ParentObject"
> xmlns:tns="http://xml.netbeans.org/schema/ParentObject"
> elementFormDefault="qualified"
> xmlns:ns="http://xml.netbeans.org/schema/ComponentObject"
> xmlns:ns1="http://xml.netbeans.org/schema/LibraryCard">
>
> <xsd:import schemaLocation="../../../../../../../../Component -
>
> Framework/src/com/experian/component/framework/transformation/schema/ComponentObject.xsd"
> namespace="http://xml.netbeans.org/schema/ComponentObject"/>
> <xsd:import schemaLocation="../../../../../../../../Component -
>
> Framework/src/com/experian/component/framework/transformation/schema/LibraryCard.xsd"
> namespace="http://xml.netbeans.org/schema/LibraryCard"/>
>
> <xsd:complexType name="ParentObject">
> <xsd:complexContent>
> <xsd:extension base="ns:ComponentObject">
> <xsd:sequence>
> <xsd:element name="SegmentationObject"
> maxOccurs="unbounded" type="ns1:LibraryCard"></xsd:element>
> </xsd:sequence>
> </xsd:extension>
> </xsd:complexContent>
> </xsd:complexType>
> <xsd:element name="ParentObject" type="tns:ParentObject"/>
> </xsd:schema>
> --
> View this message in context:
> http://www.nabble.com/Circular-Reference-Error--tp20186407p20186407.html
> Sent from the java.net - jaxb users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>