Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-3968

WSDLToJava Error: ...is already defined at... when referencing deployed wsdl



    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.5
    • 2.5.1
    • Tooling
    • Windows 7 x64, Eclipse Helios, Maven Plugin (Sonatype - 0.12.1), Maven 3.0.3, cxf-codegen-plugin 2.5.0, JBoss 6.

    • Unknown


      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


      1. Create Dynamic Web Project that is maven enabled
      2. Create WebContent/WEB-INF/web.xml
      3. Create WebContent/WEB-INF/wsdl/myservice/MyService.wsdl
      4. Create WebContent/WEB-INF/xsd/myservice/MyService.xsd
      5. Create WebContent/WEB-INF/xsd/mycommon/MyCommon.xsd
      6. Run wsdl2java
      7. Deploy service (no changes) to JBoss (i.e. jboss:hard-deploy)


      1. Create Dynamic Web Project that is maven enabled
      2. Create WebContent/WEB-INF/web.xml
      3. Run wsdl2java (referece deployed 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.


        1. CXF-3968.zip
          24 kB
          Paul Baker
        2. CXF-3968.jpg
          164 kB
          Paul Baker

        Issue Links



              dkulp Daniel Kulp
              pbaker01 Paul Baker
              0 Vote for this issue
              1 Start watching this issue