Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug Wsdl2Java Jaxb error "declarations cause a collision"

I have a wsdl that was generated by .NET that I am trying to consume in a java application. To do this, I am trying to use the CXF Wsdl2Java tool. The problem is that when the tool runs, 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 a custom binding file to rename an object at build time, but I have no idea where to start. How do I find out which objects in the wsdl are causing the problems?

(It seems like it would be nice if the exception actually said which elements were causing the naming conflict)

like image 613
JamesP Avatar asked Feb 14 '11 16:02

JamesP


1 Answers

This might work:

  1. tell cxf to resolve name collision with : -autoNameResolution command line argument
  2. tell jaxb to not remove underscores with : jaxb:globalBindings underscoreBinding="asCharInWord"
like image 122
André Ricardo Avatar answered Nov 07 '22 13:11

André Ricardo