日期:2014-05-17  浏览次数:21036 次

调试servlet时,出现Http Status 500-错误
我使用的是JCreator编辑java文件,编译了没有错误,之后我有部署了xml,最后我通过浏览器访问时,出现了如下错误:
HTTP Status 500 -

type Exception report

message

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

exception

javax.servlet.ServletException: Wrapper cannot find servlet class jwadbook.servlets.SimpleServlet or a class it depends on
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:843)
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:679)
org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1303)
java.lang.Thread.run(Thread.java:595)
root cause

java.lang.ClassNotFoundException: jwadbook.servlets.SimpleServlet
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1438)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1284)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:843)
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:679)
org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1303)
java.lang.Thread.run(Thread.java:595)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.34 logs.

部署的内容:
 <!-- 部署第一个HttpServlet -->
  <servlet>  
  <servlet-name>SimpleServlet</servlet-name>
  <servlet-class>jwadbook.servlets.SimpleServlet</servlet-class>
  </servlet>

  <servlet-mapping>
  <servlet-name>SimpleServlet</servlet-name>
  <url-pattern>/Simple</url-pattern>
  </servlet-mapping>

在网上找了一天,但都没有解决这个问题,很是急人啊,恳求各位高手解决这个问题,不甚感激。


------解决方案--------------------
java.lang.ClassNotFoundException: jwadbook.servlets.SimpleServlet 没有找到这个类

你确定你的路径是对的?还是你创建的类不是一个servlet?
------解决方案--------------------
jwadbook.servlets.SimpleServlet 
找不到你是否放在classes目录下的jwadbook/servlets/SimpleServlet.class
我的异常网推荐解决方案:The server encountered an internal error () that prevented it from fulfilling this request.,http://www.aiyiweb.com/java-web/317.html