venus jar包冲突问题Error creating bean with name 'two': Invocation of init method failed; nested exceptio
错误信息为
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'two': Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.apache.ws.commons.schema.XmlSchemaCollection.getExtReg()Lorg/apache/ws/commons/schema/extensions/ExtensionRegistry;
这是在 AbstractApplicationContext 类下 refresh 方法中 destroyBeans方法 异常由catch BeansException抛出
控制台会出现类似于连接不上venus的异常,并停止tomcat
经过排除是jar包冲突的问题解决如下:
将web项目的pom.xml中找到相关冲突的jar包 我冲突的jar包为
<!-- <exclusion>
<groupId>org.apache.ws.commons</groupId>
<artifactId>XmlSchema</artifactId>
</exclusion> -->
将这个排除即可
注意排除时应注意NoSuchMethodError 后面对应的方法使用的是哪个jar包找到后将老版本排除留新版本