IncompatibleClassChangeError exception solution

tags: java  spring

The pom.xml of the maven project introduces jars of other services. The development environment runs normally, but when it is deployed to the server, it starts to report errors:

java.lang.IncompatibleClassChangeError: class org.springframework.core.type.classreading.ClassMetadataReadingVisitor has interface .....

Reason analysis: "IncompatibleClassChangeError" indicates a jar conflict, according to the following "org.springframework.core.type.classreading.ClassMetadataReadingVisitor" to find the jar. Find the URL: https://www.findjar.com/index.x Then enter the class path "classreading.ClassMetadataReadingVisitor", you can see the jar where "classreading.ClassMetadataReadingVisitor" is located, as shown below:

Then click any link in the search results in the above figure, you can see the dependent jar, as shown below:

in the image abovespring.jar and spring-core.jar are the dependent jars.
So it is the jar conflict brought by the spring version upgrade.
In analyzing the spring dependency package of the project, it is found that the original version is spring version 3.1, and the integrated service has changed the spring-core and spring-bean versions to version: 4.2, other Spring depends on the package but still 3.1. After testing, all the dependencies of spring have changed to 4.2 or 3.1, and new or previous services of the project will report errors, so it is necessary to analyze which packages need to be upgraded to 4.2 and which do not need to be upgraded?
The method is: according to the log file, find which jar the error class depends on, and then adjust the current jar version.

Intelligent Recommendation

Cause and solution for getOutputStream() exception

tomcat5 jsp appear getOutputStream() has already been called for this response abnormal cause and solution This error occurs in jsp under tomcat5. Generally, the output stream is used in jsp (such as ...

Hadoop Exception and solution

1.....When I wrote the Hadoop program today, there was such a problem.   Check the cause of the error:   2...z in the local test environment, when running the hadoop program on windows Eclip...

ConcurrentModificationException exception resolution and solution

First of all, I also found a reason and solution for the ConcurrentModificationException in a blog I found on the Internet. The source address is https://www.cnblogs.com/dolphin0520/p/3933551.html, an...

More Recommendation

TransformClassesWithDexBuilderForDebug exception solution

The application reported the following exception when running the installation: Error:Execution failed for task ':app:transformClassesWithDexBuilderForDebug'. > com.android.build.api.transform.Tran...

Struts java.lang.NoSuchMethodException exception solution

Have you ever encountered this kind of situation when you were doing a Struts project, you obviously have this action, but the system can not find this action. My reason is this: Originally this Actio...

MyBatis java.lang.UnsupportedOperationException exception solution

The following sql is a wrong example Where is the error, because an UnsupportedOperationException will occur, Reason: resultType represents the element type in the List, not the List itself. resultTyp...

ExceptionInInitializerError exception and solution in Java

When an exception occurs in a static initialization block, the JVM throws a java.lang.ExceptionInInitializerError exception. If you understand static variables in Java, you will know that they are ini...

A solution to the android.view.ViewRoot$CalledFromWrongThreadException exception

In the Android platform, when multi-threaded programming, it is often necessary to perform some processing in a separate thread other than the main thread, and then update the user interface display. ...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top