Announcement Announcement Module
Collapse
No announcement yet.
WSDL generation fails on importing CommonsXsdSchemaCollection Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • WSDL generation fails on importing CommonsXsdSchemaCollection

    I'm trying to upgrade Spring Web Services from version 1.0.3 to version 1.5 and have encountered the following problem, when using the new feature of the DefaultWsdl11Definition.

    When trying to start tomcat and deploy my application I recieve the following error:

    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'MerchantAccountRequest' defined in ServletContext resource [/WEB-INF/blah-servlet.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateExcep tion; nested PropertyAccessExceptions (1) are:
    PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.springframework.xml.xsd.commons.CommonsXsdSche maCollection] to required type [org.springframework.xml.xsd.XsdSchema] for property 'schema'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [org.springframework.xml.xsd.commons.CommonsXsdSche maCollection] to required type [org.springframework.xml.xsd.XsdSchema] for property 'schema': no matching editors or conversion strategy found
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:1201)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:940)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:437)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory$1.run(AbstractAutowireC apableBeanFactory.java:383)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:353)
    at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 45)
    at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:169)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:242)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:164)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:400)
    at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:736)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:369)
    at org.springframework.web.servlet.FrameworkServlet.c reateWebApplicationContext(FrameworkServlet.java:3 32)
    at org.springframework.web.servlet.FrameworkServlet.i nitWebApplicationContext(FrameworkServlet.java:266 )
    at org.springframework.web.servlet.FrameworkServlet.i nitServletBean(FrameworkServlet.java:236)
    at org.springframework.web.servlet.HttpServletBean.in it(HttpServletBean.java:126)
    at javax.servlet.GenericServlet.init(GenericServlet.j ava:211)
    at org.apache.catalina.core.StandardWrapper.loadServl et(StandardWrapper.java:1105)
    at org.apache.catalina.core.StandardWrapper.allocate( StandardWrapper.java:757)
    at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:130)
    at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:178)
    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:869)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11 ConnectionHandler.processConnection(Http11BaseProt ocol.java:664)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.process Socket(PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThr ead.runIt(LeaderFollowerWorkerThread.java:80)
    at org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:684)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: org.springframework.beans.PropertyBatchUpdateExcep tion; nested PropertyAccessExceptions (1) are:
    PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.springframework.xml.xsd.commons.CommonsXsdSche maCollection] to required type [org.springframework.xml.xsd.XsdSchema] for property 'schema'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [org.springframework.xml.xsd.commons.CommonsXsdSche maCollection] to required type [org.springframework.xml.xsd.XsdSchema] for property 'schema': no matching editors or conversion strategy found

    I don't have the problem when i use the following config in my ws servlet, the service works fine:

    <bean id="schema" class="org.springframework.xml.xsd.SimpleXsdSchema ">
    <property name="xsd" value="/WEB-INF/xsd/MerchantAccount.xsd" />
    </bean>

    however i need to use the option to inline my xsds for muliple imports in one xsd for my wsdl but when i use the CommonsXsdSchemaCollection i get the error.

    <bean id="schemaCollection" class="org.springframework.xml.xsd.commons.Commons XsdSchemaCollection">
    <property name="xsds">
    <list>
    <value>/WEB-INF/xsd/MerchantAccount.xsd</value>
    </list>
    </property>
    <property name="inline" value="true" />
    </bean>


    MerchantAccount.xsd imports two other xsd files:

    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:blah1="http://blah/blah/ws/merchantaccount/schemas"
    xmlns:types="http://blah/blah/ws/types"
    xmlns:aciException="http://blah/blah/ws/domain/types/exception" elementFormDefault="qualified"
    targetNamespace="http://blah/blah/ws/merchantaccount/schemas"
    xmlns:jxb="http://java.sun.com/xml/ns/jaxb" jxb:version="2.0">

    <xs:annotation>
    <xs:appinfo>
    <jxb:schemaBindings>
    <jxbackage name="com.blah.blah.blah.ws.merchantaccount.schema "></jxbackage>
    </jxb:schemaBindings>
    </xs:appinfo>
    </xs:annotation>
    <xs:import namespace="http://www.blah/blah/ws/types" schemaLocation="StandardTypes.xsd" />
    <xs:import namespace="http://www.blah/blah/ws/domain/types/exception"
    schemaLocation="ExceptionTypes.xsd" />

    Any ideas where I'm going wrong? is it a library problem? All i've upgraded so far is the Spring-ws-1.5.0.jar and removed all 1.0.3 jars. I've also added the XmlSchema-1.3.2.jar to my classpath to fix a class not found error.

  • #2
    I've just found out what i was doing wrong.....

    On setting the properties on in the DefaultWsdl11Definition I was setting the "schema" type to my collection of schemas, rather than using the "schemaCollection" property type.

    Thanks, and sorry if i've wasted anyones time investigating this!

    Comment

    Working...
    X