2013-03-01 75 views
5

在SNotification.xsd上運行XJC任務時,兩個XSD(SNotification.xsd,CDataModel.xsd)正在生成相同的類。它顯示的錯誤是:ANT腳本中的XJC任務說「使用類定製」

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

我可以知道應遵循的方法,來解決這個問題。非常感謝!! – maryJane 2013-03-01 12:26:11

回答

15

我有同樣的問題,下面的命令從終端中運行,它解決了

xjc -XautoNameResolution your.xsd 
+0

我只使用maven-jaxb2-plugin遇到類似的問題。我從終端運行xjc命令並得到同樣的問題。在添加這個參數後,它解決了我的問題。我使用的命令:xjc -wsdl -p com.package.wsdl -XautoNameResolution https:// 。謝謝。 – 2014-05-21 16:34:55

+0

我遇到了同樣的問題,並且這對我有用:xjc -XautoNameResolution -d ./src/main/java ./xsd/some-one-elses-schema.xsd。這是xjc版本2.2.4-2(java版本1.7.0_51)。我很驚訝,當你在cmd提示符中鍵入xjc時,-XautoNameResolution沒有在選項中列出,但它似乎在我使用的xjc版本中可用。 – John 2016-09-06 14:40:24

相關問題