Announcement Announcement Module
Collapse
No announcement yet.
Bug with importing multiple XSDs in one wsdl Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bug with importing multiple XSDs in one wsdl

    I am trying to import multiple xsds but for some reason, even with simple solution below, its throwin the error below:

    My spring-ws-servlet.xml snippet:

    <bean id="reporting" class="org.springframework.ws.wsdl.wsdl11.DefaultW sdl11Definition">
    <property name="builder">
    <bean class="org.springframework.ws.wsdl.wsdl11.builder. XsdBasedSoap11Wsdl4jDefinitionBuilder">
    <property name="schemaCollection" ref="schemaCollection" />
    <property name="portTypeName" value="Reporting" />
    <property name="locationUri"
    value="${reporting.protocol}://${reporting.host}:${reporting.port}/reporting/service" />
    <property name="targetNamespace" value="http://reporting/definitions" />
    </bean>
    </property>
    </bean>

    <bean id="schemaCollection" class="org.springframework.xml.xsd.commons.Commons XsdSchemaCollection">
    <property name="xsds">
    <list>
    <value>classpath:com/reporting/report1/web/xsd/report1.xsd</value>
    <value>classpath:com/reporting/report2/web/xsd/report2.xsd</value>
    </list>
    </property>
    <property name="inline" value="true" />
    </bean>

    Error:

    2009-07-07 17:52:37.762:/:WARN: unavailable
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean wit
    h name 'reporting' defined in URL [file:/C:/resin-3.0.22/webapps/Reporti
    ng_maven/target/classes/com/reporting/collaboration/web/spring-ws-serv
    let.xml]: Cannot create inner bean 'org.springframework.ws.wsdl.wsdl11.builder.X
    sdBasedSoap11Wsdl4jDefinitionBuilder#aaa10' of type [org.springframework.ws.wsdl
    .wsdl11.builder.XsdBasedSoap11Wsdl4jDefinitionBuil der] while setting bean proper
    ty 'builder'; nested exception is org.springframework.beans.factory.BeanCreation
    Exception: Error creating bean with name 'org.springframework.ws.wsdl.wsdl11.bui
    lder.XsdBasedSoap11Wsdl4jDefinitionBuilder#aaa10' defined in URL [file:/C:/resin
    -3.0.22/webapps/Reporting_maven/target/classes/com/reporting/c
    ollaboration/web/spring-ws-servlet.xml]: Cannot resolve reference to bean 'schem
    aCollection' while setting bean property 'schemaCollection'; nested exception is
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'schemaCollecti
    on' defined in URL [file:/C:/resin-3.0.22/webapps/Reporting_maven/tar
    get/classes/com/reporting/collaboration/web/spring-ws-servlet.xml]: Insta
    ntiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org
    /apache/ws/commons/schema/resolver/URIResolver
    Caused by: org.springframework.beans.factory.BeanCreationExce ption: Error creati
    ng bean with name 'schemaCollection' defined in URL [file:/C:/resin-3.0.22/webap
    ps/Reporting_maven/target/classes/com/reporting/collaboration/
    web/spring-ws-servlet.xml]: Instantiation of bean failed; nested exception is ja
    va.lang.NoClassDefFoundError: org/apache/ws/commons/schema/resolver/URIResolver
    Caused by: java.lang.NoClassDefFoundError: org/apache/ws/commons/schema/resolver
    /URIResolver
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Cla ss.java:2357)
    at java.lang.Class.getConstructor0(Class.java:2671)
    at java.lang.Class.getDeclaredConstructor(Class.java: 1953)

  • #2
    any ideas on above?
    or any other easier way to import or have multiple XSDs (in different directory) in one wsdl?

    thanks very much !

    Comment


    • #3
      changed my servlet a little bit to:

      ----------------
      <bean id="reporting" class="org.springframework.ws.wsdl.wsdl11.DefaultW sdl11Definition">
      <property name="schemaCollection">
      <bean class="org.springframework.xml.xsd.commons.Commons XsdSchemaCollection">
      <property name="xsds">
      <list>
      <value>classpath:com/reporting/report1/web/xsd/report1.xsd
      </value>
      <value>classpath:com/reporting/report2/web/xsd/report2.xsd
      </value>
      </list>
      </property>
      <property name="inline" value="true" />
      </bean>
      </property>
      <property name="portTypeName" value="Reporting" />
      <property name="locationUri" value="${reporting.protocol}://${reporting.host}:${reporting.port}/reporting/service" />
      <property name="targetNamespace" value="some value" />
      </bean>

      -----------------------------------
      now I am getting following error which is weird as i have XmlSchemaObject jar version 1.4.4.

      Caused by: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.xml.xsd.commons.CommonsXsdSch emaCollection#612fcbd8' defined in URL [file:/usr/local/bin/workspace/Reporting_maven/target/classes/com/reporting/collaboration/web/spring-ws-servlet.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/ws/commons/schema/XmlSchemaObject
      Caused by: java.lang.NoClassDefFoundError: org/apache/ws/commons/schema/XmlSchemaObject
      at java.lang.Class.getDeclaredConstructors0(Native Method)
      at java.lang.Class.privateGetDeclaredConstructors(Cla ss.java:2357)
      at java.lang.Class.getConstructor0(Class.java:2671)

      Comment


      • #4
        nm, got it figured out.

        Comment


        • #5
          Originally posted by bbharat View Post
          nm, got it figured out.
          Hi,
          I'm also facing the same problem. Can you post the solution pls.

          Thanks,
          S

          Comment


          • #6
            Caused by: java.lang.NoClassDefFoundError: org/apache/ws/commons/schema/resolver /URI

            XmlSchema.jar is missing


            <dependency>
            <groupId>org.apache.ws.commons.schema</groupId>
            <artifactId>XmlSchema</artifactId>
            <version>1.4.3</version>
            </dependency>

            try to add this jar hope it resolves

            Comment


            • #7
              Thanks a lot. Its working fine now.

              Comment

              Working...
              X