I have been experimenting with CXF and the wsdl2java through Eclipse 3.5RC1
and have run into several situations where the code generation does not
work.  We have a large application that interacts as a client with search
engines such as Google, MSN and Yahoo and I have been attempting the code
generation from their wsdl.  Trying to generate code for MSN's
CampaignManagementService I am getting:

WSDLToJava Error: Thrown by JAXB : Two declarations cause a collision in the
ObjectFactory class.

org.apache.cxf.tools.common.ToolException: Thrown by JAXB : Two declarations
cause a collision in the ObjectFactory class.
        at
org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBBindErrorListener.error(JAXBBindErrorListener.java:34)
        at
com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.error(SchemaCompilerImpl.java:285)
        at
com.sun.tools.xjc.util.ErrorReceiverFilter.error(ErrorReceiverFilter.java:77)
        at com.sun.tools.xjc.ErrorReceiver.error(ErrorReceiver.java:82)
        at
com.sun.tools.xjc.generator.bean.ObjectFactoryGeneratorImpl.populate(ObjectFactoryGeneratorImpl.java:187)
        at
com.sun.tools.xjc.generator.bean.PublicObjectFactoryGenerator.populate(PublicObjectFactoryGenerator.java:55)
        at
com.sun.tools.xjc.generator.bean.BeanGenerator.<init>(BeanGenerator.java:241)
        at
com.sun.tools.xjc.generator.bean.BeanGenerator.generate(BeanGenerator.java:174)
        at com.sun.tools.xjc.model.Model.generateCode(Model.java:286)
        at
com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:251)
        at
com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:85)
        at
org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:221)
        at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJavaContainer.java:543)
        at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:194)
        at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:238)
        at
org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83)
        at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:103)
        at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:173)
Caused by: com.sun.istack.SAXParseException2: Two declarations cause a
collision in the ObjectFactory class.
        ... 15 more

I suspect this is likely to be an error in their wsdl but it is huge and has
three imports in the schema.  What is the process that one should use to
track down this error?  Hopefully something better than manually reading
through the wsdl. Note: using the Eclipse WebServicesTools with Apache 1
code generation is successful.

thanks,
Chris Marshall
-- 
View this message in context: 
http://www.nabble.com/Tracking-WSDLToJava-Error%3A-Thrown-by-JAXB-%3A-Two-declarations-cause-a-collision-tp23732104p23732104.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to