老师我的servlet自己写的话没有问题,但是用Myeclipse里面自动生成的servlet就报500错误,我用的Myecplise2017

来源:1-9 Tomcat装载Servlet的三种情况

玖丶

2019-04-12 12:19

Allocate exception for servlet HelloServlet
java.lang.ClassNotFoundException: servlet.HelloServlet
 at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1955)
 at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1798)
 at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:536)
 at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:518)
 at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:148)
 at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1127)
 at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:847)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:135)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:494)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
 at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:1025)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
 at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1137)
 at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
 at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:319)
 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)

写回答 关注

1回答

  • 慕用705197
    2019-04-15 22:41:32

    java.lang.ClassNotFoundException: servlet.HelloServlet,jvm找不到编译好的class文件;重新编译下,或者重新设置下编译路径。

JAVA遇见HTML——Servlet篇

本门课程在JSP课程的基础上,深入介绍Servlet的基础知识

160613 学习 · 1029 问题

查看课程

相似问题