Hello,
i've almost the same error.
So, i've created the following catalog.xml:

<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"
    prefer="system">
    <system systemId="http://www.w3.org/2001/XMLSchema"; uri="XMLSchema.xsd"
/>
</catalog>

the file XMLSchema.xsd is in the same dir of the catalog.xml.
Then I configured the cxf-codegen plugin like this:

 <plugin>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-codegen-plugin
                </artifactId>
                <version>2.2.1</version>
                <executions>
                    <execution>
                        <id>generate-sources</id>
                        <phase>generate-sources</phase>
                        <configuration>
                            <sourceRoot>
                                ${basedir}/target/generated/src/main/java
                            </sourceRoot>
                            <wsdlOptions>
                                <wsdlOption>
                                    <wsdl>

${basedir}/src/main/resources/wsdl/translate.wsdl
                                    </wsdl>
                                    <extraargs>
                                        <extraarg>-verbose
                                        </extraarg>
                                        <extraarg>-catalog</extraarg>

<extraarg>${basedir}/src/main/resources/wsdl/catalog.xml</extraarg>
                                    </extraargs>
                                </wsdlOption>
                            </wsdlOptions>
                        </configuration>
                        <goals>
                            <goal>wsdl2java</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>


Despite all this, i get:
Caused by: org.apache.maven.plugin.MojoExecutionException: Thrown by JAXB :
undefined element declaration 's:schema'
    at
org.apache.cxf.maven_plugin.WSDL2JavaMojo.processWsdl(WSDL2JavaMojo.java:363)
    at
org.apache.cxf.maven_plugin.WSDL2JavaMojo.execute(WSDL2JavaMojo.java:257)
    at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:453)
    at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:559)
    ... 16 more
Caused by: org.apache.cxf.tools.common.ToolException: Thrown by JAXB :
undefined element declaration 's:schema'
    at
org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBBindErrorListener.error(JAXBBindErrorListener.java:41)
    at
com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.error(SchemaCompilerImpl.java:285)
    at
com.sun.tools.xjc.util.ErrorReceiverFilter.error(ErrorReceiverFilter.java:77)
    at
com.sun.xml.xsom.impl.parser.ParserContext$2.error(ParserContext.java:166)
    at
com.sun.xml.xsom.impl.parser.ParserContext$1.reportError(ParserContext.java:144)
    at
com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.reportError(NGCCRuntimeEx.java:134)
    at com.sun.xml.xsom.impl.parser.DelayedRef.resolve(DelayedRef.java:89)
    at com.sun.xml.xsom.impl.parser.DelayedRef.run(DelayedRef.java:64)
    at
com.sun.xml.xsom.impl.parser.ParserContext.getResult(ParserContext.java:95)
    at com.sun.xml.xsom.parser.XSOMParser.getResult(XSOMParser.java:190)
    at com.sun.tools.xjc.ModelLoader.createXSOM(ModelLoader.java:519)
    at
com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:237)
    at
com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:85)
    at
org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:331)
    at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJavaContainer.java:557)
    at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:208)
    at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:127)
    at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:252)
    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:360)
    ... 19 more
Caused by: org.xml.sax.SAXParseException: undefined element declaration
's:schema'
    at
com.sun.xml.xsom.impl.parser.ParserContext$1.reportError(ParserContext.java:140)
    ... 35 more

Ideas ?

best regards,
valerio


On Mon, Aug 11, 2008 at 8:48 PM, Gord Turner
<[email protected]>wrote:

> Thanks Dan, I will do that.
>
> In the meantime, for some google bait and closure, another option is to
> change:
>
> <s:import namespace="http://www.w3.org/2001/XMLSchema"; />
>
> To:
>
> <s:import namespace="http://www.w3.org/2001/XMLSchema";
>           schemaLocation="http://www.w3.org/2001/XMLSchema.xsd"; />
>
> And leave the 's:element' and 's:any' alone.
>
> If I wanted to use this a catalog, can anyone tell me if this is a
> correct catalog for the above schemaLocation?
>
> <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"
> prefer="system">
>  <system systemId="http://www.w3.org/2001/XMLSchema";
> uri="XMLSchema.xsd"/>
> </catalog>
>
> Thanks,
> G.
>
> -----Original Message-----
> From: Daniel Kulp [mailto:[email protected]]
> Sent: Monday, August 11, 2008 12:28 PM
> To: [email protected]
> Cc: Gord Turner
> Subject: Re: Thrown by JAXB : undefined element declaration 's:schema'
>
>
> Probably the best thing to do is to log a bug at:
> https://jaxb.dev.java.net/issues/
> It may have  a chance of getting fixed then.   :-)
>
> I'm really not sure if there is any other way around it.    You might be
> able
> to ask on their mailing list as well:
> https://jaxb.dev.java.net/servlets/ProjectMailingListList
>
>
> Dan
>
>
>
>
> On Monday 11 August 2008 11:04:30 am Gord Turner wrote:
> > Hello all,
> >
> >
> >
> > I have a .NET wsdl generated by a third party that I am working with.
> > When I try to use the wsdl2java maven 2 plugin I get the error:
> >
> >
> >
> > Thrown by JAXB : undefined element declaration 's:schema'
> >
> >
> >
> > Is there a 'best practice' when dealing with these errors?
> >
> >
> >
> > I have replaced the lines:
> >
> >
> >
> > <s:element ref="s:schema" />
> >
> > <s:any />
> >
> >
> >
> > With:
> >
> >
> >
> > <s:any minOccurs="2" maxOccurs="2"/>
> >
> >
> >
> > I have done this 'by hand' and although it avoids the error, I don't
> > like this solution.  Please find the wsdl attached to this message.
> >
> >
> >
> > Any suggestions welcome,
> >
> > Gordo.
> >
> > Gordon Turner
> > direct: 416.646.7016
> >
> > main: 416.646.7000
> > fax: 416.646.7050
> >
> > Exchange Solutions Inc.
> > 250 Yonge Street, 18th Floor
> > Toronto, ON M5B 2L7
> > www.exchangesolutions.com
>
>
>
> --
> Daniel Kulp
> [email protected]
> http://www.dankulp.com/blog
>
>
>


-- 
http://www.linkedin.com/in/vschiavoni
http://jroller.com/vschiavoni

Reply via email to