Java. lang. IncompatibleClassChangeError: Implementing class solution. After a day, the solution is finally solved. implementingclass

Source: Internet
Author: User

Java. lang. IncompatibleClassChangeError: Implementing class solution. After a day, the solution is finally solved. implementingclass

I. background

After git updates the code and restarts the server, the problem is inexplicably generated. When I read the error message, I basically couldn't understand it, and then I checked it in hundreds of times, it basically said that the jar package conflicts, so point the finger at maven.

Ii. Problem Solving Process

Since it is determined that it is a maven problem, according to the consistent method, clean --> package, tried n times, including deleting repository, deleting a project, re-Downloading git, and so on, as a result, every time the server is started, the original strange error message is now in front of you, and you can feel the feeling of hitting the computer,

Later, I decided to expand the scope of the cause of the problem and narrow down the scope and eliminate it step by step. There are only three reasons for this error: idea problems, maven problems, and tomcat problems. next, we took the test path.

1. Test maven and idea

Use the original command line to write the maven command out of the idea environment: mvn install-dmaven. test. skip = true-dmaven. development = true; test whether the package will report an error. The result is as follows:

Obviously, the test is successful. In this step, it is certain that the effect of packaging with maven is the same as that of integrating maven with idea. Therefore, it can be determined that maven configured with idea is normal, everything works.

Next, we need to test whether there is any problem with the war package played by maven. We can throw the war package we have made to another computer for testing. If it is OK, it runs successfully, proving that maven is okay and that the war package is okay, proved that the previous idea was wrong.

2. Test tomcat and idea

As before, test tomcat in the idea environment, delete the work directory, delete the project under the webapp, put the war package that was previously played under the webapp, and find startup in the bin directory. bat, click to run, then you will find that the familiar errors appear in front of you, it does not matter, soon you will not see, it is obvious that your tomcat has a problem. the following error message is displayed:

December 17 10:13:31 am org. apache. catalina. loader. webappClassLoader validateJarFile information: validateJarFile (F: \ eclipseworkspace \ pop-auction-center-law_new \ pop-auction-center-web \ target \ pop-auction-center-web \ WEB-INF \ lib \ servlet-api-2.5.jar) -jar not loaded. see Servlet Spec 2.3, section 9.7.2. offending class: javax/servlet/Servlet. class December 17, 2016 10:13:40 am org. apache. catalina. startup. hostConfig deployDirectory information: Deploying web application directory manager, December 17, 10:13:46, 2016 org. apache. tomcat. util. modeler. baseModelMBean invoke is serious: Exception invoking method manageAppjava. lang. incompatibleClassChangeError: Implementing classat 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: 2775) at org. apache. catalina. loader. webappClassLoader. findClass (WebappClassLoader. java: 1115) at org. apache. catalina. loader. webappClassLoader. loadClass (WebappClassLoader. java: 1610) at org. apache. catalina. loader. webappClassLoader. loadClass (WebappClassLoader. java: 1488) at org. apache. catalina. startup. contextConfig. checkHandlesTypes (ContextConfig. java: 1945) at org. apache. catalina. startup. contextConfig. processAnnotationsStream (ContextConfig. java: 1908) at org. apache. catalina. startup. contextConfig. processAnnotationsJar (ContextConfig. java: 1795) at org. apache. catalina. startup. contextConfig. processAnnotationsUrl (ContextConfig. java: 1754) at org. apache. catalina. startup. contextConfig. processAnnotations (ContextConfig. java: 1740) at org. apache. catalina. startup. contextConfig. webConfig (ContextConfig. java: 1245) at org. apache. catalina. startup. contextConfig. configureStart (ContextConfig. java: 874) at org. apache. catalina. startup. contextConfig. lifecycleEvent (ContextConfig. java: 317) 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: 4881) 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: 583) at org. apache. catalina. startup. hostConfig. manageApp (HostConfig. java: 1379) at sun. reflect. nativeMethodAccessorImpl. invoke0 (Native Method) at sun. reflect. nativeMethodAccessorImpl. invoke (NativeMethodAccessorImpl. java: 57)

So I had to re-install tomcat and test it. It turned out to be a success. Through this solution, I realized that unfamiliar problems are not a stumbling block to your continued development, it is important to analyze and solve the problem.

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.