我继续为XmlSchemaCollection.read(Lorg / xml / sax / InputSource;)设置NoSuchMethodError,我发现旧版本的XMLSchema What happened to: 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
maven依赖
架构集合bean
最佳答案
可能是某些其他库依赖于旧版本的xmlschema-core.
校验
校验
mvn dependency:tree
如果你看到其他库中的xmlschema-core作为依赖项,那么尝试通过在父依赖项上使用排除来排除它
see Dependency Exclusions