You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Bryan Stopp <bs...@gmail.com> on 2014/02/12 04:02:05 UTC

WSDL2Java XSD Resolution Error

I've done the google search, but have only come a couple of StackOverflow
entries, which don't help.

I'm seeing this stack trace when I run generate-sources:



[WARNING] <<my_path>>\MemberRequest.xsd [32:4]: src-resolve: Cannot resolve
the name 'simpleType:string20' to a(n) 'type definition' component.
org.xml.sax.SAXParseException; systemId: <<my_path>>\MemberRequest.xsd;
lineNumber: 32; columnNumber: 4; src-resolve: Cannot resolve the name
'simpleType:string20' to a(n) 'type definition' component.
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
    at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
    at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:437)
    at
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaErr(XSDHandler.java:4162)
    ...

    at
com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:94)
    at
org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:411)
    at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJavaContainer.java:603)
    at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:248)
    at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:142)


The plugin configuration is at the end of this email.


The MemberServices wsdl references a number of xsd files, one of which is
the MemberRequest.xsd. This file references the SimpleTypes.xsd schema from
the MemberRequest.xsd. I've tried it with and without the binding
definition in the plugin, but the result is the same.

This import is in the MemberRequest.xsd:

<xsd:import schemaLocation="SimpleTypes.xsd"
        namespace="http://mycompany.com/SimpleType" />


All of the files are in the same folder.

I can try to sanitize all of the files to provide them for review, but I am
hoping that's not necessary (there's alot to sanitize).


Does anyone have any idea why it can resolve the MemberRequest.xsd file and
it's namespaces, but not the SimpleTypes xsd and it's rules?


<plugin>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-codegen-plugin</artifactId>
    <version>2.6.2</version>
    <dependencies>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-api</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.woodstox</groupId>
            <artifactId>woodstox-core-asl</artifactId>
            <version>4.2.0</version>
        </dependency>
    </dependencies>
    <executions>
        <execution>
            <id>generate-sources</id>
            <phase>generate-sources</phase>
            <goals>
                <goal>wsdl2java</goal>
            </goals>
            <configuration>
                <sourceRoot>${basedir}/target/generated/cxf</sourceRoot>

                <wsdlOptions>
                    <wsdlOption>

 <wsdl>${basedir}/src/main/resources/wsdl/MemberServices.wsdl</wsdl>
                        <bindingFiles>

 <bindingFile>${basedir}/src/main/resources/wsdl/SimpleTypes.xsd</bindingFile>
                        </bindingFiles>
                        <extraargs>
                            <extraarg>-autoNameResolution</extraarg>
                            <extraarg>-aer=true</extraarg>
                            <extraarg>-verbose</extraarg>
                        </extraargs>
                    </wsdlOption>
                </wsdlOptions>
            </configuration>
        </execution>
    </executions>
</plugin>

Re: WSDL2Java XSD Resolution Error

Posted by Aki Yoshida <el...@gmail.com>.
you should get rid of the line
<bindingFile>${basedir}/src/main/resources/wsdl/SimpleTypes.xsd</bindingFile>
because that is not a schema file and not a binding file. A binding
file is needed only when you do some type/name mapping.

I suspect your problem is with your path? You are using windows and
your path <<mypath>> has some special characters or spaces etc?
Maybe you can spot in the trace which path is used to load that
SimpleTypes.xsd schema before the error that you spotted, which
complains about the missing type that was the result of failing to
load that schema.

2014-02-12 4:02 GMT+01:00 Bryan Stopp <bs...@gmail.com>:
> I've done the google search, but have only come a couple of StackOverflow
> entries, which don't help.
>
> I'm seeing this stack trace when I run generate-sources:
>
>
>
> [WARNING] <<my_path>>\MemberRequest.xsd [32:4]: src-resolve: Cannot resolve
> the name 'simpleType:string20' to a(n) 'type definition' component.
> org.xml.sax.SAXParseException; systemId: <<my_path>>\MemberRequest.xsd;
> lineNumber: 32; columnNumber: 4; src-resolve: Cannot resolve the name
> 'simpleType:string20' to a(n) 'type definition' component.
> at
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
>     at
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
>     at
> com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:437)
>     at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaErr(XSDHandler.java:4162)
>     ...
>
>     at
> com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:94)
>     at
> org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:411)
>     at
> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJavaContainer.java:603)
>     at
> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:248)
>     at
> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:142)
>
>
> The plugin configuration is at the end of this email.
>
>
> The MemberServices wsdl references a number of xsd files, one of which is
> the MemberRequest.xsd. This file references the SimpleTypes.xsd schema from
> the MemberRequest.xsd. I've tried it with and without the binding
> definition in the plugin, but the result is the same.
>
> This import is in the MemberRequest.xsd:
>
> <xsd:import schemaLocation="SimpleTypes.xsd"
>         namespace="http://mycompany.com/SimpleType" />
>
>
> All of the files are in the same folder.
>
> I can try to sanitize all of the files to provide them for review, but I am
> hoping that's not necessary (there's alot to sanitize).
>
>
> Does anyone have any idea why it can resolve the MemberRequest.xsd file and
> it's namespaces, but not the SimpleTypes xsd and it's rules?
>
>
> <plugin>
>     <groupId>org.apache.cxf</groupId>
>     <artifactId>cxf-codegen-plugin</artifactId>
>     <version>2.6.2</version>
>     <dependencies>
>         <dependency>
>             <groupId>org.apache.cxf</groupId>
>             <artifactId>cxf-api</artifactId>
>             <version>${cxf.version}</version>
>         </dependency>
>         <dependency>
>             <groupId>org.codehaus.woodstox</groupId>
>             <artifactId>woodstox-core-asl</artifactId>
>             <version>4.2.0</version>
>         </dependency>
>     </dependencies>
>     <executions>
>         <execution>
>             <id>generate-sources</id>
>             <phase>generate-sources</phase>
>             <goals>
>                 <goal>wsdl2java</goal>
>             </goals>
>             <configuration>
>                 <sourceRoot>${basedir}/target/generated/cxf</sourceRoot>
>
>                 <wsdlOptions>
>                     <wsdlOption>
>
>  <wsdl>${basedir}/src/main/resources/wsdl/MemberServices.wsdl</wsdl>
>                         <bindingFiles>
>
>  <bindingFile>${basedir}/src/main/resources/wsdl/SimpleTypes.xsd</bindingFile>
>                         </bindingFiles>
>                         <extraargs>
>                             <extraarg>-autoNameResolution</extraarg>
>                             <extraarg>-aer=true</extraarg>
>                             <extraarg>-verbose</extraarg>
>                         </extraargs>
>                     </wsdlOption>
>                 </wsdlOptions>
>             </configuration>
>         </execution>
>     </executions>
> </plugin>