Camel:版本升级错误:java.lang.IncompatibleClassChangeError

时间:2017-10-24 07:17:28

标签: java apache apache-camel

升级驼峰版本时遇到问题(从2.16.5升级到2.20.0)。

请帮我解决此问题。

我得到的PFB错误: -

2017年10月23日15:57:39.571严重[localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild:start:      org.apache.catalina.LifecycleException:无法启动组件[StandardEngine [Catalina] .StandardHost [localhost] .StandardContext [/ APIGateway]]             在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)             在org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752)             在org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)             在org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)             在org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:952)             在org.apache.catalina.startup.HostConfig $ DeployWar.run(HostConfig.java:1823)             at java.util.concurrent.Executors $ RunnableAdapter.call(Executors.java:511)             at java.util.concurrent.FutureTask.run(FutureTask.java:266)             在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)             at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617)             在java.lang.Thread.run(Thread.java:748)

Caused by: java.lang.IncompatibleClassChangeError: Implementing class            
at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2277)
        at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:811)
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1254)
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
        at org.eclipse.jetty.websocket.server.NativeWebSocketConfiguration.<init>(NativeWebSocketConfiguration.java:51)
        at org.eclipse.jetty.websocket.server.NativeWebSocketServletContainerInitializer.getDefaultFrom(NativeWebSocketServletContainerInitializer.java:36)
        at org.eclipse.jetty.websocket.server.NativeWebSocketServletContainerInitializer.onStartup(NativeWebSocketServletContainerInitializer.java:46)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5178)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        ... 10 more
23-Oct-2017 15:57:39.592 SEVERE [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive /home/edc/MC/Apache-Tomcat/webapps-ui/APIGateway.war
 java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/APIGateway]]
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:756)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:952)
        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1823)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:748)

