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 Nathan Sowatskey <ns...@cisco.com> on 2006/07/07 17:12:22 UTC

Axis2 - Problem finding referenced schema files using WSDL2Java

Hi

I have just started trying out Axis2 on a set of files that I had  
previously been using Axis 1.x on.

With 1.x the WSDL2Java invocation worked fine, all referenced files  
were found and the code generated as expected (if it were not for  
xsd:unions, the story would end there).

But, in the stack trace below we can see that Discovery.xsd is being  
searched for in "/workspace/jax-rpc-axis2/src/main/resources/wsdl/ 
xsd" when it is actually in "/workspace/jax-rpc-axis2/src/main/ 
resources/xsd". I have checked this manually, and I know that the 1.x  
WSDL2Java processes these files correctly.

Does anyone have any ideas here?

Many thanks

Nathan

java -cp $CLASSPATH org.apache.axis2.wsdl.WSDL2Java -uri src/main/ 
resources/wsdl/transport/http/DiscoveryServiceSOAP_HTTP.wsdl -o  
"target/generated-sources" -p  
"org.tmforum.mtosi.jaxrpc.axis2.DiscoveryServiceSOAP_HTTP" -ss -sd -d  
adb -g
Retrieving document at '../../binding/soap_http/ 
DiscoveryServiceSOAP.wsdl', relative to 'file:/workspace/jax-rpc- 
axis2/src/main/resources/wsdl/transport/http/'.
Retrieving document at '../../common/DiscoveryService.wsdl', relative  
to 'file:/workspace/jax-rpc-axis2/src/main/resources/wsdl/binding/ 
soap_http/DiscoveryServiceSOAP.wsdl'.
Retrieving schema at '../../xsd/interfaces/Discovery.xsd', relative  
to 'file:/workspace/jax-rpc-axis2/src/main/resources/wsdl/common/ 
DiscoveryService.wsdl'.
Retrieving schema at '../common/Header.xsd', relative to 'file:/ 
workspace/jax-rpc-axis2/src/main/resources/xsd/interfaces/ 
Discovery.xsd'.
Retrieving schema at 'HeaderVendorExtensions.xsd', relative to 'file:/ 
workspace/jax-rpc-axis2/src/main/resources/xsd/common/Header.xsd'.
Retrieving schema at 'Definitions.xsd', relative to 'file:/workspace/ 
jax-rpc-axis2/src/main/resources/xsd/common/HeaderVendorExtensions.xsd'.
Retrieving document at 'Exceptions.wsdl', relative to 'file:/ 
workspace/jax-rpc-axis2/src/main/resources/wsdl/common/ 
DiscoveryService.wsdl'.
Retrieving schema at '../../xsd/interfaces/Exceptions.xsd', relative  
to 'file:/workspace/jax-rpc-axis2/src/main/resources/wsdl/common/ 
Exceptions.wsdl'.
Retrieving schema at '../common/Header.xsd', relative to 'file:/ 
workspace/jax-rpc-axis2/src/main/resources/xsd/interfaces/ 
Exceptions.xsd'.
Retrieving schema at 'VendorExtensions.xsd', relative to 'file:/ 
workspace/jax-rpc-axis2/src/main/resources/xsd/interfaces/ 
Exceptions.xsd'.
Retrieving schema at '../common/Definitions.xsd', relative to 'file:/ 
workspace/jax-rpc-axis2/src/main/resources/xsd/interfaces/ 
VendorExtensions.xsd'.
log4j:WARN No appenders could be found for logger  
(org.apache.axis2.i18n.ProjectResourceBundle).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main"  
org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing  
WSDL
         at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init> 
(CodeGenerationEngine.java:94)
         at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
         at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
Caused by: org.apache.axis2.AxisFault:  
org.apache.ws.commons.schema.XmlSchemaException: /workspace/jax-rpc- 
axis2/src/main/resources/wsdl/xsd/interfaces/Discovery.xsd (No such  
file or directory); nested exception is:
         java.lang.RuntimeException:  
org.apache.ws.commons.schema.XmlSchemaException: /workspace/jax-rpc- 
axis2/src/main/resources/wsdl/xsd/interfaces/Discovery.xsd (No such  
file or directory)
         at  
