Axis2
  1. Axis2
  2. AXIS2-4887

TargetNameSpace required for XSD2Java

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Duplicate
    • Affects Version/s: 1.5.3
    • Fix Version/s: 1.5.4, 1.6.0
    • Component/s: codegen
    • Labels:
      None

      Description

      When omitting the targetNamespace attribute from an xsd, or providing it with an empty value, code generation with the XSD2Java class fails with a NullPointerException.

      The reason is that the SchemaCompiler class calls URLProcessor.makePackageName() with the value returned by the call to schema.getTargetNamespace(), which is null in this case.

      The URLProcessor.makePackageName() method then generates the exception, because it tries to call methods from the null object.

      To me, this is a bug, because AFAIK, the targetNamespace attribute isn't required.

        Issue Links

          Activity

          Jan-Willem Borleffs created issue -
          Hide
          Andreas Veithen added a comment -

          Can you please fill in the "Affects Version" field?

          Show
          Andreas Veithen added a comment - Can you please fill in the "Affects Version" field?
          Andreas Veithen made changes -
          Field Original Value New Value
          Fix Version/s 1.5.3 [ 12315367 ]
          Jan-Willem Borleffs made changes -
          Affects Version/s 1.5.3 [ 12315367 ]
          Hide
          Andreas Veithen added a comment -

          I think that some fixes for this issue have been done on the trunk. Can you test that with a snapshot build from the trunk (i.e. SNAPSHOT, not 1.5.4-SNAPSHOT).

          Show
          Andreas Veithen added a comment - I think that some fixes for this issue have been done on the trunk. Can you test that with a snapshot build from the trunk (i.e. SNAPSHOT, not 1.5.4-SNAPSHOT).
          Hide
          Jan-Willem Borleffs added a comment -
          Show
          Jan-Willem Borleffs added a comment - Tested successfully with the following snapshot: http://repository.apache.org/snapshots/org/apache/axis2/axis2/SNAPSHOT/axis2-SNAPSHOT-jar.jar Cheers!
          Andreas Veithen made changes -
          Link This issue duplicates AXIS2-3851 [ AXIS2-3851 ]
          Hide
          Andreas Veithen added a comment -

          This appears to be a duplicate of AXIS2-3851. I've merged the fix to the 1.5 branch so that it will be available in 1.5.4.

          Show
          Andreas Veithen added a comment - This appears to be a duplicate of AXIS2-3851 . I've merged the fix to the 1.5 branch so that it will be available in 1.5.4.
          Andreas Veithen made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 1.6 [ 12313622 ]
          Fix Version/s 1.5.4 [ 12315568 ]
          Resolution Duplicate [ 3 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          1d 4h 51m 1 Andreas Veithen 19/Nov/10 20:25

            People

            • Assignee:
              Unassigned
              Reporter:
              Jan-Willem Borleffs
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development