You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Oliver Grafe <og...@extremenetworks.com> on 2006/08/26 04:26:15 UTC
[AXIS2] WSDL2Java: SchemaLocation and relative path / circular im
ports
Hi!
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.ja
va:213)
at
org.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema(SchemaBuilder.ja
va:1911)
at
org.apache.ws.commons.schema.SchemaBuilder.handleImport(SchemaBuilder.java:1
708)
at
org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuil
der.java:126)
at
org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:53)
at
org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.ja
va:255)
at
org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.ja
va:217)
at
org.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema(SchemaBuilder.ja
va:1911)
at
org.apache.ws.commons.schema.SchemaBuilder.handleImport(SchemaBuilder.java:1
708)
at
org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuil
der.java:126)
at
org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:53)
at
org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.ja
va:255)
at
org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.ja
va:217)
at
org.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema(SchemaBuilder.ja
va:1911)
at
org.apache.ws.commons.schema.SchemaBuilder.handleImport(SchemaBuilder.java:1
708)
at
org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuil
der.java:126)
[... last 6 lines repeated over and over]
Is this a bug or am I doing something wrong here? 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
Re: [AXIS2] WSDL2Java: SchemaLocation and relative path / circular im ports
Posted by Martin Gainty <mg...@hotmail.com>.
Good Morning Dims and developer crew--
I have a need to access the request and response objects from AxisServlet (so I can display differing output)..I have accomplished this via the following edits-
AXIS Version 1.3
org.apache.axis.transport.http.AxisServlet.java
private MessageContext createMessageContext(AxisEngine engine,HttpServletRequest req,HttpServletResponse res)
{
MessageContext msgContext = new MessageContext(engine);
...
//at very end of method..
//save the response and request objects to msgContext
msgContext.setRequest(req);
msgContext.setResponse(res);
return msgContext;
}
and also these edits in
org.apache.axis.MessageContext.java
public class MessageContext implements SOAPMessageContext
{
public javax.servlet.http.HttpServletRequest request=null;
public javax.servlet.http.HttpServletResponse response=null;
public void setRequest(javax.servlet.http.HttpServletRequest request)
{
this.request = request;
}
public void setResponse(javax.servlet.http.HttpServletResponse response)
{
this.response = response;
}
public javax.servlet.http.HttpServletRequest getRequest()
{
return request;
}
public javax.servlet.http.HttpServletResponse getResponse()
{
return response;
}
} //class
Needless to say this is a one off which I believe should be merged in to the existing codebase..
Advice??
Martin --
*********************************************************************
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed. If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy. Thank you.
----- Original Message -----
From: "Davanum Srinivas" <da...@gmail.com>
To: <ax...@ws.apache.org>
Sent: Friday, August 25, 2006 11:52 PM
Subject: Re: [AXIS2] WSDL2Java: SchemaLocation and relative path / circular im ports
> Oliver,
>
> Please log a bug report and upload the tar. So that we can track the problem.
>
> thanks,
> dims
>
> On 8/25/06, Oliver Grafe <og...@extremenetworks.com> wrote:
>> Hi!
>>
>> 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.ja
>> va:213)
>> at
>> org.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema(SchemaBuilder.ja
>> va:1911)
>> at
>> org.apache.ws.commons.schema.SchemaBuilder.handleImport(SchemaBuilder.java:1
>> 708)
>> at
>> org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuil
>> der.java:126)
>> at
>> org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:53)
>> at
>> org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.ja
>> va:255)
>> at
>> org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.ja
>> va:217)
>> at
>> org.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema(SchemaBuilder.ja
>> va:1911)
>> at
>> org.apache.ws.commons.schema.SchemaBuilder.handleImport(SchemaBuilder.java:1
>> 708)
>> at
>> org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuil
>> der.java:126)
>> at
>> org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:53)
>> at
>> org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.ja
>> va:255)
>> at
>> org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.ja
>> va:217)
>> at
>> org.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema(SchemaBuilder.ja
>> va:1911)
>> at
>> org.apache.ws.commons.schema.SchemaBuilder.handleImport(SchemaBuilder.java:1
>> 708)
>> at
>> org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuil
>> der.java:126)
>> [... last 6 lines repeated over and over]
>>
>> Is this a bug or am I doing something wrong here? 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
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>
>>
>>
>
>
> --
> Davanum Srinivas : http://www.wso2.net (Oxygen for Web Service Developers)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
Re: [AXIS2] WSDL2Java: SchemaLocation and relative path / circular im ports
Posted by Davanum Srinivas <da...@gmail.com>.
Oliver,
Please log a bug report and upload the tar. So that we can track the problem.
thanks,
dims
On 8/25/06, Oliver Grafe <og...@extremenetworks.com> wrote:
> Hi!
>
> 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.ja
> va:213)
> at
> org.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema(SchemaBuilder.ja
> va:1911)
> at
> org.apache.ws.commons.schema.SchemaBuilder.handleImport(SchemaBuilder.java:1
> 708)
> at
> org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuil
> der.java:126)
> at
> org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:53)
> at
> org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.ja
> va:255)
> at
> org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.ja
> va:217)
> at
> org.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema(SchemaBuilder.ja
> va:1911)
> at
> org.apache.ws.commons.schema.SchemaBuilder.handleImport(SchemaBuilder.java:1
> 708)
> at
> org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuil
> der.java:126)
> at
> org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:53)
> at
> org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.ja
> va:255)
> at
> org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.ja
> va:217)
> at
> org.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema(SchemaBuilder.ja
> va:1911)
> at
> org.apache.ws.commons.schema.SchemaBuilder.handleImport(SchemaBuilder.java:1
> 708)
> at
> org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuil
> der.java:126)
> [... last 6 lines repeated over and over]
>
> Is this a bug or am I doing something wrong here? 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
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>
--
Davanum Srinivas : http://www.wso2.net (Oxygen for Web Service Developers)
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org