PFB pom.xml

            <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-io -->
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>2.5</version>  <!-- Latest version. -->
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.apache.directory.studio/org.apache.commons.io -->
            <dependency>
                <groupId>org.apache.directory.studio</groupId>
                <artifactId>org.apache.commons.io</artifactId>
                <version>2.4</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/commons-lang/commons-lang -->
            <dependency>
                <groupId>commons-lang</groupId>
                <artifactId>commons-lang</artifactId>
                <version>2.6</version>  <!-- Latest version. VULNERABLE BUT NO 2.7 YET! -->
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>3.6</version>  <!-- Latest version. -->
            </dependency>
            <!-- https://mvnrepository.com/artifact/commons-configuration/commons-configuration -->
            <dependency>
                <groupId>commons-configuration</groupId>
                <artifactId>commons-configuration</artifactId>
                <version>1.10</version> <!-- Latest version. SEVERE BUG BUT NO 1.11 YET!!! -->
            </dependency>

            <!-- https://mvnrepository.com/artifact/com.sun.jersey/jersey-client -->
            <dependency>
                <groupId>com.sun.jersey</groupId>
                <artifactId>jersey-client</artifactId>
                <version>1.19.4</version>   <!-- Latest version. -->
            </dependency>
            <!-- https://mvnrepository.com/artifact/com.sun.jersey/jersey-server -->
            <dependency>
                <groupId>com.sun.jersey</groupId>
                <artifactId>jersey-server</artifactId>
                <version>1.19.4</version>   <!-- Latest version. -->
            </dependency>
            <!-- https://mvnrepository.com/artifact/javax.ws.rs/javax.ws.rs-api -->
            <dependency>
                <groupId>javax.ws.rs</groupId>
                <artifactId>javax.ws.rs-api</artifactId>
                <version>2.1-m09</version>  <!-- Latest version. Dep of jersey client+server. -->
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.jboss.resteasy/resteasy-client -->
            <dependency>
                <groupId>org.jboss.resteasy</groupId>
                <artifactId>resteasy-client</artifactId>
                <version>3.1.4.Final</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.jboss.resteasy/resteasy-multipart-provider -->
            <dependency>
                <groupId>org.jboss.resteasy</groupId>
                <artifactId>resteasy-multipart-provider</artifactId>
                <version>3.1.4.Final</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.jboss.resteasy/resteasy-servlet-initializer -->
            <dependency>
                <groupId>org.jboss.resteasy</groupId>
                <artifactId>resteasy-servlet-initializer</artifactId>
                <version>3.1.4.Final</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.apache.qpid/qpid-amqp-1-0-client-jms -->
            <dependency>
                <groupId>org.apache.qpid</groupId>
                <artifactId>qpid-amqp-1-0-client-jms</artifactId>
                <version>0.32</version> <!-- Latest version. -->
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.apache.qpid/qpid-jms-client -->
            <dependency>
                <groupId>org.apache.qpid</groupId>
                <artifactId>qpid-jms-client</artifactId>
                <version>0.26.0</version>   <!-- Latest version. -->
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.scala-lang/scala-library -->
            <dependency>
                <groupId>org.scala-lang</groupId>
                <artifactId>scala-library</artifactId>
                <version>2.12.3</version>   <!-- Latest version. -->
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.zeroturnaround/zt-zip -->
            <dependency>
                <groupId>org.zeroturnaround</groupId>
                <artifactId>zt-zip</artifactId>
                <version>1.12</version> <!-- Latest version. -->
            </dependency>
            <!-- https://mvnrepository.com/artifact/io.netty/netty-handler -->
            <dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty-handler</artifactId>
                <version>4.1.14.Final</version> <!-- Earlier versions are vulnerable. -->
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-jar-plugin -->
            <dependency>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.0.2</version>    <!-- Latest version. -->
            </dependency>
            <!-- https://mvnrepository.com/artifact/javax.validation/validation-api -->
         <dependency>
                <groupId>javax.validation</groupId>
                <artifactId>validation-api</artifactId>
                <version>2.0.0.Final</version>  
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.hibernate.validator/hibernate-validator -->
            <dependency>
                <groupId>org.hibernate.validator</groupId>
                <artifactId>hibernate-validator</artifactId>
                <version>6.0.2.Final</version>  <!-- Latest version. -->
            </dependency>


            <!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>javax.servlet-api</artifactId>
                <version>3.1.0</version>
                <scope>provided</scope>
            </dependency>
            <!-- https://mvnrepository.com/artifact/javax.websocket/javax.websocket-api -->
            <dependency>
                <groupId>javax.websocket</groupId>
                <artifactId>javax.websocket-api</artifactId>
                <version>1.1</version>
                <scope>provided</scope>
            </dependency>


            <!-- https://mvnrepository.com/artifact/org.apache.camel/camel-core -->
            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-core</artifactId>
                <version>2.20.0</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.apache.camel/camel-spring -->
            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-spring</artifactId>
                <version>2.20.0</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.apache.camel/camel-servlet -->
            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-servlet</artifactId>
                <version>2.20.0</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.apache.camel/camel-http -->
            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-http</artifactId>
                <version>2.20.0</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.apache.camel/camel-jetty -->
            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-jetty</artifactId>
                <version>2.20.0</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.apache.camel/camel-base64 -->
            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-base64</artifactId>
                <version>2.20.0</version>
            </dependency>
            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-http4</artifactId>
                <version>2.20.0</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.apache.camel/camel-jackson -->
            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-jackson</artifactId>
                <version>2.20.0</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/com.thetransactioncompany/cors-filter -->
            <dependency>
                <groupId>com.thetransactioncompany</groupId>
                <artifactId>cors-filter</artifactId>
                <version>2.6</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.apache.camel/camel-spring-security -->
            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-spring-security</artifactId>
                <version>2.20.0</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.apache.camel/camel-websocket -->
            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-websocket</artifactId>
                <version>2.20.0</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.eclipse.persistence/javax.persistence -->
            <dependency>
                <groupId>org.eclipse.persistence</groupId>
                <artifactId>javax.persistence</artifactId>
                <version>2.1.1</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.eclipse.paho/org.eclipse.paho.client.mqttv3 -->
            <dependency>
                <groupId>org.eclipse.paho</groupId>
                <artifactId>org.eclipse.paho.client.mqttv3</artifactId>
                <version>1.2.0</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core -->
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-core</artifactId>
                <version>2.8.2</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/commons-logging/commons-logging -->
            <dependency>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
                <version>1.2</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/log4j/log4j -->
            <dependency>
                <groupId>log4j</groupId>
                <artifactId>log4j</artifactId>
                <version>1.2.17</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/log4j/apache-log4j-extras -->
            <dependency>
                <groupId>log4j</groupId>
                <artifactId>apache-log4j-extras</artifactId>
                <version>1.2.17</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
            <dependency>
                <groupId>org.postgresql</groupId>
                <artifactId>postgresql</artifactId>
                <version>42.1.4</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.apache.openjpa/openjpa -->
            <dependency>
                <groupId>org.apache.openjpa</groupId>
                <artifactId>openjpa</artifactId>
                <version>2.4.2</version>
                <exclusions>
                <exclusion>
                <groupId>javax.validation</groupId>
                <artifactId>validation-api</artifactId>
                </exclusion>
            </exclusions>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.apache.activemq.protobuf/activemq-protobuf -->
            <dependency>
                <groupId>org.apache.activemq.protobuf</groupId>
                <artifactId>activemq-protobuf</artifactId>
                <version>1.1</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.apache.activemq/activemq-console -->
            <dependency>
                <groupId>org.apache.activemq</groupId>
                <artifactId>activemq-console</artifactId>
                <version>5.15.1</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.apache.activemq/activemq-jaas -->
            <dependency>
                <groupId>org.apache.activemq</groupId>
                <artifactId>activemq-jaas</artifactId>
                <version>5.15.1</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.apache.activemq/activemq-mqtt -->
            <dependency>
                <groupId>org.apache.activemq</groupId>
                <artifactId>activemq-mqtt</artifactId>
                <version>5.15.1</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.apache.activemq/activemq-spring -->
            <dependency>
                <groupId>org.apache.activemq</groupId>
                <artifactId>activemq-spring</artifactId>
                <version>5.15.1</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.apache.activemq/activemq-web -->
            <dependency>
                <groupId>org.apache.activemq</groupId>
                <artifactId>activemq-web</artifactId>
                <version>5.15.1</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.apache.geronimo.specs/geronimo-j2ee-management_1.1_spec -->
            <dependency>
                <groupId>org.apache.geronimo.specs</groupId>
                <artifactId>geronimo-j2ee-management_1.1_spec</artifactId>
                <version>1.0.1</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.apache.geronimo.specs/geronimo-jms_1.1_spec -->
            <dependency>
                <groupId>org.apache.geronimo.specs</groupId>
                <artifactId>geronimo-jms_1.1_spec</artifactId>
                <version>1.1.1</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.fusesource.hawtbuf/hawtbuf -->
            <dependency>
                <groupId>org.fusesource.hawtbuf</groupId>
                <artifactId>hawtbuf</artifactId>
                <version>1.11</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.fusesource.mqtt-client/mqtt-client -->
            <dependency>
                <groupId>org.fusesource.mqtt-client</groupId>
                <artifactId>mqtt-client</artifactId>
                <version>1.14</version>
            </dependency>

            <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies -->
            <!-- Camden release train for Spring Cloud Dependencies requires Spring 
                Boot 1.4+, bump it to a higher version -->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>1.5.7.RELEASE</version>    <!-- Latest version. -->
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-dependencies -->
            <!-- RELEASE TRAINS: https://github.com/spring-projects/spring-cloud/wiki 
                - Spring Boot 1.2 => Spring Cloud Dependencies     "Angel.RELEASE" ...   "Angel.SR6" 
                - Spring Boot 1.3+ => Spring Cloud Dependencies  "Brixton.RELEASE" ... "Brixton.SR7" 
                - Spring Boot 1.4+ => Spring Cloud Dependencies   "Camden.RELEASE" ...  "Camden.SR7" 
                - Spring Boot 1.5+ => Spring Cloud Dependencies  "Dalston.RELEASE" ... "Dalston.SR2" 
                - Spring Boot 1.5+ => Spring Cloud Dependencies  "Edgware.M1" 
                - Spring Boot 1.5+ => Spring Cloud Dependencies "Finchley.M1"
            -->
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>Dalston.SR4</version>  <!-- Latest version for Spring Boot 1.5+ support. -->
                <type>pom</type>
                <scope>import</scope>
            </dependency>

1 个答案:

答案 0 :(得分:0)

您不能总是将每个JAR升级到最新版本。您应该支持使用maven瞬态依赖关系进入项目的JAR版本。

此外,它看起来像是一个包含大量JAR的大型项目,你可能会认为没有像这样的巨型项目。