A java.lang.IncompatibleClassChangeError problem-solving

Source: Internet
Author: User

The introduction of a third-party library to do a function, as usual, the introduction of the corresponding Pom, the other side of the package is Mina, so call the corresponding function when reported as follows error.

exception in thread  "Pool-18-thread-1"  java.lang.IncompatibleClassChangeErrorat  Org.apache.mina.core.filterchain.DefaultIoFilterChain.register (defaultiofilterchain.java:267) at  Org.apache.mina.core.filterchain.DefaultIoFilterChain.addLast (defaultiofilterchain.java:174) at  Org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder.buildFilterChain (Defaultiofilterchainbuilder.java : 436) At org.apache.mina.core.polling.abstractpollingioprocessor.addnow (Abstractpollingioprocessor.java : 528) At org.apache.mina.core.polling.abstractpollingioprocessor.handlenewsessions ( abstractpollingioprocessor.java:501) at org.apache.mina.core.polling.abstractpollingioprocessor.access$400 (abstractpollingioprocessor.java:67) at org.apache.mina.core.polling.abstractpollingioprocessor$ Processor.run (abstractpollingioprocessor.java:1116) At org.apache.mina.util.namepreservingrunnable.run ( NAMEPRESERVINGRUNNABLE.JAVA:51) 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)

Appears to be a incompatible error in Mina when a filter chain is registered for what function.

First of all suspect that this third-party library of Mina and my local service Mina conflict, so I found all the Mina in Pom and then commented out in turn. But in fact some POM internal also will rely on the Mina, so use mvn dependency tree command to view child dependency

MVN Dependency:tree >1.txt

Then exclusion off the corresponding Mina dependency in turn.

<exclusions> <exclusion> <groupId>org.apache.mina</groupId> <artifactid>mina- Core</artifactid> </exclusion></exclusions>

Then start, find or report the problem. Then debug to Defaultiofilterchain's Register method. Discover that Mina will inject logger and protocol in turn. Then the corresponding error is injected into the logger when the error. Then try to comment out the dependency of the corresponding log4j in turn. But there is still the problem.

==========================================================================================

In fact, this problem in the general environment has been resolved OK.

My side is caused by other reasons, the analysis continues: is not my local environment problem? So contacted the middleware classmate, found us tomcat under a basic service SAR packet, this SAR packet due to the version is too low, and Mina service conflict. The SAR package is upgraded (the SAR package does have a change to Mina). The problem is resolved and the service is called normally.

To sum up, this problem has been a whole day for me, in fact, it is just a kind of conflict, and finally escalated to the environmental problem. Here to summarize, to the later students drainage pit use.


Reference Document: Http://stackoverflow.com/questions/1980452/what-causes-java-lang-incompatibleclasschangeerror


A java.lang.IncompatibleClassChangeError problem-solving

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.