java.lang.IncompatibleClassChangeError:实现类问题

时间:2015-05-28 15:27:13

标签: java maven

尝试在Tomcat服务器上运行我的应用程序时出现以下错误。看起来我的罐子里有冲突,但我不知道在哪里。你能帮我找一下吗?

感谢您的帮助!

错误:

May 28, 2015 4:20:04 PM org.apache.tomcat.util.modeler.BaseModelMBean invoke
SEVERE: Exception invoking method manageApp
java.lang.IncompatibleClassChangeError: Implementing class
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2818)
    at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1148)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1643)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
    at org.apache.catalina.startup.ContextConfig.checkHandlesTypes(ContextConfig.java:1969)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:1932)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1826)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1785)
    at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1771)
    at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1254)
    at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:881)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:316)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5103)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)
    at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1407)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
    at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:598)
    at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:547)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
    at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1487)
    at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:97)
    at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1328)
    at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1420)
    at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:848)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)
    at sun.rmi.transport.Transport$1.run(Transport.java:177)
    at sun.rmi.transport.Transport$1.run(Transport.java:174)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:556)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:811)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:670)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

mvn依赖:树

[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ Curiosity ---
[INFO] Curiosity:Curiosity:war:1.0-SNAPSHOT
[INFO] +- junit:junit:jar:3.8.1:test (scope not updated to compile)
[INFO] +- org.springframework:spring-core:jar:4.0.1.RELEASE:compile
[INFO] |  \- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] +- org.springframework:spring-web:jar:4.0.1.RELEASE:compile
[INFO] |  +- org.springframework:spring-aop:jar:4.0.1.RELEASE:compile
[INFO] |  |  \- aopalliance:aopalliance:jar:1.0:compile
[INFO] |  +- org.springframework:spring-beans:jar:4.0.1.RELEASE:compile
[INFO] |  \- org.springframework:spring-context:jar:4.0.1.RELEASE:compile
[INFO] +- org.springframework:spring-webmvc:jar:4.0.1.RELEASE:compile
[INFO] |  \- org.springframework:spring-expression:jar:4.0.1.RELEASE:compile
[INFO] +- org.apache.kafka:kafka_2.9.2:jar:0.8.0:compile
[INFO] |  +- org.apache.zookeeper:zookeeper:jar:3.3.4:compile
[INFO] |  |  \- jline:jline:jar:0.9.94:compile
[INFO] |  +- org.scala-lang:scala-library:jar:2.9.2:compile
[INFO] |  +- log4j:log4j:jar:1.2.15:compile
[INFO] |  |  +- javax.mail:mail:jar:1.4:compile
[INFO] |  |  |  \- javax.activation:activation:jar:1.1:compile
[INFO] |  |  +- com.sun.jdmk:jmxtools:jar:1.2.1:compile
[INFO] |  |  \- com.sun.jmx:jmxri:jar:1.2.1:compile
[INFO] |  +- net.sf.jopt-simple:jopt-simple:jar:3.2:compile
[INFO] |  +- org.slf4j:slf4j-simple:jar:1.6.4:compile
[INFO] |  +- org.scala-lang:scala-compiler:jar:2.9.2:compile
[INFO] |  +- com.101tec:zkclient:jar:0.3:compile
[INFO] |  +- org.xerial.snappy:snappy-java:jar:1.0.4.1:compile
[INFO] |  +- com.yammer.metrics:metrics-core:jar:2.2.0:compile
[INFO] |  \- com.yammer.metrics:metrics-annotation:jar:2.2.0:compile
[INFO] +- redis.clients:jedis:jar:2.6.0:compile
[INFO] |  \- org.apache.commons:commons-pool2:jar:2.0:compile
[INFO] +- org.mongodb:mongo-java-driver:jar:3.0.0-rc0:compile
[INFO] \- com.thehutgroup.mars:mars-client-interface:jar:1.16:compile
[INFO]    +- org.slf4j:slf4j-api:jar:1.6.1:compile
[INFO]    +- com.fasterxml.jackson.core:jackson-core:jar:2.5.1:compile
[INFO]    +- com.fasterxml.jackson.core:jackson-annotations:jar:2.5.1:compile
[INFO]    \- com.fasterxml.jackson.core:jackson-databind:jar:2.5.1:compile

的pom.xml

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>

    <!-- Spring dependencies -->
   <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-core</artifactId>
      <version>${spring.version}</version>
    </dependency>

    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-web</artifactId>
      <version>${spring.version}</version>

    </dependency>

    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-webmvc</artifactId>
      <version>${spring.version}</version>

    </dependency>

          <dependency>
              <groupId>org.apache.kafka</groupId>
              <artifactId>kafka_2.9.2</artifactId>
              <version>0.8.0</version>
          </dependency>



          <dependency>
              <groupId>redis.clients</groupId>
              <artifactId>jedis</artifactId>
              <version>2.6.0</version>
              <type>jar</type>
              <scope>compile</scope>
          </dependency>


          <!-- mongo client -->

          <dependency>
              <groupId>org.mongodb</groupId>
              <artifactId>mongo-java-driver</artifactId>
              <version>3.0.0-rc0</version>
          </dependency>

          <!-- Mars client interface -->
          <dependency>
              <groupId>com.thehutgroup.mars</groupId>
              <artifactId>mars-client-interface</artifactId>
              <version>1.16</version>
          </dependency>


      </dependencies>

1 个答案:

答案 0 :(得分:1)

在您的树依赖项中,我看到了:

let aString = "a string"
let interpolatedString = "contains \(aString)"

和此:

 +- org.slf4j:slf4j-simple:jar:1.6.4:compile

我建议您删除 +- org.slf4j:slf4j-api:jar:1.6.1:compile mars-client-interface,看看它的作用......