Project deployment to the Tomcat report such as exceptions:
Java code
- Jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending Class:javax/servlet/servlet.class
The reasons for this are likely to be:
First, the project Web-inf/lib under the Servlet-api.jar.
Second, under the Web-inf/lib of the project
There is a jar package containing the Javax.servlet package (such as the Weblogic.jar of WebLogic 8.1), causing a conflict with the servlet-api.jar of Tomcat itself.
Because Tomcat's WebappClassLoader loads the jar package, it checks.
Solution:
First, the Servlet-api.jar of the project should not be placed under the Web-inf/lib, under the project under a special directory (such as Lib), and then imported into the project through eclipse.
Secondly, for the second situation, for the moment I did not think of a simple solution, in my project due to a special requirement, Weblogic.jar is loaded by a custom class loader, not by Tomcat WebappClassLoader loaded, so the above problems are not there. If you encounter the same problem, you can learn from this scenario.
Project deployment to Tomat error: Jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending