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

Apache CXF generating constructor with duplicate argument names causing compilation error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.7.11, 3.0.2
    • 3.2.2, 3.1.15
    • Tooling
    • None
    • Unknown

    Description

      I'm using the cxf-codegen-plugin plugin to generate a web service client.
      For many wsdl's this goes fine but I have one causing problems.

      It is a wsdl containing fault messages defined like:

      <message name="CustomerNotFoundException">
          <part name="message" type="xs:string" />
      </message>
      

      The generated Java file looks like:

      @WebFault(name = "message", targetNamespace = "http://www.w3.org/2001/XMLSchema")
      public class CustomerNotFoundException extends Exception {
      
          private java.lang.String message;
      
          public CustomerNotFoundException() {
              super();
          }
      
          public CustomerNotFoundException(String message) {
              super(message);
          }
      
          public CustomerNotFoundException(String message, Throwable cause) {
              super(message, cause);
          }
      
          public CustomerNotFoundException(String message, java.lang.String message) {
              super(message);
              this.message = message;
          }
      
          public CustomerNotFoundException(String message, java.lang.String message, Throwable cause) {
              super(message, cause);
              this.message = message;
          }
      
          ..
      }
      

      Which fails compilation because of the duplicate message argument of the CustomerNotFoundException constructor.

      In my pom I've added:

      <extraargs>
          <extraarg>-allowElementReferences</extraarg>
          <extraarg>-autoNameResolution</extraarg>
          <extraarg>-verbose</extraarg>
      </extraargs>
      

      But this does not help.

      I even tried custom bindings but it does not seem possible to change argument name of a constructor of a generated exception.

      Attachments

        1. fault.vm
          3 kB
          Reguel Wermelinger
        2. portalWebStartable.wsdl
          8 kB
          Reguel Wermelinger

        Issue Links

          Activity

            People

              deki Dennis Kieselhorst
              marceloverdijk Marcel Overdijk
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: