Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-5749

AntCodegenTask gens faulty code in 1.7.1 when using wsdl-enumeration

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.7.1
    • 1.7.2
    • codegen
    • None

    Description

      After upgrading Axis2 from 1.7.0 to 1.7.1 AntCodegenTask gens faulty code when using wsdl-enumeration.

      <xsd:element name="Color">
              <xsd:complexType>
                <xsd:sequence>
                  <xsd:element name="in">
                     <xsd:simpleType>
                        <xsd:restriction base="xsd:string">
                           <xsd:enumeration value="RED"></xsd:enumeration>
                           <xsd:enumeration value="GREEN"></xsd:enumeration>
                           <xsd:enumeration value="BLUE"></xsd:enumeration>
                        </xsd:restriction>
                     </xsd:simpleType>
                  </xsd:element>
                </xsd:sequence>
              </xsd:complexType>
            </xsd:element>
      

      Ant-Output 1.7.1:

      Buildfile: /home/philipp/Entwicklung/eclipse_workspace/Axis1.7.1/build.xml
      declare:
      pre_compile:
        [codegen] Retrieving document at 'wsdl/Example.wsdl'.
        [codegen] log4j:WARN No appenders could be found for logger (org.apache.axiom.locator.DefaultOMMetaFactoryLocator).
        [codegen] log4j:WARN Please initialize the log4j system properly.
      compile:
          [javac] /home/philipp/Entwicklung/eclipse_workspace/Axis1.7.1/build.xml:16: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
          [javac] Compiling 9 source files to /home/philipp/Entwicklung/eclipse_workspace/Axis1.7.1/bin
          [javac] /home/philipp/Entwicklung/eclipse_workspace/Axis1.7.1/src/com/ise_online/example/Color.java:95: error: no suitable method found for serialize(QName,XMLStreamWriter)
          [javac]         localIn.serialize(new javax.xml.namespace.QName("", "in"), xmlWriter);
          [javac]                ^
          [javac]     method OMSerializable.serialize(XMLStreamWriter,boolean) is not applicable
          [javac]       (argument mismatch; QName cannot be converted to XMLStreamWriter)
          [javac]     method OMNode.serialize(OutputStream,OMOutputFormat) is not applicable
          [javac]       (argument mismatch; QName cannot be converted to OutputStream)
          [javac]     method OMNode.serialize(Writer,OMOutputFormat) is not applicable
          [javac]       (argument mismatch; QName cannot be converted to Writer)
          [javac]     method OMContainer.serialize(OutputStream,OMOutputFormat) is not applicable
          [javac]       (argument mismatch; QName cannot be converted to OutputStream)
          [javac]     method OMContainer.serialize(Writer,OMOutputFormat) is not applicable
          [javac]       (argument mismatch; QName cannot be converted to Writer)
          [javac]     method OMElement.serialize(OutputStream,OMOutputFormat) is not applicable
          [javac]       (argument mismatch; QName cannot be converted to OutputStream)
          [javac]     method OMElement.serialize(Writer,OMOutputFormat) is not applicable
          [javac]       (argument mismatch; QName cannot be converted to Writer)
          [javac] /home/philipp/Entwicklung/eclipse_workspace/Axis1.7.1/src/com/ise_online/example/Color.java:370: error: cannot find symbol
          [javac]                     object.setIn(org.apache.axiom.om.OMElement.Factory.parse(
          [javac]                                                               ^
          [javac]   symbol:   variable Factory
          [javac]   location: interface OMElement
          [javac] /home/philipp/Entwicklung/eclipse_workspace/Axis1.7.1/src/com/ise_online/example/ExampleMessageReceiverInOut.java:110: error: incompatible types: OMElement cannot be converted to In_type1
          [javac]         return wrappedType.getIn();
          [javac]                                 ^
          [javac] /home/philipp/Entwicklung/eclipse_workspace/Axis1.7.1/src/com/ise_online/example/ExampleStub.java:416: error: incompatible types: In_type1 cannot be converted to OMElement
          [javac]             wrappedType.setIn(param1);
          [javac]                               ^
          [javac] Note: /home/philipp/Entwicklung/eclipse_workspace/Axis1.7.1/src/com/ise_online/example/ExampleStub.java uses unchecked or unsafe operations.
          [javac] Note: Recompile with -Xlint:unchecked for details.
          [javac] Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
          [javac] 4 errors
      
      BUILD FAILED
      

      Ant-Output 1.7.0:

      Buildfile: /home/philipp/Entwicklung/eclipse_workspace/Axis1.7.1/build.xml
      declare:
      pre_compile:
        [codegen] Retrieving document at 'wsdl/Example.wsdl'.
        [codegen] log4j:WARN No appenders could be found for logger (org.apache.axiom.locator.DefaultOMMetaFactoryLocator).
        [codegen] log4j:WARN Please initialize the log4j system properly.
      compile:
          [javac] /home/philipp/Entwicklung/eclipse_workspace/Axis1.7.1/build.xml:16: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
          [javac] Compiling 9 source files to /home/philipp/Entwicklung/eclipse_workspace/Axis1.7.1/bin
          [javac] Note: /home/philipp/Entwicklung/eclipse_workspace/Axis1.7.1/src/com/ise_online/example/ExampleStub.java uses unchecked or unsafe operations.
          [javac] Note: Recompile with -Xlint:unchecked for details.
      dist:
      BUILD SUCCESSFUL
      

      See eclipse-project in attachment. Please put the 1.7.0 and 1.7.1 axis2 jars in the respective folders. Use

              <fileset dir="./lib1.7.0" includes="*.jar"/>
      

      or

              <fileset dir="./lib1.7.1" includes="*.jar"/>
      

      in build.xml line 6 for switching between the axis2-versions.

      Attachments

        1. project.zip
          39 kB
          Phil Mueller

        Activity

          People

            veithen Andreas Veithen
            ise-mueller Phil Mueller
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: