org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'Message': Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.apache.ws.commons.schema.XmlSchemaCollection.read(Lorg/w3c/dom/Document;Ljava/lang/String;)Lorg/apache/ws/commons/schema/XmlSchema;
问题描述:
XmlSchema JAR包冲突 :XmlSchema-1.4.7.jar (旧)和
xmlschema-core-2.0.3.jar (新)
解决方案:
去掉旧的,如果使用maven管理,在pom中加入
<dependency> <groupId>org.apache.ws.commons.schema</groupId> <artifactId>XmlSchema</artifactId> <version>1.4.2</version> <scope>provided</scope> </dependency>
只能作用在编译和测试时,同时没有传递性。