Axis2
  1. Axis2
  2. AXIS2-3851

adb-codegen no longer accepts schemas without targetNamespace

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.4
    • Fix Version/s: 1.5.4, 1.6.0
    • Component/s: adb
    • Labels:
      None
    • Environment:
      Java by sun 1.5.0.14 (amd64)
      Eclipse SDK

      Version: 3.2.1
      Build id: M20060921-0945 (Debian version: 3.2.1-4)

      Description

      With Axis1.3 I can generate code with an ant task for wsdl2java , from an wsdl file
      that contains an schema with targetNamespace="" (to describe the namespaceless xml I get in a RESTful service).

      With Axis1.4 I can no longer generate it.

      There's an exception originating at :
      [java] Caused by: java.lang.NullPointerException
      [java] at org.apache.axis2.schema.SchemaCompiler.isComponetExists(SchemaCompiler.java:2723)
      [java] at org.apache.axis2.schema.SchemaCompiler.getParentSchemaFromIncludes(SchemaCompiler.java:2670)
      [java] at org.apache.axis2.schema.SchemaCompiler.getParentSchema(SchemaCompiler.java:2644)

      This is apparently because of commit
      http://svn.apache.org/viewvc?view=rev&revision=627710
      Revision 627710
      Jump to revision: Previous Next
      Author: amilas
      Date: Thu Feb 14 11:30:40 2008 UTC (3 months, 3 weeks ago)
      Log Message: when resolving schemas target namespaces must be matched

      Aparently the namespace from the schema is null.
      Maybe it should be "" or maybe the added condition should accept both namespaces being null.

      I'm not sure what else has changed from Axis2 1.3 to 1.4 and whether fixing this would introduce
      some other error with empty namespaces, but it seems a regression, hopefully easy to fix. I'm sorry
      I can't try to fix it now.

      (the function name is misspelt, it lacks an n before the last t of "component", btw, but that's irrelevant).

      1. SchemaCompiler.java
        134 kB
        Mohamed el habib
      2. AXIS2-3851.zip
        4 kB
        Rustam Abdullaev

        Issue Links

          Activity

          Xavi Drudis Ferran created issue -
          Hide
          Mohamed el habib added a comment -

          Hello everybody,

          I'm using axis2 (1.4.1) to generate a web service client with the ADB. I have the same problem: when wsdl contains an imported schema with an empty target name space, I get a null pointer exception into SchemaCompiler.isComponetExists(). You can find here a fix I done. I work for me.

          By

          Show
          Mohamed el habib added a comment - Hello everybody, I'm using axis2 (1.4.1) to generate a web service client with the ADB. I have the same problem: when wsdl contains an imported schema with an empty target name space, I get a null pointer exception into SchemaCompiler.isComponetExists(). You can find here a fix I done. I work for me. By
          Mohamed el habib made changes -
          Field Original Value New Value
          Attachment SchemaCompiler.java [ 12402362 ]
          Andreas Veithen made changes -
          Link This issue is duplicated by AXIS2-4251 [ AXIS2-4251 ]
          Andreas Veithen made changes -
          Assignee Andreas Veithen [ veithen ]
          Andreas Veithen made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 1.6 [ 12313622 ]
          Fix Version/s 1.3 [ 12312476 ]
          Resolution Fixed [ 1 ]
          Andreas Veithen made changes -
          Link This issue is duplicated by AXIS2-4887 [ AXIS2-4887 ]
          Andreas Veithen made changes -
          Fix Version/s 1.5.4 [ 12315568 ]
          Hide
          Rustam Abdullaev added a comment -

          Someone please reopen this issue.

          Why was this set to resolved without applying the fix in SVN?

          The "Fix Version" 1.5.4 setting is wrong, the fix isn't in release 1.5.4.

          Line 2723 in SchemaCompiler.java still unchanged:
          if (!schema.getTargetNamespace().equals(componentQName.getNamespaceURI())){

          The fix is also NOT in the 1.5 branch:
          http://svn.apache.org/repos/asf/axis/axis2/java/core/branches/1_5/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java

          Show
          Rustam Abdullaev added a comment - Someone please reopen this issue. Why was this set to resolved without applying the fix in SVN? The "Fix Version" 1.5.4 setting is wrong, the fix isn't in release 1.5.4. Line 2723 in SchemaCompiler.java still unchanged: if (!schema.getTargetNamespace().equals(componentQName.getNamespaceURI())){ The fix is also NOT in the 1.5 branch: http://svn.apache.org/repos/asf/axis/axis2/java/core/branches/1_5/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java
          Hide
          Andreas Veithen added a comment -

          In the "Subversion Commits" tab you can see the changes that have been done for this issue. If you believe that the issue still persists, then you should provide evidence that supports that claim.

          Show
          Andreas Veithen added a comment - In the "Subversion Commits" tab you can see the changes that have been done for this issue. If you believe that the issue still persists, then you should provide evidence that supports that claim.
          Hide
          Rustam Abdullaev added a comment -

          Please take a look at the attached file (AXIS2-3851.zip), running "mvn compile" will generate the original exception:

          [INFO] — axis2-wsdl2code-maven-plugin:1.5.4:wsdl2code (default) @ AXIS2-3851
          Retrieving document at 'C:\Projects\AXIS2-3851/src/wsdl/test.wsdl'.
          Retrieving schema at 'test1.xsd', relative to 'file:/C:/Projects/AXIS2-3851/src/wsdl/test.wsdl'.
          Retrieving schema at 'test2.xsd', relative to 'file:/C:/Projects/AXIS2-3851/src/wsdl/test1.xsd'.
          java.lang.NullPointerException
          at org.apache.axis2.schema.SchemaCompiler.isComponetExists(SchemaCompiler.java:2723)
          at org.apache.axis2.schema.SchemaCompiler.getParentSchemaFromIncludes(SchemaCompiler.java:2670)
          at org.apache.axis2.schema.SchemaCompiler.getParentSchemaFromIncludes(SchemaCompiler.java:2704)
          at org.apache.axis2.schema.SchemaCompiler.getParentSchema(SchemaCompiler.java:2644)
          at org.apache.axis2.schema.SchemaCompiler.processSchema(SchemaCompiler.java:925)
          at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:592)
          at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:552)
          at org.apache.axis2.schema.SchemaCompiler.process(SchemaCompiler.java:1991)
          at org.apache.axis2.schema.SchemaCompiler.processParticle(SchemaCompiler.java:1874)
          at org.apache.axis2.schema.SchemaCompiler.processComplexType(SchemaCompiler.java:1081)
          at org.apache.axis2.schema.SchemaCompiler.processNamedComplexSchemaType(SchemaCompiler.java:1017)
          at org.apache.axis2.schema.SchemaCompiler.processSchema(SchemaCompiler.java:931)
          at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:592)
          at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:563)
          at org.apache.axis2.schema.SchemaCompiler.compile(SchemaCompiler.java:370)
          at org.apache.axis2.schema.SchemaCompiler.compile(SchemaCompiler.java:280)
          at org.apache.axis2.schema.ExtensionUtility.invoke(ExtensionUtility.java:103)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(SimpleDBExtension.java:50)
          at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:224)
          at org.apache.axis2.maven2.wsdl2code.WSDL2CodeMojo.execute(WSDL2CodeMojo.java:558)

          Show
          Rustam Abdullaev added a comment - Please take a look at the attached file ( AXIS2-3851 .zip), running "mvn compile" will generate the original exception: [INFO] — axis2-wsdl2code-maven-plugin:1.5.4:wsdl2code (default) @ AXIS2-3851 — Retrieving document at 'C:\Projects\ AXIS2-3851 /src/wsdl/test.wsdl'. Retrieving schema at 'test1.xsd', relative to 'file:/C:/Projects/ AXIS2-3851 /src/wsdl/test.wsdl'. Retrieving schema at 'test2.xsd', relative to 'file:/C:/Projects/ AXIS2-3851 /src/wsdl/test1.xsd'. java.lang.NullPointerException at org.apache.axis2.schema.SchemaCompiler.isComponetExists(SchemaCompiler.java:2723) at org.apache.axis2.schema.SchemaCompiler.getParentSchemaFromIncludes(SchemaCompiler.java:2670) at org.apache.axis2.schema.SchemaCompiler.getParentSchemaFromIncludes(SchemaCompiler.java:2704) at org.apache.axis2.schema.SchemaCompiler.getParentSchema(SchemaCompiler.java:2644) at org.apache.axis2.schema.SchemaCompiler.processSchema(SchemaCompiler.java:925) at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:592) at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:552) at org.apache.axis2.schema.SchemaCompiler.process(SchemaCompiler.java:1991) at org.apache.axis2.schema.SchemaCompiler.processParticle(SchemaCompiler.java:1874) at org.apache.axis2.schema.SchemaCompiler.processComplexType(SchemaCompiler.java:1081) at org.apache.axis2.schema.SchemaCompiler.processNamedComplexSchemaType(SchemaCompiler.java:1017) at org.apache.axis2.schema.SchemaCompiler.processSchema(SchemaCompiler.java:931) at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:592) at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:563) at org.apache.axis2.schema.SchemaCompiler.compile(SchemaCompiler.java:370) at org.apache.axis2.schema.SchemaCompiler.compile(SchemaCompiler.java:280) at org.apache.axis2.schema.ExtensionUtility.invoke(ExtensionUtility.java:103) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(SimpleDBExtension.java:50) at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:224) at org.apache.axis2.maven2.wsdl2code.WSDL2CodeMojo.execute(WSDL2CodeMojo.java:558)
          Rustam Abdullaev made changes -
          Attachment AXIS2-3851.zip [ 12474032 ]
          Hide
          Andreas Veithen added a comment -

          The issue you are seeing is actually AXIS2-4251, for which a fix is currently scheduled for the 1.6.0 release. I will check if it is possible to merge that change to the 1.5 branch as well.

          Show
          Andreas Veithen added a comment - The issue you are seeing is actually AXIS2-4251 , for which a fix is currently scheduled for the 1.6.0 release. I will check if it is possible to merge that change to the 1.5 branch as well.
          Hide
          Andreas Veithen added a comment -

          Unfortunately, the fixes for AXIS2-4251 can't be merged to the 1.5 branch because there have been too many other changes on the trunk. If you want to use the chameleon pattern, then you need 1.6.x.

          Show
          Andreas Veithen added a comment - Unfortunately, the fixes for AXIS2-4251 can't be merged to the 1.5 branch because there have been too many other changes on the trunk. If you want to use the chameleon pattern, then you need 1.6.x.

            People

            • Assignee:
              Andreas Veithen
              Reporter:
              Xavi Drudis Ferran
            • Votes:
              3 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development