项目POM 文件加入一个包后build没问题,Tomcat启动失败,后台报错如下。
Failed to read candidate component class ....
IncompatibleClassChangeError: class ClassMetadataReadingVisitor has interface ClassVisitor as super class
问题原因参见文章: http://www.cnblogs.com/taven/archive/2013/04/02/2994998.html
简言之就是 spring 的 类 ClassMetadataReadingVisitor 继承了 ClassVisitor 抽象类,但是在spring-asm 包中有个同名的 ClassVisitor 接口。
问题解决:mvn dependency:tree 查看包依赖
[INFO] \- org.apache.cxf:cxf-bundle:jar:2.7.11:compile
[INFO] +- org.apache.velocity:velocity:jar:1.7:compile
[INFO] +- wsdl4j:wsdl4j:jar:1.6.3:compile
[INFO] +- com.sun.xml.bind:jaxb-xjc:jar:2.1.13:compile
[INFO] +- com.sun.xml.bind:jaxb-impl:jar:2.1.13:compile
[INFO] +- org.apache.ws.xmlschema:xmlschema-core:jar:2.1.0:compile
[INFO] +- antlr:antlr:jar:2.7.7:compile
[INFO] +- org.apache.xmlbeans:xmlbeans:jar:2.6.0:compile
[INFO] +- xml-resolver:xml-resolver:jar:1.2:compile
[INFO] +- org.apache.geronimo.specs:geronimo-jaxws_2.2_spec:jar:1.1:compile
[INFO] +- org.codehaus.woodstox:woodstox-core-asl:jar:4.2.1:compile
[INFO] +- org.codehaus.woodstox:stax2-api:jar:3.1.4:compile
[INFO] +- org.apache.geronimo.specs:geronimo-javamail_1.4_spec:jar:1.7.1:compile
[INFO] +- org.eclipse.jetty:jetty-server:jar:8.1.14.v20131031:compile
[INFO] +- org.eclipse.jetty:jetty-continuation:jar:8.1.14.v20131031:compile
[INFO] +- org.eclipse.jetty:jetty-http:jar:8.1.14.v20131031:compile
[INFO] +- org.eclipse.jetty:jetty-io:jar:8.1.14.v20131031:compile
[INFO] +- org.eclipse.jetty:jetty-util:jar:8.1.14.v20131031:compile
[INFO] +- org.eclipse.jetty:jetty-security:jar:8.1.14.v20131031:compile
[INFO] +- org.apache.geronimo.specs:geronimo-servlet_3.0_spec:jar:1.0:compile
[INFO] +- org.apache.geronimo.specs:geronimo-jms_1.1_spec:jar:1.1.1:compile
[INFO] +- org.springframework:spring-jms:jar:3.0.7.RELEASE:compile
[INFO] +- aopalliance:aopalliance:jar:1.0:compile
[INFO]
+- org.springframework:spring-asm:jar:3.0.7.RELEASE:compile
[INFO] +- org.apache.httpcomponents:httpcore-nio:jar:4.2.4:compile
[INFO] +- org.apache.httpcomponents:httpcore:jar:4.2.4:compile
[INFO] +- org.apache.httpcomponents:httpasyncclient:jar:4.0-beta3:compile
[INFO] +- org.apache.httpcomponents:httpclient:jar:4.2.5:compile
[INFO] +- commons-codec:commons-codec:jar:1.9:compile
[INFO] +- org.apache.mina:mina-core:jar:2.0.7:compile
[INFO] +- rhino:js:jar:1.7R2:compile
[INFO] +- javax.ws.rs:javax.ws.rs-api:jar:2.0-m10:compile
[INFO] +- net.oauth.core:oauth-provider:jar:20100527:compile
[INFO] +- net.oauth.core:oauth:jar:20100527:compile
[INFO] +- net.sf.ehcache:ehcache-core:jar:2.5.1:compile
[INFO] +- org.apache.ws.security:wss4j:jar:1.6.15:compile
[INFO] +- org.apache.santuario:xmlsec:jar:1.5.6:compile
[INFO] +- org.opensaml:opensaml:jar:2.6.1:compile
[INFO] +- org.opensaml:openws:jar:1.5.1:compile
[INFO] +- org.opensaml:xmltooling:jar:1.4.1:compile
[INFO] +- joda-time:joda-time:jar:2.2:compile
[INFO] +- xalan:serializer:jar:2.7.1:runtime
[INFO] \- org.apache.neethi:neethi:jar:3.0.3:compile
可以看到对spring-asm.jar 的依赖,下面排除该依赖,重新部署, 成功运行。 over
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-bundle</artifactId>
<version>2.7.11</version>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-asm</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
</exclusion>
</exclusions>
</dependency>
ClassMetadataReadingVisitor has interface ClassVisitor as super class 问题解决
猜你喜欢
转载自feifangongzi.iteye.com/blog/2192835
今日推荐
周排行