Details
Description
cxf-codegen-plugin generates service stubs but is unable to generate client stubs. When generating the service stubs the wsdl and xsds are referenced localy within the project space. When generating the client code the same cxf-codegen-plugin description is used that generated the service stubs except the wsdl location is changed to refer to the deployed wsdl.
The error reported is:
[ERROR] Thrown by JAXB: 'xxxx' is already defined
Where xxxx is a type that is defined in an xsd that is referred to by multiple files (wsdl and another xsd).
Steps to recreate - files to be attached
CXFService
- Create Dynamic Web Project that is maven enabled
- Create WebContent/WEB-INF/web.xml
- Create WebContent/WEB-INF/wsdl/myservice/MyService.wsdl
- Create WebContent/WEB-INF/xsd/myservice/MyService.xsd
- Create WebContent/WEB-INF/xsd/mycommon/MyCommon.xsd
- Run wsdl2java
- Deploy service (no changes) to JBoss (i.e. jboss:hard-deploy)
CXFClient
- Create Dynamic Web Project that is maven enabled
- Create WebContent/WEB-INF/web.xml
- Run wsdl2java (referece deployed wsdl)
http://localhost:8080/CXFService-0.0.1-SNAPSHOT?wsdl
Errors are generated...
Work around (for this issue) is to comment out the MyCommon.xsd include in the MyService.wsdl. But this causes the wsdl editor graphic to display a linkage error. But asside from that with the duplicate include removed the cient stubs can be generated.
Note originally I thought that adding the extraargs resolved the issue. But it appears that when -v (version) is added then only the version is displayed. There is no code generation and consequently no errors.
<extraargs>
<extraarg>-v</extraarg>
<extraarg>-verbose</extraarg>
</extraargs>
Attachments
Attachments
Issue Links
- relates to
-
CXF-3927 WSDLToJava Error -- two elements with the same name defined (same error difference issue)
- Closed