On Monday, March 26, 2012 02:49:40 AM Mika Tapanainen wrote:
> Hello,
> 
> I run following command:
> 
> wsdl2java -p <customerSpecificPackage> -impl -verbose -d
> <pathToSrcGenerated>\src-generated <pathToWsdl>.wsdl
> 
> and I got the exception:
> 
> Thrown by JAXB: A class/interface with the same name
> "<customerSpecificPackage>.ReferenceType" is already in use. Use a class
> customization or the -autoNameResolution option to resolve this conflict.
> 
> My wsdl contains:
> 
>       <message name="Header">
>               <part name="Security" element="wsse:Security"/>
>       </message>
> 
> Without above wsdl element the wsdl2java is working correctly.

If you do that, you are basically bringing in the entire WS-Security 
specification into your wsdl and generating types for everything in there.   
In general, I wouldn't recommend doing that.

 
> I tried with the "-autoNameResolution", but that didn't help me.
> 
> I understand that ReferenceType is the class the CXF has created. How to
> solve this issue? What kind of binding file I should use?
> 
> Note: I have used the jaxb-api-2.2.3.jar in my endorsed lib.

You *MAY* be able use a jaxb binding file that turns off the generation of 
the types in the ws-security namespace (or maps those to a DOM element).   
I'm really not sure that would help.   

In general, WSDL's pretty much never stick a :

<part name="Security" element="wsse:Security"/>

type thing in the messages.   

Dan



> 
> BR,
> 
> Mika
> 
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/wsdl2java-Thrown-by-JAXB-A-class-interfac
> e-with-the-same-name-customerSpecificPackage-ReferenceType-e-tp5594747p559
> 4747.html Sent from the cxf-user mailing list archive at Nabble.com.
-- 
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply via email to