Problem:
HTTP Status 500-error instantiating servlet class Recommenderservlet
type Exception Report
message Error instantiating servlet class Recommenderservlet
Description The server encountered an internal error, 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)
Solution: The problem lies in web.xml, <servlet-class> xxx </ servlet-class> should be configured as <servlet-class> package name where servlet is located. Name of servlet </ servlet>
For example: <servlet-class> cn.fth.servlet.RecommenderServlet </ servlet-class>
Javaweb Project JSP jump servlet Error instantiating servlet class problem