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 "Davanum Srinivas (JIRA)" <ax...@ws.apache.org> on 2005/01/25 19:51:17 UTC

[jira] Resolved: (AXIS-1714) Java2WSDL throws NPE on WSDLs that import schema from a file

     [ http://issues.apache.org/jira/browse/AXIS-1714?page=history ]
     
Davanum Srinivas resolved AXIS-1714:
------------------------------------

    Resolution: Fixed

committed patch.

thanks,
dims

> Java2WSDL throws NPE on WSDLs that import schema from a file
> ------------------------------------------------------------
>
>          Key: AXIS-1714
>          URL: http://issues.apache.org/jira/browse/AXIS-1714
>      Project: Axis
>         Type: Bug
>   Components: WSDL processing
>     Versions: current (nightly), 1.2RC2
>  Environment: JDK 1.4.2
>     Reporter: Mark Hansen
>     Priority: Minor
>  Attachments: SymbolTable.java
>
> When processing a WSDL that contains a schema import (see below) from a file, an NPE gets thrown.
>   <wsdl:types>
>     <xsd:schema elementFormDefault="qualified" targetNamespace="urn:ns1">
>       <xsd:import namespace="urn:ns2"  schemaLocation="types.xsd"/>
>     </xsd:schema>
>  .....
> I traced this back to a logic error in the method org.apache.axis.wsdl.symbolTable.SymbolTable.getFileURL(...)
> Attached is a new SymbolTable.java containing a patch.  Below is the diff -u:
>  cvs diff -u SymbolTable.java
> Index: SymbolTable.java
> ===================================================================
> RCS file: /home/cvspublic/ws-axis/java/src/org/apache/axis/wsdl/symbolTable/SymbolTable.java,v
> retrieving revision 1.110
> diff -u -r1.110 SymbolTable.java
> --- SymbolTable.java	18 Nov 2004 15:26:16 -0000	1.110
> +++ SymbolTable.java	10 Dec 2004 19:51:04 -0000
> @@ -792,8 +792,11 @@
>              // get the parent directory of the contextURL, and append
>              // the spec string to the end.
>              String contextFileName = contextURL.getFile();
> -            URL parent =
> -                    new File(contextFileName).getParentFile().toURL();
> +            URL parent = null;
> +	    File parentFile = new File(contextFileName).getParentFile();
> +	    if ( parentFile != null ) {
> +	      parent = parentFile.toURL();
> +	    }
>  
>              if (parent != null) {
>                  return new URL(parent, path);

-- 
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