Hi Robin , I tried http.xsd using the "-catalog" option . It works fine.
XJC seems do not invoke catalog resolver if the schemaLoacation defined with relative path like " /schemas/wsdl/wsdl.xsd", so I need to change the schemaLocation as following : <xs:import namespace="http://schemas.xmlsoap.org/wsdl/" schemaLocation="http://schemas/wsdl/a.xsd"/> And this is my catalog file : <!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd"> <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="public"> <rewriteSystem systemIdStartString="http://schemas/wsdl/a.xsd" rewritePrefix="jar:file:/mavenrepo/org/apache/cxf/cxf-common-schemas /2.0-incubator-M1-SNAPSHOT/cxf-common-schemas-2.0-incubator-M1-SNAPSHOT.jar! /schemas/wsdl/wsdl.xsd" /> </catalog> Regards Jim > -----Original Message----- > From: James Mao [mailto:[EMAIL PROTECTED] > Sent: Thursday, November 16, 2006 7:09 PM > To: [email protected]; [email protected] > Subject: Re: Importing schemas from jars > > > Resend this email, sorry if you received twice. > > Hi Robin, > > We only fixed this in the wsdl2java tools, I don't know how the jaxb xjc > resolve the resources, i have to ask a question in the jaxb mail list. > > The xjc catalog works only in jaxb example which use the the xjc ant > task, i tried to use in maven2 xjc plugin, seems not work properly , i > have to ask this also in jaxb mail list. > > The work-around solution i have is to create another maven plugin, the > plugin will read the xsd and turns out the dumy wsdl file which only > contain the schema, and then use the wsdl2java to generate the xsd java > types artifacts. > > I mean if it's urgent for you, i can do this for a tempo solution. > > BTW, the catalog is also a work-around solution for you, right? you are > not going to use catalog in the real system, right? > > Cheers, > James. > > > Hello, > > > > I would like to use the xsdtojava maven plugin to generate code for a > > schema that references a schema in the cxf-common-schemas jar. > > > > I tried adding a dependency to cxf-common-schemas and using the > > following import: > > > > <xs:import namespace="http://schemas.xmlsoap.org/wsdl/" > > schemaLocation="/schemas/wsdl/wsdl.xsd"/> > > > > However, xjc is unable to resolve "/schemas/wsdl/wsdl.xsd". I also > > tried using the "-catalog" option without any luck (it doesn't seem to > > search the classpath for resources either). > > > > Any suggestions? > > > > > > Thanks, > > Robin > > > > >
