HTTP状态500 - java.lang.ClassNotFoundException:org.apache.jsp.index_jsp

时间:2014-01-14 07:32:53

标签: java eclipse jsp tomcat

我在Eclipse中创建了一个JSP-Project(使用Tomcat 7)但是当我运行该页面时,我得到了一个ClassnotFoundExcption。

在我的项目中,我使用控制器将数据绑定到JSp,我有一个控制器,一个服务和一个数据对象 - > dbChanges

我已经“google'd”我的问题并没有找到任何结果。

PS:抱歉英语不好,我尽力了

HTTP Status 500 - java.lang.ClassNotFoundException: org.apache.jsp.index_jsp

--------------------------------------------------------------------------------

type Exception report

message java.lang.ClassNotFoundException: org.apache.jsp.dbChanges.index_jsp

description The server encountered an internal error that prevented it from fulfilling this request.

exception 

org.apache.jasper.JasperException: java.lang.ClassNotFoundException: org.apache.jsp.dbChanges.index_jsp
    org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:177)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)


root cause 

java.lang.ClassNotFoundException: org.apache.jsp.dbChanges.index_jsp
    java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    java.security.AccessController.doPrivileged(Native Method)
    java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:132)
    org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:63)
    org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:172)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)


note The full stack trace of the root cause is available in the Apache Tomcat/7.0.30 logs.


--------------------------------------------------------------------------------

Apache Tomcat/7.0.30

Apache日志

Jan 14, 2014 11:33:07 AM org.apache.catalina.core.StandardWrapperValve invoke
Schwerwiegend: Servlet.service() for servlet [jsp] in context with path [/dbChanges] 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$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    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:139)
    at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:172)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)

的web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://java.sun.com/xml/ns/javaee" xmlns:jsp="http://java.sun.com/xml/ns/javaee/jsp"
    xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    id="WebApp_ID" version="2.5">
    <display-name>dbChanges</display-name>
    <session-config>
        <session-timeout>60</session-timeout>
    </session-config>
    <jsp-config>
        <taglib>
            <taglib-uri>http://www.springframework.org/tags/form</taglib-uri>
            <taglib-location>/META-INF/spring-form.tld</taglib-location>
        </taglib>
        <taglib>
            <taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
            <taglib-location>/META-INF/c.tld</taglib-location>
        </taglib>
    </jsp-config>
    <context-param>
        <param-name>enableSessionManager</param-name>
        <param-value>false</param-value>
    </context-param>
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
    <error-page>
        <error-code>403</error-code>
        <location>/errors/403.html</location>
    </error-page>
    <error-page>
        <error-code>404</error-code>
        <location>/errors/404.html</location>
    </error-page>
    <!-- <error-page>
        <error-code>500</error-code>
        <location>/errors/500.html</location>
    </error-page>  -->
</web-app>

如果您需要信息(文件等),请说出来。

我希望你能帮助我。 Obsidianfarmer

3 个答案:

答案 0 :(得分:2)

我遇到了这个问题,因为在eclipse配置中我将JDK文件夹(jdk1.6.0_45)设置为JRE位置。相反,它应该在我的&#34;已安装的JRE中设置为jre6&#34;偏好。

答案 1 :(得分:1)

对于在pom.xml中使用jstl dependency转换为Maven项目的Java-EE项目: 在我的例子中,我需要将Maven依赖项添加到构建路径

操作实例:

  • 右键单击有问题的项目
  • 打开属性
  • 点击部署程序集
  • 点击添加
  • 选择Java Build Path Entries
  • 选择Maven依赖项

更新:还要检查执行环境&amp;&amp;工作区JRE 已正确设置。

答案 2 :(得分:1)

1.使用&#34;以管理员身份运行&#34;打开命令提示符或者在Linux中使用sudo

  1. 转到&#34; bin&#34; Tomcat文件夹的目录。 例如:cd C:\ Program Files \ Apache Software Foundation \ Apache Tomcat 8.0.15 \ bin
  2. 请注意版本号和准确的位置。

    1. 运行&#39; startup.bat&#39;并且服务器应该启动

    2. 打开输入http://localhost:8080/

    3. 的网络浏览器
    4. 如果服务器运行没有异常,这意味着您必须提供eclipse管理权限。

    5. 为此,您可以访问:Windows 7 - Eclipse now needs me to run as administratorhttps://askubuntu.com/questions/249098/how-do-i-run-eclipse-as-sudo