org.apache.axis2.description.WSDL2AxisServiceBuilder.populateService 
(WSDL2AxisServiceBuilder.java:243)
         at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init> 
(CodeGenerationEngine.java:87)
         ... 2 more
Caused by: java.lang.RuntimeException:  
org.apache.ws.commons.schema.XmlSchemaException: /workspace/jax-rpc- 
axis2/src/main/resources/wsdl/xsd/interfaces/Discovery.xsd (No such  
file or directory)
         at  
org.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema 
(SchemaBuilder.java:1916)
         at  
org.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema 
(SchemaBuilder.java:1929)
         at org.apache.ws.commons.schema.SchemaBuilder.handleImport 
(SchemaBuilder.java:1714)
         at  
org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement 
(SchemaBuilder.java:126)
         at org.apache.ws.commons.schema.XmlSchemaCollection.read 
(XmlSchemaCollection.java:250)
         at  
org.apache.axis2.description.WSDL2AxisServiceBuilder.getXMLSchema 
(WSDL2AxisServiceBuilder.java:959)
         at  
org.apache.axis2.description.WSDL2AxisServiceBuilder.copyExtensibleEleme 
nts(WSDL2AxisServiceBuilder.java:1067)
         at  
org.apache.axis2.description.WSDL2AxisServiceBuilder.populateService 
(WSDL2AxisServiceBuilder.java:221)
         ... 3 more
Caused by: org.apache.ws.commons.schema.XmlSchemaException: / 
workspace/jax-rpc-axis2/src/main/resources/wsdl/xsd/interfaces/ 
Discovery.xsd (No such file or directory)
         at org.apache.ws.commons.schema.XmlSchemaCollection.read 
(XmlSchemaCollection.java:221)
         at  
org.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema 
(SchemaBuilder.java:1911)
         ... 10 more


Nathan Sowatskey - Technical Leader, NMTG CTO Engineering -  
+34-638-083-675, +34-91-201-2139 - AIM NathanCisco - nsowatsk@cisco.com

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis2 - Problem finding referenced schema files using WSDL2Java

Posted by Ajith Ranabahu <aj...@gmail.com>.
Hi,
Can you post your WSDL please ?

Ajith

