Skip to main content

A class/interface with the same name is already in use using jaxb1.3

1 reply [Last post]
lox5773
Offline
Joined: 2005-08-23
Points: 0

Hi All,
we are using an xsd in which elements name and complex type name are same but we are restricted not to alter element name /complex type names so do we need to use jaxb customization or any other apporoch

following are the errors we sre facing while trying to generate java classes from xsd using jaxb 1.3

build.xjc:
[xjc] Compiling file:/R:/project_1/module_1_0/documentation/xsd/Shipment.xsd
[xjc] [ERROR] A class/interface with the same name "com.sample.module_1.generated.shipment.Shipment" is already in use.
[xjc] line 7 of Shipment.xsd

[xjc] [ERROR] (Relevant to above error) another one is generated from here.
[xjc] line 13 of Shipment.xsd

[xjc] [ERROR] A class/interface with the same name "com.sample.module_1.generated.shipment.Station" is already in use.
[xjc] line 10 of Shipment.xsd

[xjc] [ERROR] (Relevant to above error) another one is generated from here.
[xjc] line 258 of Shipment.xsd

[xjc] [ERROR] A class/interface with the same name "com.sample.module_1.generated.shipment.Flight" is already in use.
[xjc] line 8 of Shipment.xsd

[xjc] [ERROR] (Relevant to above error) another one is generated from here.
[xjc] line 543 of Shipment.xsd

[xjc] [ERROR] A class/interface with the same name "com.sample.module_1.generated.shipment.Office" is already in use.
[xjc] line 12 of Shipment.xsd

[xjc] [ERROR] (Relevant to above error) another one is generated from here.
[xjc] line 276 of Shipment.xsd

[xjc] [ERROR] A class/interface with the same name "com.sample.module_1.generated.shipment.Manifest" is already in use.
[xjc] line 9 of Shipment.xsd

[xjc] [ERROR] (Relevant to above error) another one is generated from here.
[xjc] line 637 of Shipment.xsd

[xjc] [ERROR] A class/interface with the same name "com.sample.module_1.generated.shipment.ClearanceStation" is already in use.
[xjc] line 11 of Shipment.xsd

[xjc] [ERROR] (Relevant to above error) another one is generated from here.
[xjc] line 271 of Shipment.xsd

[xjc] [ERROR] A class/interface with the same name "com.sample.module_1.generated.shipment.StationAbbr" is already in use.
[xjc] line 2228 of ShippableEntity.xsd

[xjc] [ERROR] (Relevant to above error) another one is generated from here.
[xjc] line 247 of Shipment.xsd

BUILD FAILED
R:\project_1\module_1_0\build.xml:186: unable to parse the schema. Error messages should have been provided

our xsd schema sample is as below full schema can not be pasted

export detail

export detail

list of pointers (references to TransitPoints) denoting ports of interest in clearance

the packages in the shipment, contained by a handling unit

NOT_INCOMING

Please Reply asap and Thanks in advance
Alok and Pankaj

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kohsuke
Offline
Joined: 2003-06-09
Points: 0

You need to use customization. See the samples bundled in the JAXB RI for how to do it.