JAR Package and WebLIB under Tomcat5

xiaoxiao2021-03-06  49

I am learning Struts, start Tomcat5, basically normal, open ordinary JSP is normal, but open the JSP error associated with struts, as follows: javax.servlet.jsp.pageContext.HandlepageException (ljava / lang / V org.apache.jasper.servlet.jspservlet.service (jspservlet.java: 256) javax.servlet.http.httpservlet.Service (httpservlet.java: 868)

Root Cause

java.lang.NoSuchMethodError: javax.servlet.jsp.PageContext.handlePageException (Ljava / lang / Throwable;) V org.apache.jsp.manager_005findex_jsp._jspService (manager_005findex_jsp.java:84) org.apache.jasper.runtime.HttpJspBase. service (HttpJspBase.java:133) javax.servlet.http.HttpServlet.service (HttpServlet.java:868) org.apache.jasper.servlet.JspServletWrapper.service (JspServletWrapper.java:311) org.apache.jasper.servlet. JSPSERVLET.SERVICEJSPFILE (jspservlet.java:301) Org.apache.jasper.servlet.jspservlet.Service (jspservlet.java: 248) javax.servlet.http.httpservlet.service (httpservlet.java: 868)

View Tomcat5 Console Monitor Discover some exceptions: Information: Validatejarfile (C: / Program Files / Apache Software Foundation / Tomcat 5.0 / WebApps / SOOS / Web-INF / LIB / Servlet-Api.jar) - JAR Not Loaded. See Servlet Spec 2.3 , Section 9.7.2. Offending Class: Javax / Servlet / Servlet.class

This remembered that I also put J2EE.jar and other packages in Tomcat / Common / Lib /, went to Common / Lib to unnecessary packages, guarantee Tomcat / Common / LIB / and Web-INF / LIB. JAR in a directory has no duplicate, and the problem is solved. It turned out that Tomcat started to read all the JAR packets under Tomcat / Common / Lib directory, if there is the same package in the web-inf / lib directory in the application in the webapps directory, it will not be loaded, estimated different versions A similar problem is also caused between the bag. So I recommend trying to put the JAR package in the Tomcat / Common / Lib directory, should be placed in a web-inf / lib directory.

转载请注明原文地址:https://www.9cbs.com/read-82700.html

New Post(0)