Tomcat output Servlet-api.jar-jar not loaded workaround
Console output information After Tomcat is started: Web-inf/lib/servlet-api.jar not loaded workaround
Info:starting Servlet Engine:apache tomcat/7.0.54
Dec 1:08:07 PM Org.apache.catalina.loader.WebappClassLoader validatejarfile
Info:validatejarfile (/home/www/xxx/web-inf/lib/servlet-api-2.3.jar)-jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending Class:javax/servlet/servlet.class
The Servlet-api.jar package is placed in the tomcat/common/lib/, and the Servlet-api-2.3.jar of the project under Web-inf/lib is deleted to ensure tomcat/common/lib/and web-inf/ The jar in both directories of Lib is not duplicated and the problem is resolved.
Tested if deleting the Servlet-api.jar packet in tomcat/common/lib/does not start properly.
When Tomcat starts, it reads all the jar packages in the Tomcat/common/lib directory into memory, and if the same package is found in the Web-inf/lib directory in the application in the WebApps directory, it cannot be loaded, and it is estimated that a similar problem can occur between different versions of the package.
This jar package can be excluded from MAVEN when compiling the package:
<!--Servlets--
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
POM configuration to remove the upper part
Another: not MAVEN package compilation can be opened in the war package with an extract file, directly delete the jar package
Tomcat output Servlet-api.jar-jar not loaded workaround