码迷,mamicode.com
首页 > 编程语言 > 详细

javaweb项目jsp跳转servlet Error instantiating servlet class 问题

时间:2016-05-09 09:42:55      阅读:139      评论:0      收藏:0      [点我收藏+]

标签:

问题:

HTTP Status 500 - Error instantiating servlet class RecommenderServlet


type Exception report

message Error instantiating servlet class RecommenderServlet

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

exception

javax.servlet.ServletException: Error instantiating servlet class RecommenderServlet
	org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
	org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
	org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
	org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
	org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	java.lang.Thread.run(Thread.java:745)

 

root cause

java.lang.ClassNotFoundException: RecommenderServlet
	org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
	org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
	org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
	org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
	org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
	org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
	org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	java.lang.Thread.run(Thread.java:745)

解决方法:问题出在web.xml上,<servlet-class>xxx</servlet-class>应该配置为<servlet-class>servlet所在的包名.servlet的名称</servlet>
  例如:<servlet-class>cn.fth.servlet.RecommenderServlet</servlet-class>

javaweb项目jsp跳转servlet Error instantiating servlet class 问题

标签:

原文地址:http://www.cnblogs.com/thfeng/p/5472742.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!