The XJC task in the ANT script says: “Use class customization”

When you run the XJC task on SNotification.xsd, two XSDs (SNotification.xsd, CDataModel.xsd) generate the same class. The error it shows is:

A class/interface with the same name "com.att.mre.ecrupr.atlas.jms.MarketInfo" is already in use. Use a class customization to resolve this conflict.
      [xjc]   line 214 of file:/C:/Documents%20and%20Settings/rkar4749/workspace/ECRUPR_1306/AtlasEventsListener/xsd/Atlas/Container/Public/SubscriberNotification.xsd
      [xjc] [ERROR] (Relevant to above error) another "MarketInfo" is generated from here.
      [xjc]   line 22368 of file:/C:/Documents%20and%20Settings/rkar4749/workspace/ECRUPR_1306/AtlasEventsListener/xsd/Common/Types/Public/CingularDataModel.xsd
      [xjc] [ERROR] Two declarations cause a collision in the ObjectFactory class.
      [xjc]   line 22368 of file:/C:/Documents%20and%20Settings/rkar4749/workspace/ECRUPR_1306/AtlasEventsListener/xsd/Common/Types/Public/CingularDataModel.xsd
      [xjc] [ERROR] (Related to above error) This is the other declaration.   
      [xjc]   line 214 of file:/C:/Documents%20and%20Settings/rkar4749/workspace/ECRUPR_1306/AtlasEventsListener/xsd/Atlas/Container/Public/SubscriberNotification.xsd
      [xjc] failure in the XJC task. Use the Ant -verbose switch for more details
+5
source share
2 answers

I had the same problem and ran below the command from the terminal, and it was solved

xjc -XautoNameResolution your.xsd 
+15
source

You can use an external binding file to rename one of the generated classes.

Example

0
source

All Articles