cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Bricout (JIRA)" <j...@apache.org>
Subject [jira] Created: (CXF-178) Schema parser cannot resolve relative import locations (case of multiple imports).
Date Wed, 25 Oct 2006 15:44:16 GMT
Schema parser cannot resolve relative import locations (case of multiple imports).
----------------------------------------------------------------------------------

                 Key: CXF-178
                 URL: http://issues.apache.org/jira/browse/CXF-178
             Project: CXF
          Issue Type: Bug
    Affects Versions: 2.0-M1
            Reporter: Michael Bricout


I have a test case that uses a set of WSDLs and schemas with multiple imports using relative
URIs.

ie: A.wsdl imports B.xsd that imports C.xsd, all are located in the same directory.

In A.wsdl:
  <xsd:import namespace="http://foo" schemaLocation="./B.xsd"/>

In B.xsd:
  <xsd:import namespace="http://foo/bar" schemaLocation="./C.xsd"/>

Code generation works fine, however I have a problem at runtime where the server fails to
initialize with the following exception:

java.lang.RuntimeException: org.apache.ws.commons.schema.XmlSchemaException:
/[my project path]/C.xsd (No such file or directory)

The problem is that the URI for importing C.xsd is incorrectly determined.

In the example above, C.xsd would actually be located in
/[my project path]/target/test/wsdl/C.xsd

I see the following behavior in org.apache.cxf.resource.URIResolver:

For A imports B, we create a URIResolver with the following parameters:
 baseUriStr = "file:[path to A]/A.wsdl"         (correct)
 uriStr = "./B.xsd"

Then tryFileSystem(baseUriStr, uriStr) is invoked and B.xsd is correctly resolved.


Now for B import C, we create a URIResolver with the following parameters:
 baseUriStr = "./B.xsd"
 uriStr = "./C.xsd"

The value for the base URI being set to a relative path, we fail to resolve C.xsd.
tryFileSystem ends up calling tryClasspath("./C.xsd"), which in turn calls tryRemote(), which
aborts on a MalformedURLException.

I get the same problem when using relative URIs to import schemas from different directories.


-- 
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
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message