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 Eric Chow <er...@gmail.com> on 2008/04/22 11:16:44 UTC

org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL

Hello,

When I tried to use wsdl2java to generate the Java Stub client, it
just raised the CodeGenerationException: Error parsing WSDL.

The attachment is my WSDL.

Please help me how can I generate the Java Client with Axis2 or Axis-1.4 ?



The following is the exception when using Axis2:

Buildfile: D:\Projects\workspace\office\eDocAlert\build.xml
init:
wsdl2java:
    [java] log4j:WARN No appenders could be found for logger
(org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder).
    [java] log4j:WARN Please initialize the log4j system properly.
    [java] Exception in thread "main"
org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing
WSDL
    [java]     at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:147)
    [java]     at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
    [java]     at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
    [java] Caused by: org.apache.axis2.AxisFault: Schema for
namespace 'http://context.axis2.apache.org/xsd' already contains type
'ConfigurationContext
    [java]     at org.apache.axis2.AxisFault.makeFault(AxisFault.java:417)
    [java]     at
org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(WSDL11ToAxisServiceBuilder.java:291)
    [java]     at
org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder.populateAllServices(WSDL11ToAllAxisServicesBuilder.java:109)
    [java]     at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:141)
    [java]     ... 2 more
    [java] Caused by: java.lang.RuntimeException: Schema for
namespace 'http://context.axis2.apache.org/xsd' already contains type
'ConfigurationContext
    [java]     at
org.apache.ws.commons.schema.XmlSchema.addType(XmlSchema.java:311)
    [java]     at
org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:158)
    [java]     at
org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:347)
    [java]     at
org.apache.axis2.description.WSDLToAxisServiceBuilder.getXMLSchema(WSDLToAxisServiceBuilder.java:140)
    [java]     at
org.apache.axis2.description.WSDL11ToAxisServiceBuilder.copyExtensibleElements(WSDL11ToAxisServiceBuilder.java:2186)
    [java]     at
org.apache.axis2.description.WSDL11ToAxisServiceBuilder.processTypes(WSDL11ToAxisServiceBuilder.java:306)
    [java]     at
org.apache.axis2.description.WSDL11ToAxisServiceBuilder.processTypes(WSDL11ToAxisServiceBuilder.java:297)
    [java]     at
org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(WSDL11ToAxisServiceBuilder.java:265)
    [java]     ... 4 more
    [java] Java Result: 1
clean:
jar:
BUILD SUCCESSFUL
Total time: 1 second



Best regards,
Eric

Re: org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL

Posted by Eric Chow <er...@gmail.com>.
Hi Keith,

I know this. But the WSDL was provide by the service provider. I am
now going to use this WSDL to generate a stub but failed.
I tried to use Axis2's OMElement with ServiceClient to invoke the
service, it works. How strange is it? Would you please to teach me how
 I can generate the stub for that WSDL?

Best regards,
Eric



