0

在我的 tomcat5.5 服务器上运行任何 JSP 时出现此异常。我需要添加任何 JAR 吗?请帮忙。

堆栈跟踪:

DEBUG http-8181-Processor25 org.apache.catalina.loader.WebappClassLoader -   Loading class from parent
FATAL http-8181-Processor25 org.apache.jasper.runtime.JspFactoryImpl - Exception initializing page context

java.lang.NoSuchMethodError: org.apache.tomcat.util.http.ServerCookie.appendCookieValue(Ljava/lang/StringBuffer;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZZ)V
    at org.apache.catalina.connector.Response.addCookieInternal(Response.java:970)
    at org.apache.catalina.connector.Request.doGetSession(Request.java:2285)
    at org.apache.catalina.connector.Request.getSession(Request.java:2031)
    at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:832)
    at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:843)
    at org.apache.jasper.runtime.PageContextImpl._initialize(PageContextImpl.java:136)
    at org.apache.jasper.runtime.PageContextImpl.initialize(PageContextImpl.java:113)
    at org.apache.jasper.runtime.JspFactoryImpl.internalGetPageContext(JspFactoryImpl.java:105)
    at org.apache.jasper.runtime.JspFactoryImpl.getPageContext(JspFactoryImpl.java:62)
    at org.apache.jsp.banner_jsp._jspService(banner_jsp.java:33)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
    at java.lang.Thread.run(Thread.java:619)
DEBUG http-8181-Processor25 org.apache.catalina.loader.WebappClassLoader - loadClass(javax.servlet.jsp.PageContext, false)
4

3 回答 3

1

检查您是否tomcat-coyote.jar$CATALINA_BASE/shared/lib/文件夹中。如果以某种方式存在,则在启动服务器时未将其加载到类路径。检查你在 conf/catalina.properties 中有这一行

server.loader=${catalina.home}/server/classes,${catalina.home}/server/lib/*.jar

如果是,那么您可能需要更新。你用的是什么环境。

于 2012-06-28T05:30:28.843 回答
0

我认为问题更多是您正在使用的 jar 版本或您在类路径中的 jar。由于所需的方法不可用,它试图指向正确的类版本。您的类路径中已经设置了哪些所有 jar?

于 2012-06-28T06:14:06.543 回答
0

你不会错过任何罐子。否则你会得到ClassNotFound exception. NoSuchMethodError表示罐子不兼容。您是否有任何机会更改(或从不同位置复制)/lib 中的 jar 文件,尤其jasper*.jar, tomcat-coyote是?

于 2012-06-28T06:14:27.707 回答