小编Kre*_*vat的帖子

XmlSchemaCollection.read()的NoSuchMethodError

我继续为XmlSchemaCollection.read(Lorg/xml/sax/InputSource;)设置NoSuchMethodError,我发现旧版本的XMLSchema存在问题:org.apache.ws.commons.schema.XmlSchemaCollection.read(InputSource).我改变了maven依赖,但错误不断重复.

Caused by: java.lang.NoSuchMethodError: org.apache.ws.commons.schema.XmlSchemaCollection.read(Lorg/xml/sax/InputSource;)Lorg/apache/ws/commons/schema/XmlSchema;
at org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection.afterPropertiesSet(CommonsXsdSchemaCollection.java:137)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
... 55 more
Run Code Online (Sandbox Code Playgroud)

maven依赖

<dependency>
        <groupId>org.springframework.ws</groupId>
        <artifactId>spring-xml</artifactId>
        <version>2.1.0.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>org.apache.ws.xmlschema</groupId>
        <artifactId>xmlschema-core</artifactId>
        <version>2.0.3</version>
    </dependency>
Run Code Online (Sandbox Code Playgroud)

架构集合bean

<bean id="schemaCollection" class="org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection">
    <property name="xsds" value="/message.xsd"/>
    <property name="inline" value="true"/>
</bean>
Run Code Online (Sandbox Code Playgroud)

java xml spring

5
推荐指数
1
解决办法
9981
查看次数

标签 统计

java ×1

spring ×1

xml ×1