axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject [jira] Created: (AXIS-1337) Regression in WSDL2Java caused by change in Utils.java
Date Tue, 27 Apr 2004 01:33:54 GMT
Message:

  A new issue has been created in JIRA.

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/AXIS-1337

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: AXIS-1337
    Summary: Regression in WSDL2Java caused by change in Utils.java
       Type: Bug

     Status: Unassigned
   Priority: Major

    Project: Axis
 Components: 
             WSDL processing
   Versions:
             current (nightly)

   Assignee: 
   Reporter: Shantanu Sen

    Created: Mon, 26 Apr 2004 6:32 PM
    Updated: Mon, 26 Apr 2004 6:32 PM
Environment: Current cvs tree (4262004) on Win XP

Description:
If xsd:schema element is removed from the WSDL, the WSDL2Java is throwing an NPE in the beta-1
src tree.

For example, consider the following WSDL snippet..

<types>
  <!--xsd:schema targetNamespace="http://MyService"-->
   <xsd:element name="MyString" type="xsd:string"/>
  <!--/xsd:schema-->
</types>

Running this WSDL (attached) produces no errors in Axis 1.1, but throws the following NPE
on 1.2

java.lang.NullPointerException
        at org.apache.axis.wsdl.symbolTable.Utils.getNodeNameQName(Utils.java:26
7)
        at org.apache.axis.wsdl.symbolTable.SymbolTable.createTypeFromDef(Symbol
Table.java:1095)
        at org.apache.axis.wsdl.symbolTable.SymbolTable.addTypes(SymbolTable.jav
a:971)
        at org.apache.axis.wsdl.symbolTable.SymbolTable.addTypes(SymbolTable.jav
a:1077)
        at org.apache.axis.wsdl.symbolTable.SymbolTable.addTypes(SymbolTable.jav
a:1077)
        at org.apache.axis.wsdl.symbolTable.SymbolTable.addTypes(SymbolTable.jav
a:1077)
        at org.apache.axis.wsdl.symbolTable.SymbolTable.populateTypes(SymbolTabl
e.java:894)
        at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav
a:692)
        at org.apache.axis.wsdl.symbolTable.SymbolTable.add(SymbolTable.java:531
)
        at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav
a:506)
        at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav
a:483)
        at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:356)
        at java.lang.Thread.run(Thread.java:536)

On further investigation it seems that the cause is a change in the class org.apache.axis.wsdl.symbolTable.Utils.java
between the 1.30.2.1 and the 1.30 versions:

http://cvs.apache.org/viewcvs.cgi/ws-axis/java/src/org/apache/axis/wsdl/symbolTable/Utils.java?r1=1.30&r2=1.30.2.1&diff_format=h

Note that in the current version the code section under the following comment has changed....

// This routine may be called for complexType elements.  In some cases
// the complexType may be anonymous, which is why the
// getScopedAttribute method is used.

The code section is no longer inside the if (localName == null) code block. 

As a result if the xsd:schema element is removed from the WSDL, the search goes on till it
hits the  XML declaration for which the kind variable (line 265) returns null. This results
in the NPE.

Omitting the xsd:schema may result in an incorrect WSDL, but an NPE should not be thrown.
If the xsd:schema is not found, a proper error message should be generate.




---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Mime
View raw message