gpt4 book ai didi

mysql - 在 Java Web 应用程序上出现错误 [无法为 JSP 编译类] 的根本原因

转载 作者:行者123 更新时间:2023-11-28 23:40:54 25 4
gpt4 key购买 nike

我使用带有 MYSQL 数据库的 hibernate 框架开发了一个 Web 应用程序,并遵循配置和 geeting 跟随错误。这在重新启动 tomcat 服务器后有效。这是仅有的内容...

    error.xhtml
index.xhtml
result.jsp

hibernate.cfg.xml

pdr
AccActivate.java
AccountBean.java
pdr.config
Config.java
pdr.entity
AccountDAO.java
CustomerAccountDAO.java
CustomerDAO.java
NfcAccountDAO.java
pdr.entity.sql
DuplicateEntry.java
SQLExceptionTypeDelegate.java
pdr.pojo
Account.java
Customer.java
CustomerAccount.hbm
CustomerAccount.java
NfcAccount.java
account.hbm
customer.hbm
nfc_account.hbm
pdr.util
ExceptionFiner.java
HibernateUtil.java
pdr.util.logger
Log.java
MyHtmlFormatter.java
MyHtmlFormatterExample.java
MyLogger.java
MyTestLogger.java
UseLogger.java

Tomcat :

使用 CATALINA_BASE:/opt/apache-tomcat-7.0.65

使用 CATALINA_HOME:/opt/apache-tomcat-7.0.65

使用 CATALINA_TMPDIR:/opt/apache-tomcat-7.0.65/temp

使用 JRE_HOME:/usr/java/jdk1.8.0_65/

使用 CLASSPATH:/opt/apache-tomcat-7.0.65/bin/bootstrap.jar:/opt/apache-tomcat-7.0.65/bin/tomcat-juli.jar

服务器版本:Apache Tomcat/7.0.65

服务器构建: 2015 年 10 月 9 日 08:36:58 UTC

服务器编号: 7.0.65.0

操作系统名称: Linux

操作系统版本: 2.6.32-573.7.1.el6.x86_64

架构:amd64

JVM 版本: 1.8.0_65-b17

JVM 供应商: Oracle Corporation

MySQL:

服务器版本 5.1.73 协议(protocol)

版本 10 通过 UNIX socket UNIX 连接本地主机

套接字/var/lib/mysql/mysql.sock

Java:

javac 版本 1.8.0_65

java 版本 1.8.0_65

-Java(TM) SE 运行时环境(build 1.8.0_65-b17)

-Java HotSpot(TM) 64 位服务器虚拟机(构建 25.65-b01,混合模式)

操作系统

分销商 ID: RedHatEnterpriseServer

版本: 6.7

系统变量

回显 $JAVA_HOME

/usr/java/jdk1.8.0_65/

回显 $PATH

/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/java/jdk1.8.0_65//bin:

Dec 22, 2015 5:41:34 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [jsp] in context with path [/] threw exception [Unable to compile class for JSP] with root cause
java.lang.IllegalArgumentException: Negative time
at java.io.File.setLastModified(File.java:1427)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:377)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:354)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:341)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:662)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:364)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)

Dec 22, 2015 5:41:34 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [jsp] in context with path [/] threw exception [java.lang.ClassNotFoundException: org.apache.jsp.index_jsp] with root cause
java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:132)
at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:63)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:121)
at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:172)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:376)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)

最佳答案

您真正的问题是:java.lang.ClassNotFoundException: org.apache.jsp.index_jsp

您已表明正在使用:

Using JRE_HOME: /usr/java/jdk1.8.0_65/

Tomcat需要将jsp文件编译成servlets,所以需要JDK和JAVA_HOME。看来您使用的是 JDK,而是定义了 JRE_HOME

确保您使用的是 JDK 而不仅仅是 JRE,并正确设置 JAVA_HOME

关于mysql - 在 Java Web 应用程序上出现错误 [无法为 JSP 编译类] 的根本原因,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34414666/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com