You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ji...@apache.org on 2004/06/05 03:35:53 UTC

[jira] Commented: (AXIS-1337) Regression in WSDL2Java caused by change in Utils.java

The following comment has been added to this issue:

     Author: Shantanu Sen
    Created: Fri, 4 Jun 2004 6:34 PM
       Body:
The changed Utils.java fixes the bug and I have tested
it with the wsdl that I submitted in the bug as the
test case. The change is the addition of new code from
line 267 to 274. Also, I have fixed the indentation of
the enclosing while loop.
---------------------------------------------------------------------
View this comment:
  http://issues.apache.org/jira/browse/AXIS-1337?page=comments#action_35918

---------------------------------------------------------------------
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: Fri, 4 Jun 2004 6:35 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