How to debug Wsdl2Java Jaxb errors "ads cause collision"

I have wsdl that was generated by .NET, which I am trying to use in a Java application. For this I am trying to use the CXF tool Wsdl2Java. The problem is that when the tool starts, it throws a jaxb exception:

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

I understand that I probably need to create my own binding file to rename the object during the build, but I don't know where to start. How to find out which objects in wsdl are causing problems?

(It seems to be nice if the exception actually indicated which elements cause a name conflict)

+6
wsdl2java jaxb cxf
source share
2 answers

This might work:

  • tell cxf to resolve name collisions with: -autoNameResolution command line argument
  • tell jaxb not to remove underscores: jaxb: globalBindings underscoreBinding = "asCharInWord"

Source: http://www.jroller.com/ouertani/entry/wsdl_integration_problem_two_declarations

+1
source share

In addition to the above, make sure that you are using the latest version of the CXF wsdl2java tool. Recent versions have improved the work of getting row / column numbers, where JAXB finds these types of errors. This, at least, can provide a basic indication of where to look, but they are still not easy to track.

0
source share

All Articles