I keep geting NoSuchMethodError for XmlSchemaCollection.read(Lorg/xml/sax/InputSource;), I found that there is problem in older versions of XMLSchema What happened to: org.apache.ws.commons.schema.XmlSchemaCollection.read(InputSource). I changed maven dependency but error keep repeating.
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
maven dependency
<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>
schema collection bean
<bean id="schemaCollection" class="org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection">
<property name="xsds" value="/message.xsd"/>
<property name="inline" value="true"/>
</bean>
It might be that some other library is depending on older version of xmlschema-core. check
mvn dependency:tree
if you see xmlschema-core in dome other library as dependency, then try to exclude it by using exclusion on parent dependency see Dependency Exclusions
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With