Project deployment to Tomat error: Jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending

Source: Internet
Author: User

Project deployment to the Tomcat report such as exceptions:

Java code
  1. 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

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.