On Tue, Apr 22, 2008 at 5:34 PM, keith chapman <ke...@gmail.com> wrote:
> Hi Eric,
>
> Your schema contains duplicate entries for ConfigurationContext (Lines
> 445-482)
>
> <xs:complexType name="ConfigurationContext">
>                 <xs:complexContent>
>                     <xs:extension base="ns10:AbstractContext">
>                          <xs:sequence>
>                             <xs:element minOccurs="0"
> name="axisConfiguration" nillable="true" type="ax244:AxisConfiguration"/>
>                              <xs:element minOccurs="0" name="contextRoot"
> nillable="true" type="xs:string"/>
>                             <xs:element minOccurs="0" name="listenerManager"
> nillable="true" type="ax244:ListenerManager"/>
>                              <xs:element minOccurs="0" name="rootContext"
> nillable="true" type="ns10:ConfigurationContext"/>
>                             <xs:element minOccurs="0"
> name="serviceContextPath" nillable="true" type="xs:string"/>
>                              <xs:element maxOccurs="unbounded" minOccurs="0"
> name="serviceGroupContextIDs" nillable="true" type="xs:string"/>
>                             <xs:element minOccurs="0"
> name="serviceGroupContextTimoutInterval" type="xs:long"/>
>                              <xs:element minOccurs="0"
> name="serviceGroupContexts" nillable="true" type="xs:anyType"/>
>                             <xs:element minOccurs="0" name="servicePath"
> nillable="true" type="xs:string"/>
>                              <xs:element minOccurs="0" name="threadPool"
> nillable="true" type="ax247:ThreadFactory"/>
>                             <xs:element minOccurs="0"
> name="transportManager" nillable="true" type="ax244:ListenerManager"/>
>                          </xs:sequence>
>                     </xs:extension>
>                 </xs:complexContent>
>             </xs:complexType>
>             <xs:complexType name="ConfigurationContext">
>                  <xs:complexContent>
>                     <xs:extension base="ns10:AbstractContext">
>                         <xs:sequence>
>                             <xs:element minOccurs="0"
> name="axisConfiguration" nillable="true" type="ax244:AxisConfiguration"/>
>                              <xs:element minOccurs="0" name="contextRoot"
> nillable="true" type="xs:string"/>
>                             <xs:element minOccurs="0" name="listenerManager"
> nillable="true" type="ax244:ListenerManager"/>
>                              <xs:element minOccurs="0" name="rootContext"
> nillable="true" type="ns10:ConfigurationContext"/>
>                             <xs:element minOccurs="0"
> name="serviceContextPath" nillable="true" type="xs:string"/>
>                              <xs:element maxOccurs="unbounded" minOccurs="0"
> name="serviceGroupContextIDs" nillable="true" type="xs:string"/>
>                             <xs:element minOccurs="0"
> name="serviceGroupContextTimoutInterval" type="xs:long"/>
>                              <xs:element minOccurs="0"
> name="serviceGroupContexts" nillable="true" type="xs:anyType"/>
>                             <xs:element minOccurs="0" name="servicePath"
> nillable="true" type="xs:string"/>
>                              <xs:element minOccurs="0" name="threadPool"
> nillable="true" type="ax247:ThreadFactory"/>
>                             <xs:element minOccurs="0"
> name="transportManager" nillable="true" type="ax244:ListenerManager"/>
>                          </xs:sequence>
>                     </xs:extension>
>                 </xs:complexContent>
>             </xs:complexType>
>
> Thanks,
> Keith.
>
>
>
>  On Tue, Apr 22, 2008 at 2:46 PM, Eric Chow <er...@gmail.com> wrote:
> >
> >
> >
> > Hello,
> >
> > When I tried to use wsdl2java to generate the Java Stub client, it
> > just raised the CodeGenerationException: Error parsing WSDL.
> >
> > The attachment is my WSDL.
> >
> > Please help me how can I generate the Java Client with Axis2 or Axis-1.4 ?
> >
> >
> >
> > The following is the exception when using Axis2:
> >
> > Buildfile: D:\Projects\workspace\office\eDocAlert\build.xml
> > init:
> > wsdl2java:
> >    [java] log4j:WARN No appenders could be found for logger
> > (org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder).
> >    [java] log4j:WARN Please initialize the log4j system properly.
> >    [java] Exception in thread "main"
> > org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing
> > WSDL
> >    [java]     at
> >
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:147)
> >    [java]     at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
> >    [java]     at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
> >    [java] Caused by: org.apache.axis2.AxisFault: Schema for
> > namespace 'http://context.axis2.apache.org/xsd' already contains type
> > 'ConfigurationContext
> >    [java]     at org.apache.axis2.AxisFault.makeFault(AxisFault.java:417)
> >    [java]     at
> >
> org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(WSDL11ToAxisServiceBuilder.java:291)
> >    [java]     at
> >
> org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder.populateAllServices(WSDL11ToAllAxisServicesBuilder.java:109)
> >    [java]     at
> >
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:141)
> >    [java]     ... 2 more
> >    [java] Caused by: java.lang.RuntimeException: Schema for
> > namespace 'http://context.axis2.apache.org/xsd' already contains type
> > 'ConfigurationContext
> >    [java]     at
> > org.apache.ws.commons.schema.XmlSchema.addType(XmlSchema.java:311)
> >    [java]     at
> >
> org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:158)
> >    [java]     at
> >
> org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:347)
> >    [java]     at
> >
> org.apache.axis2.description.WSDLToAxisServiceBuilder.getXMLSchema(WSDLToAxisServiceBuilder.java:140)
> >    [java]     at
> >
> org.apache.axis2.description.WSDL11ToAxisServiceBuilder.copyExtensibleElements(WSDL11ToAxisServiceBuilder.java:2186)
> >    [java]     at
> >
> org.apache.axis2.description.WSDL11ToAxisServiceBuilder.processTypes(WSDL11ToAxisServiceBuilder.java:306)
> >    [java]     at
> >
> org.apache.axis2.description.WSDL11ToAxisServiceBuilder.processTypes(WSDL11ToAxisServiceBuilder.java:297)
> >    [java]     at
> >
> org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(WSDL11ToAxisServiceBuilder.java:265)
> >    [java]     ... 4 more
> >    [java] Java Result: 1
> > clean:
> > jar:
> > BUILD SUCCESSFUL
> > Total time: 1 second
> >
> >
> >
> > Best regards,
> > Eric
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
>
>
>
> --
> Keith Chapman
> Senior Software Engineer
> WSO2 Inc.
>  Oxygenating the Web Service Platform.
> http://wso2.org/
>
> blog: http://www.keith-chapman.org

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


Re: org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL

Posted by keith chapman <ke...@gmail.com>.
Hi Eric,

Your schema contains duplicate entries for ConfigurationContext (Lines
445-482)

<xs:complexType name="ConfigurationContext">
                <xs:complexContent>
                    <xs:extension base="ns10:AbstractContext">
                        <xs:sequence>
                            <xs:element minOccurs="0"
name="axisConfiguration" nillable="true" type="ax244:AxisConfiguration"/>
                            <xs:element minOccurs="0" name="contextRoot"
nillable="true" type="xs:string"/>
                            <xs:element minOccurs="0" name="listenerManager"
nillable="true" type="ax244:ListenerManager"/>
                            <xs:element minOccurs="0" name="rootContext"
nillable="true" type="ns10:ConfigurationContext"/>
                            <xs:element minOccurs="0"
name="serviceContextPath" nillable="true" type="xs:string"/>
                            <xs:element maxOccurs="unbounded" minOccurs="0"
name="serviceGroupContextIDs" nillable="true" type="xs:string"/>
                            <xs:element minOccurs="0"
name="serviceGroupContextTimoutInterval" type="xs:long"/>
                            <xs:element minOccurs="0"
name="serviceGroupContexts" nillable="true" type="xs:anyType"/>
                            <xs:element minOccurs="0" name="servicePath"
nillable="true" type="xs:string"/>
                            <xs:element minOccurs="0" name="threadPool"
nillable="true" type="ax247:ThreadFactory"/>
                            <xs:element minOccurs="0"
name="transportManager" nillable="true" type="ax244:ListenerManager"/>
                        </xs:sequence>
                    </xs:extension>
                </xs:complexContent>
            </xs:complexType>
            <xs:complexType name="ConfigurationContext">
                <xs:complexContent>
                    <xs:extension base="ns10:AbstractContext">
                        <xs:sequence>
                            <xs:element minOccurs="0"
name="axisConfiguration" nillable="true" type="ax244:AxisConfiguration"/>
                            <xs:element minOccurs="0" name="contextRoot"
nillable="true" type="xs:string"/>
                            <xs:element minOccurs="0" name="listenerManager"
nillable="true" type="ax244:ListenerManager"/>
                            <xs:element minOccurs="0" name="rootContext"
nillable="true" type="ns10:ConfigurationContext"/>
                            <xs:element minOccurs="0"
name="serviceContextPath" nillable="true" type="xs:string"/>
                            <xs:element maxOccurs="unbounded" minOccurs="0"
name="serviceGroupContextIDs" nillable="true" type="xs:string"/>
                            <xs:element minOccurs="0"
name="serviceGroupContextTimoutInterval" type="xs:long"/>
                            <xs:element minOccurs="0"
name="serviceGroupContexts" nillable="true" type="xs:anyType"/>
                            <xs:element minOccurs="0" name="servicePath"
nillable="true" type="xs:string"/>
                            <xs:element minOccurs="0" name="threadPool"
nillable="true" type="ax247:ThreadFactory"/>
                            <xs:element minOccurs="0"
name="transportManager" nillable="true" type="ax244:ListenerManager"/>
                        </xs:sequence>
                    </xs:extension>
                </xs:complexContent>
            </xs:complexType>

Thanks,
Keith.

On Tue, Apr 22, 2008 at 2:46 PM, Eric Chow <er...@gmail.com> wrote:

> Hello,
>
> When I tried to use wsdl2java to generate the Java Stub client, it
> just raised the CodeGenerationException: Error parsing WSDL.
>
> The attachment is my WSDL.
>
> Please help me how can I generate the Java Client with Axis2 or Axis-1.4 ?
>
>
>
> The following is the exception when using Axis2:
>
> Buildfile: D:\Projects\workspace\office\eDocAlert\build.xml
> init:
> wsdl2java:
>    [java] log4j:WARN No appenders could be found for logger
> (org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder).
>    [java] log4j:WARN Please initialize the log4j system properly.
>    [java] Exception in thread "main"
> org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing
> WSDL
>    [java]     at
>
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:147)
>    [java]     at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
>    [java]     at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
>    [java] Caused by: org.apache.axis2.AxisFault: Schema for
> namespace 'http://context.axis2.apache.org/xsd' already contains type
> 'ConfigurationContext
>    [java]     at org.apache.axis2.AxisFault.makeFault(AxisFault.java:417)
>    [java]     at
>
> org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(WSDL11ToAxisServiceBuilder.java:291)
>    [java]     at
>
> org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder.populateAllServices(WSDL11ToAllAxisServicesBuilder.java:109)
>    [java]     at
>
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:141)
>    [java]     ... 2 more
>    [java] Caused by: java.lang.RuntimeException: Schema for
> namespace 'http://context.axis2.apache.org/xsd' already contains type
> 'ConfigurationContext
>    [java]     at
> org.apache.ws.commons.schema.XmlSchema.addType(XmlSchema.java:311)
>    [java]     at
>
> org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:158)
>    [java]     at
>
> org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:347)
>    [java]     at
>
> org.apache.axis2.description.WSDLToAxisServiceBuilder.getXMLSchema(WSDLToAxisServiceBuilder.java:140)
>    [java]     at
>
> org.apache.axis2.description.WSDL11ToAxisServiceBuilder.copyExtensibleElements(WSDL11ToAxisServiceBuilder.java:2186)
>    [java]     at
>
> org.apache.axis2.description.WSDL11ToAxisServiceBuilder.processTypes(WSDL11ToAxisServiceBuilder.java:306)
>    [java]     at
>
> org.apache.axis2.description.WSDL11ToAxisServiceBuilder.processTypes(WSDL11ToAxisServiceBuilder.java:297)
>    [java]     at
>
> org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(WSDL11ToAxisServiceBuilder.java:265)
>    [java]     ... 4 more
>    [java] Java Result: 1
> clean:
> jar:
> BUILD SUCCESSFUL
> Total time: 1 second
>
>
>
> Best regards,
> Eric
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>



-- 
Keith Chapman
Senior Software Engineer
WSO2 Inc.
Oxygenating the Web Service Platform.
http://wso2.org/

blog: http://www.keith-chapman.org