简体   繁体   English

在 Tomcat7 中成功运行,但在 centOS 中的 tomcat9 中出现错误

[英]Runs successfully in Tomcat7 but giving error in tomcat9 in centOS

I have a project in java.我在 java 有一个项目。 Which was currently running in Tomcat-7, JAVA-8 and postgres-9.3.目前在 Tomcat-7、JAVA-8 和 postgres-9.3 中运行。 I updated it to openjdk-11 and postgres-13 and tried to deploy it in tomcat9, but it is giving this error.我将它更新为 openjdk-11 和 postgres-13 并尝试在 tomcat9 中部署它,但它给出了这个错误。

 javax.servlet.ServletException: java.lang.NoSuchMethodError: 'java.lang.Object 
  org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(java.lang.String, java.lan$
    at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:666)
    at org.apache.jsp.layout1_jsp._jspService(Unknown Source)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:71)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)

I have tried solutions like playing with versions of jar in my WEB-INF/lib folder, but didn't work.我已经尝试过解决方案,例如在我的 WEB-INF/lib 文件夹中使用 jar 版本,但没有奏效。

Also tried this and this solutions.还尝试了这个这个解决方案。

You should clean the $CATALINA_BASE/work directory of your Tomcat installation.您应该清理 Tomcat 安装的$CATALINA_BASE/work目录。 You clearly have *.java and *.class files there which were compiled with the Tomcat 7 version of Jasper.您显然有*.java*.class文件,它们是用 Jasper 的 Tomcat 7 版本编译的。

Before deleting the files, stop Tomcat.在删除文件之前,停止 Tomcat。

This should solve your NoSuchMethodError , but the exception that triggered this message is still in your JSP.这应该可以解决您的NoSuchMethodError ,但触发此消息的异常仍在您的 JSP 中。 As remarked by Scary Wombat, you should consider using only EL expressions and JSTL tags in your JSP pages.正如 Scary Wombat 所说,您应该考虑在 JSP 页面中仅使用EL 表达式JSTL标签。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM