You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Mika Tapanainen <mi...@gmail.com> on 2012/03/26 11:49:40 UTC

wsdl2java: Thrown by JAXB: A class/interface with the same name "".ReferenceType" is already in use

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.

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.

BR,

Mika

--
View this message in context: http://cxf.547215.n5.nabble.com/wsdl2java-Thrown-by-JAXB-A-class-interface-with-the-same-name-customerSpecificPackage-ReferenceType-e-tp5594747p5594747.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: wsdl2java: Thrown by JAXB: A class/interface with the same name "".ReferenceType" is already in use

Posted by Mika Tapanainen <mi...@digia.com>.
Thanks,

Mika

--
View this message in context: http://cxf.547215.n5.nabble.com/wsdl2java-Thrown-by-JAXB-A-class-interface-with-the-same-name-customerSpecificPackage-ReferenceType-e-tp5594747p5599485.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: wsdl2java: Thrown by JAXB: A class/interface with the same name "".ReferenceType" is already in use

Posted by donyoun <do...@echostar.com>.
I have question on running wsd12java on mac.

on the command line, I typed sh wsdl2java -client -p com.echostar.service
/Users/donghyun.youn/Desktop/EventServiceIPVOD.wsdl

and I got the following error message... I would be appreciated if you can
take a look at it.

Thank you in advance.

WSDLToJava Error: file:/Users/donghyun.youn/Desktop/EventServiceIPVOD.wsdl
[110,13]: A class/interface with the same name
"com.echostar.service.OrderEventResponse" is already in use. Use a class
customization or the -autoNameResolution option to resolve this conflict.
file:/Users/donghyun.youn/Desktop/EventServiceIPVOD.wsdl [22,13]: (Relevant
to above error) another "OrderEventResponse" is generated from here.
file:/Users/donghyun.youn/Desktop/EventServiceIPVOD.wsdl [152,13]: A
class/interface with the same name
"com.echostar.service.OrderHistoryAcctSTBResponse" is already in use. Use a
class customization or the -autoNameResolution option to resolve this
conflict.
file:/Users/donghyun.youn/Desktop/EventServiceIPVOD.wsdl [67,14]: (Relevant
to above error) another "OrderHistoryAcctSTBResponse" is generated from
here.
file:/Users/donghyun.youn/Desktop/EventServiceIPVOD.wsdl [138,13]: A
class/interface with the same name
"com.echostar.service.OrderHistoryByAcctNoResponse" is already in use. Use a
class customization or the -autoNameResolution option to resolve this
conflict.
file:/Users/donghyun.youn/Desktop/EventServiceIPVOD.wsdl [51,13]: (Relevant
to above error) another "OrderHistoryByAcctNoResponse" is generated from
here.
file:/Users/donghyun.youn/Desktop/EventServiceIPVOD.wsdl [124,13]: A
class/interface with the same name
"com.echostar.service.OrderEventFromSTBResponse" is already in use. Use a
class customization or the -autoNameResolution option to resolve this
conflict.
file:/Users/donghyun.youn/Desktop/EventServiceIPVOD.wsdl [37,14]: (Relevant
to above error) another "OrderEventFromSTBResponse" is generated from here.
file:/Users/donghyun.youn/Desktop/EventServiceIPVOD.wsdl [110,13]: Two
declarations cause a collision in the ObjectFactory class.
file:/Users/donghyun.youn/Desktop/EventServiceIPVOD.wsdl [22,13]: (Related
to above error) This is the other declaration.   
file:/Users/donghyun.youn/Desktop/EventServiceIPVOD.wsdl [152,13]: Two
declarations cause a collision in the ObjectFactory class.
file:/Users/donghyun.youn/Desktop/EventServiceIPVOD.wsdl [67,14]: (Related
to above error) This is the other declaration.   
file:/Users/donghyun.youn/Desktop/EventServiceIPVOD.wsdl [138,13]: Two
declarations cause a collision in the ObjectFactory class.
file:/Users/donghyun.youn/Desktop/EventServiceIPVOD.wsdl [51,13]: (Related
to above error) This is the other declaration.   
file:/Users/donghyun.youn/Desktop/EventServiceIPVOD.wsdl [124,13]: Two
declarations cause a collision in the ObjectFactory class.
file:/Users/donghyun.youn/Desktop/EventServiceIPVOD.wsdl [37,14]: (Related
to above error) This is the other declaration.



--
View this message in context: http://cxf.547215.n5.nabble.com/wsdl2java-Thrown-by-JAXB-A-class-interface-with-the-same-name-customerSpecificPackage-ReferenceType-e-tp5594747p5733763.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: wsdl2java: Thrown by JAXB: A class/interface with the same name "".ReferenceType" is already in use

Posted by Daniel Kulp <dk...@apache.org>.
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
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com