WSDL2Java: SchemaLocation and circular imports / StackOverflowError
-------------------------------------------------------------------

                 Key: AXIS2-1083
                 URL: http://issues.apache.org/jira/browse/AXIS2-1083
             Project: Apache Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: wsdl
    Affects Versions: 1.0
         Environment: WinXP, JRE 1.5
            Reporter: Oliver Grafe
            Priority: Critical
         Attachments: wsdl_import.tar.gz

As suggested on the mailing list I'm filing a bug report.

I'm having problems to use Axis2 WSDL2Java with some test WSDL and schema files 
I made, see attached files. Some of the schemas are importing each other, I 
think that is confusing WSDL2Java.

Command for code generation:

C:\wsdltest>java org.apache.axis2.wsdl.WSDL2Java -uri ord.wsdl > error.txt 2>&1

error.txt:
Retrieving schema at './xsd/ord.xsd', relative to 'file:/C:/wsdltest/'.
Retrieving schema at './prod1.xsd', relative to 'file:/C:/wsdltest/xsd/ord.xsd'.
Retrieving schema at './prod2.xsd', relative to 
'file:/C:/wsdltest/xsd/prod1.xsd'.
Retrieving schema at './prod1.xsd', relative to 
'file:/C:/wsdltest/xsd/prod2.xsd'.
Retrieving schema at './common.xsd', relative to 
'file:/C:/wsdltest/xsd/prod2.xsd'.
Retrieving schema at './common.xsd', relative to 
'file:/C:/wsdltest/xsd/prod1.xsd'.
Retrieving schema at './common.xsd', relative to 
'file:/C:/wsdltest/xsd/ord.xsd'.
Retrieving schema at './prod2.xsd', relative to 'file:/C:/wsdltest/xsd/ord.xsd'.
Exception in thread "main" java.lang.StackOverflowError
        at java.util.ArrayList.get(Unknown Source)
        at sun.misc.URLClassPath.getLoader(Unknown Source)
        at sun.misc.URLClassPath.findResource(Unknown Source)
        at java.net.URLClassLoader$2.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findResource(Unknown Source)
        at java.lang.ClassLoader.getResource(Unknown Source)
        at java.lang.ClassLoader.getResource(Unknown Source)
        at java.lang.ClassLoader.getResourceAsStream(Unknown Source)
        at javax.xml.parsers.SecuritySupport$4.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.xml.parsers.SecuritySupport.getResourceAsStream(Unknown Source)
        at javax.xml.parsers.FactoryFinder.findJarServiceProvider(Unknown 
Source)
        at javax.xml.parsers.FactoryFinder.find(Unknown Source)
        at javax.xml.parsers.DocumentBuilderFactory.newInstance(Unknown Source)
        at 
org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:213)
        at 
org.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema(SchemaBuilder.java:1911)
        at 
org.apache.ws.commons.schema.SchemaBuilder.handleImport(SchemaBuilder.java:1708)
        at 
org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:126)
        at 
org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:53)
        at 
org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:255)
        at 
org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:217)
        at 
org.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema(SchemaBuilder.java:1911)
        at 
org.apache.ws.commons.schema.SchemaBuilder.handleImport(SchemaBuilder.java:1708)
        at 
org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:126)
        at 
org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:53)
        at 
org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:255)
        at 
org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:217)
        at 
org.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema(SchemaBuilder.java:1911)
        at 
org.apache.ws.commons.schema.SchemaBuilder.handleImport(SchemaBuilder.java:1708)
        at 
org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:126)
        [... last 6 lines repeated over and over]

BTW, these files are working with Axis 1.4 wsdl2java. And according to XMLSpy 
my wsdl and schemas are valid, but that doesn't mean anything. 

Thanks you very much,
Oliver



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

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to