Eclipse Tomcat 严重:加载 WebappClassLoader 时出错

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10697866/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 18:14:12  来源:igfitidea点击:

Eclipse Tomcat SEVERE: Error loading WebappClassLoader

javaeclipsetomcat6

提问by xxjjnn

Tomcat starts on Eclipse successfully, however any action involving the Servlet gives the error below.

Tomcat 在 Eclipse 上成功启动,但是任何涉及 Servlet 的操作都会出现以下错误。

I suspect the problem is that TomCat is looking in the WEB-INF folder for classes, though I have no idea where Eclipse has compiled and hidden them (not there for sure). How do I fix?

我怀疑问题在于 TomCat 正在 WEB-INF 文件夹中查找类,尽管我不知道 Eclipse 在哪里编译和隐藏了它们(不确定)。我该如何解决?

SEVERE: Error loading WebappClassLoader
  context: /MyEclipseProject
  delegate: false
  repositories:
    /WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@3344c133
 servlet.StartServlet
java.lang.ClassNotFoundException: servlet.StartServlet
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1128)
    at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:827)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Unknown Source)

Have already read:

已经阅读:

Error loading WebappClassLoader in Tomcat

在 Tomcat 中加载 WebappClassLoader 时出错

eclipse exception thrown

日食异常抛出

回答by duzhiweibe

The compiled class files are under $user.dir/webContent/WEB_INF/classes folder. If there are no classes there, I suggest you remove the project from the tomcat server, then clean your current project. Finally, run your porject(jsp etc) on the server again. I hope this will help.

编译后的类文件位于 $user.dir/webContent/WEB_INF/classes 文件夹下。如果那里没有类,我建议您从tomcat服务器中删除该项目,然后清理您当前的项目。最后,再次在服务器上运行您的项目(jsp 等)。我希望这将有所帮助。

回答by apurva.nandan

Please remove the tomcat server runtime library from your project build path and then add the tomcat server again. Run now, it should solve your problem I guess.

请从您的项目构建路径中删除 tomcat 服务器运行时库,然后再次添加 tomcat 服务器。现在运行,我想它应该可以解决您的问题。

回答by vijay M

I also got the same problem, after adding all the jars in "lib" folder now it's working properly

我也遇到了同样的问题,在“lib”文件夹中添加了所有 jar 之后,现在它可以正常工作了

回答by senior

  • Clean your project
  • Refresh it
  • redeploy it
  • 清理你的项目
  • 刷新一下
  • 重新部署它

I tried these steps and my app works :)

我尝试了这些步骤并且我的应用程序有效:)