cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: jax-ws-catalog and resolving schemas in jars that do xsd:include
Date Wed, 02 Dec 2009 22:26:03 GMT

Is there any way you could create a small "hello world" type sample that 
demonstrates this?    This SOUNDS like a bug.   If you could attach a small 
test case to a JIRA, that would be a huge help.

You also don't mention what version of CXF.  The stack trace doesn't seem to 
line up with recent versions of CXF.   Definitely try with 2.2.5.

Dan


On Tue December 1 2009 4:24:23 am HÃ¥kan Dahl wrote:
> I can't get schema resolution from a jar-file (using jax-ws-catalog as per
> 4.4 Catalog Facility in the JAX-WS 2.1 spec) to work when:
> 
> * The referenced schema in a jar makes xsd:include on another schema in the
> jar (all schemas in a jar share the same namespace). Stacktrace below.
> 
> Shouldn't this be possible?
> 
> Note: xsd:import works but requires imported schema to be in another
> namespace.
> 
> 
> Projects look like:
> 
> common-types-domain1
>     META-INF/jax-ws-catalog.xml
>     schemas/domain1/domain1-schema1.xsd
>     schemas/domain1/domain1-schema2.xsd
> 
> wsdl-project-1
>     src\main\resources\schemas\GetX.xsd
>     src\main\resources\schemas\GetXService.wsdl
> 
> where the GetXService.wsdl imports GetX.xsd which imports
> domain1-schema2.xsd like this:
> 
> 
> GetX.xsd:
> 
>     <xsd:import namespace="http://www.example.org/schemas/domain1"
>         schemaLocation="
> http://www.example.org/schemas/domain1/domain1-schema2.xsd"/>
> 
> domain1-schema2.xsd:
> 
>     <xsd:include schemaLocation="domain1-schema1.xsd"/>
> 
> common-types-domain1/META-INF/jax-ws-catalog.xml:
> 
>     <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"
> prefer="system">
>       <system systemId="
> http://www.example.org/schemas/domain1/domain1-schema1.xsd"
>           uri="classpath:schemas/domain1/domain1-schema1.xsd"/>
>       <system systemId="
> http://www.example.org/schemas/domain1/domain1-schema2.xsd"
>           uri="classpath:schemas/domain1/domain1-schema2.xsd"/>
>     </catalog>
> 
> results in:
> 
> Caused by: org.apache.cxf.tools.common.ToolException: Thrown by JAXB :
> http://www.example.org/schemas/domain1/domain1-schema1.xsd
>     at
> org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBBindErrorListener.error(JA
> XBBindErrorListener.java:34) at
> com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.error(SchemaCompilerImpl.
> java:285) at com.sun.tools.xjc.ErrorReceiver.error(ErrorReceiver.java:90)
>  at
> com.sun.tools.xjc.reader.internalizer.DOMForest.parse(DOMForest.java:402)
>     at
> com.sun.tools.xjc.reader.internalizer.DOMForest.parse(DOMForest.java:301)
>     at
> com.sun.tools.xjc.reader.internalizer.AbstractReferenceFinderImpl.startElem
> ent(AbstractReferenceFinderImpl.java:95) at
> org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:527)
>     at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:240)
>     at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:277)
>     at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:246)
>     at com.sun.xml.bind.unmarshaller.DOMScanner.scan(DOMScanner.java:123)
>     at
> com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.parseSchema(SchemaCompile
> rImpl.java:135) at
> org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.addSchemas(JAX
> BDataBinding.java:253) at
> org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.initialize(JAX
> BDataBinding.java:196) at
> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJavaCon
> tainer.java:588) at
> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaConta
> iner.java:239) at
> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer
> .java:130) at
> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer
> .java:283) at
> org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83)
>     at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:103)
>     at
> org.apache.cxf.maven_plugin.WSDL2JavaMojo.processWsdl(WSDL2JavaMojo.java:33
> 7) ... 20 more
> Caused by: java.io.FileNotFoundException:
> http://www.example.org/schemas/domain1/domain1-schema1.xsd
>     ... 39 more
> 

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

Mime
View raw message