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

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

    XMLWordPrintableJSON

Details

    • 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

    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

      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)

      CXFClient

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

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

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: