HTTP Status 500 - Servlet.init() for servlet springmvc threw exception solution--replace the jdk version of Eclipse and tomcat

The browser specific error is as follows:


      When using annotations, the above error will occur, but it can run successfully without using annotations. I checked the reference for an afternoon and finally found the problem.


      This reason is due to the inappropriate version, jdk1.8 supports spring and springMVC jar packages above 4.0, and jar packages below 4.0 need to be replaced by jdk to 1.7 and below. Or choose a jar package of version 4.0 or higher. This article will solve the problem caused by the incompatible jdk version. The jdk version is not compatible. You need to check the jdk version that tomcat and Eclipse are running.


The way to change the jdk version in Eclipse is as follows:

         Build Path-->Configure Build Path, as shown in the figure, click Add Library

   Select JRE Sysm Library

Select the jdk version as 1.7.



The way tomacat replaces the jdk version is as follows:

       click edit

 

      Select the jdk1.7 version, restart tomcat, and it will run successfully.



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325535044&siteId=291194637