On 7/7/06, Nathan Sowatskey <ns...@cisco.com> wrote:
> Hi
>
> I have just started trying out Axis2 on a set of files that I had
> previously been using Axis 1.x on.
>
> With 1.x the WSDL2Java invocation worked fine, all referenced files
> were found and the code generated as expected (if it were not for
> xsd:unions, the story would end there).
>
> But, in the stack trace below we can see that Discovery.xsd is being
> searched for in "/workspace/jax-rpc-axis2/src/main/resources/wsdl/
> xsd" when it is actually in "/workspace/jax-rpc-axis2/src/main/
> resources/xsd". I have checked this manually, and I know that the 1.x
> WSDL2Java processes these files correctly.
>
> Does anyone have any ideas here?
>
> Many thanks
>
> Nathan
>
> java -cp $CLASSPATH org.apache.axis2.wsdl.WSDL2Java -uri src/main/
> resources/wsdl/transport/http/DiscoveryServiceSOAP_HTTP.wsdl -o
> "target/generated-sources" -p
> "org.tmforum.mtosi.jaxrpc.axis2.DiscoveryServiceSOAP_HTTP" -ss -sd -d
> adb -g
> Retrieving document at '../../binding/soap_http/
> DiscoveryServiceSOAP.wsdl', relative to 'file:/workspace/jax-rpc-
> axis2/src/main/resources/wsdl/transport/http/'.
> Retrieving document at '../../common/DiscoveryService.wsdl', relative
> to 'file:/workspace/jax-rpc-axis2/src/main/resources/wsdl/binding/
> soap_http/DiscoveryServiceSOAP.wsdl'.
> Retrieving schema at '../../xsd/interfaces/Discovery.xsd', relative
> to 'file:/workspace/jax-rpc-axis2/src/main/resources/wsdl/common/
> DiscoveryService.wsdl'.
> Retrieving schema at '../common/Header.xsd', relative to 'file:/
> workspace/jax-rpc-axis2/src/main/resources/xsd/interfaces/
> Discovery.xsd'.
> Retrieving schema at 'HeaderVendorExtensions.xsd', relative to 'file:/
> workspace/jax-rpc-axis2/src/main/resources/xsd/common/Header.xsd'.
> Retrieving schema at 'Definitions.xsd', relative to 'file:/workspace/
> jax-rpc-axis2/src/main/resources/xsd/common/HeaderVendorExtensions.xsd'.
> Retrieving document at 'Exceptions.wsdl', relative to 'file:/
> workspace/jax-rpc-axis2/src/main/resources/wsdl/common/
> DiscoveryService.wsdl'.
> Retrieving schema at '../../xsd/interfaces/Exceptions.xsd', relative
> to 'file:/workspace/jax-rpc-axis2/src/main/resources/wsdl/common/
> Exceptions.wsdl'.
> Retrieving schema at '../common/Header.xsd', relative to 'file:/
> workspace/jax-rpc-axis2/src/main/resources/xsd/interfaces/
> Exceptions.xsd'.
> Retrieving schema at 'VendorExtensions.xsd', relative to 'file:/
> workspace/jax-rpc-axis2/src/main/resources/xsd/interfaces/
> Exceptions.xsd'.
> Retrieving schema at '../common/Definitions.xsd', relative to 'file:/
> workspace/jax-rpc-axis2/src/main/resources/xsd/interfaces/
> VendorExtensions.xsd'.
> log4j:WARN No appenders could be found for logger
> (org.apache.axis2.i18n.ProjectResourceBundle).
> log4j:WARN Please initialize the log4j system properly.
> Exception in thread "main"
> org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing
> WSDL
>          at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>
> (CodeGenerationEngine.java:94)
>          at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
>          at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
> Caused by: org.apache.axis2.AxisFault:
> org.apache.ws.commons.schema.XmlSchemaException: /workspace/jax-rpc-
> axis2/src/main/resources/wsdl/xsd/interfaces/Discovery.xsd (No such
> file or directory); nested exception is:
>          java.lang.RuntimeException:
> org.apache.ws.commons.schema.XmlSchemaException: /workspace/jax-rpc-
> axis2/src/main/resources/wsdl/xsd/interfaces/Discovery.xsd (No such
> file or directory)
>          at
> org.apache.axis2.description.WSDL2AxisServiceBuilder.populateService
> (WSDL2AxisServiceBuilder.java:243)
>          at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>
> (CodeGenerationEngine.java:87)
>          ... 2 more
> Caused by: java.lang.RuntimeException:
> org.apache.ws.commons.schema.XmlSchemaException: /workspace/jax-rpc-
> axis2/src/main/resources/wsdl/xsd/interfaces/Discovery.xsd (No such
> file or directory)
>          at
> org.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema
> (SchemaBuilder.java:1916)
>          at
> org.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema
> (SchemaBuilder.java:1929)
>          at org.apache.ws.commons.schema.SchemaBuilder.handleImport
> (SchemaBuilder.java:1714)
>          at
> org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement
> (SchemaBuilder.java:126)
>          at org.apache.ws.commons.schema.XmlSchemaCollection.read
> (XmlSchemaCollection.java:250)
>          at
> org.apache.axis2.description.WSDL2AxisServiceBuilder.getXMLSchema
> (WSDL2AxisServiceBuilder.java:959)
>          at
> org.apache.axis2.description.WSDL2AxisServiceBuilder.copyExtensibleEleme
> nts(WSDL2AxisServiceBuilder.java:1067)
>          at
> org.apache.axis2.description.WSDL2AxisServiceBuilder.populateService
> (WSDL2AxisServiceBuilder.java:221)
>          ... 3 more
> Caused by: org.apache.ws.commons.schema.XmlSchemaException: /
> workspace/jax-rpc-axis2/src/main/resources/wsdl/xsd/interfaces/
> Discovery.xsd (No such file or directory)
>          at org.apache.ws.commons.schema.XmlSchemaCollection.read
> (XmlSchemaCollection.java:221)
>          at
> org.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema
> (SchemaBuilder.java:1911)
>          ... 10 more
>
>
> Nathan Sowatskey - Technical Leader, NMTG CTO Engineering -
> +34-638-083-675, +34-91-201-2139 - AIM NathanCisco - nsowatsk@cisco.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
Ajith Ranabahu

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org