2013-03-01 11 views
5

Quando si esegue l'attività XJC su SNotification.xsd, due XSD (SNotification.xsd, CDataModel.xsd) generano la stessa classe. L'errore che viene mostrato è:L'attività XJC nello script ANT dice "Usa Personalizzazione classe"

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 
+0

Posso sapere l'approccio da seguire, per superare questo problema. grazie molto!! – maryJane

risposta

15

Ho avuto lo stesso problema ed eseguire sotto comando da terminale ed è stato risolto

xjc -XautoNameResolution your.xsd 
+0

Ho avuto un problema simile usando solo il plugin maven-jaxb2. Ho eseguito il comando xjc dal terminale e ho avuto lo stesso problema. Dopo aver aggiunto questo argomento ha risolto il mio problema. Il comando che ho usato: xjc -wsdl -p com.package.wsdl -XautoNameResolution https: // . Grazie. –

+0

Stavo avendo lo stesso problema e questo ha funzionato per me: xjc -XautoNameResolution -d ./src/main/java ./xsd/some-one-elses-schema.xsd. Questo era con xjc versione 2.2.4-2 (java versione 1.7.0_51). Sono stato sorpreso dal fatto che -XautoNameResolution non fosse elencato nelle opzioni quando si digita xjc in un prompt di cmd ma sembra che sia disponibile nella versione di xjc che sto usando. – John