Skip to main content

"Use a class customization to resolve this conflict"

No replies
Joined: 2011-01-28

I see most questions in this forum are unanswered, but here goes:
I must be exceptionally thick, because in spite of finding several hits when searching for this issue, i still don't understand how to solve it:
In the WSDL/schemas provided by a service provider, there are several elements with the same name but in different namespaces, that, when processed with wsimport, generate java classes with the same name but different packages. however, when trying to compile these, wsimport throws the error:
<p>[ERROR] A class/interface with the same name &quot;; is already in use. Use a class customization to resolve this conflict.<br />  line 2853 of file:/C:/OTA_TravelItineraryReadPNR1.0.5RS.xsd</p><p>[ERROR] (Relevant to above error) another &quot;CustomerLoyalty&quot; is generated from here.<br />  line 434 of file:/C:/MyTypeLibrary_v.1.0.6.xsd</p>
This only happens, of course, if i choose to provide the package i want the classes in, with the -p option. not otherwise.
apparently, i have to create an external binding file (don't want to embed into someone else's wsdl) to resolve this - so first question is:
1. what should the binding file contents look like?
2. There are several such classes which are "duplicates". so would there need to be an entry for each such class? this might get pretty tedious - is there any other solution at all?
Somewhere, i saw a -B option that could be passed to the jaxb compiler which eliminates this error, but i can't find that link anymore. is that an obsolete option?