eclipse / tomcat:deploy不再工作(ClassNotFoundException) [英] eclipse/tomcat: deploy doesn't work any more (ClassNotFoundException)

查看:402
本文介绍了eclipse / tomcat:deploy不再工作(ClassNotFoundException)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行Eclipse Helios Service Release 1,在Linux Ubuntu Natty Narwhal中使用Tomcat 7.0.12。



我已经很乐意重新部署我的webapp直到它停止工作显然没有理由。显示以下异常:

  SEVERE:为servlet分配异常索引
java.lang.ClassNotFoundException:obliquid.servlet 。org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)中的$ b




  • 服务器选项卡中,我有Tomcat v7 .0服务器在本地主机[开始,同步]

  • 我的项目显示为Tomcat v7.0服务器的子项

  • 在属性中,Java构建路径源代码我已经在项目/ src 源文件夹

  • 在属性,Web部署程序集中,我有以下映射: / WebContent - > / / src - > / WEB-INF / classes / test > / build / classes

  • 我的 src 目录包含一个Servlet in obliquid / servlet / Index.java li>
  • 我已经尝试了清理模块工作目录... 和发布

  • 我试图从Eclipse Server选项卡中停止并启动服务器



我还应该检查什么?谢谢。



更新尽管现在我正在使用这个新项目,我回来检查一下旧的项目,神秘地现在是加工。我想我将无法找到发生的事情。



但是今天在新项目中,我出现404错误,没有明显的理由,我发现右键单击Tomcat服务器并选择Clean ...有用也许它可以帮助。



选择清洁...说:清理将丢弃所有发布状态,并从头开始重新发布。确定要清除所有出版资源?。选择是的,我解决了问题



更新2 在新项目中再次发生。 404错误,这一次他们不会消失。

 停止 - >清洁...  - >开始(404)
停止 - >清理Tomcat工作目录...>开始(404)
停止 - >清理Tomcat工作目录...>清洁... - >开始(404)
停止 - >删除应用程序 - >清洁... - >运行方式 - >在服务器上运行 - > (404)
退出Eclipse,启动Eclipse
启动服务器 - > (404)

更新3 原来,这一次我刚刚在启动期间不会注意到由侦听器类引起的异常。解决这个问题后,工作得很好。猜测我应该在凌晨3点停止工作。

解决方案

在Tomcat 6和Eclipse Ganymede上,我发现以下链条的工作原理魅力:



1停止服务器



2项目 - >清洁



3项目构建(我已禁用自动构建)



4删除服务器



5删除服务器文件夹



6重新启动Eclipse



7创建新服务器,添加项目并启动:)



需要一些时间,但像魅力一样工作。我的问题是一个令人烦恼的侦听器启动问题,但这似乎是类似的东西:一个属性在tomcat。 Btw:现在我也是一个大玻璃鱼粉丝。


I'm running Eclipse Helios Service Release 1, with Tomcat 7.0.12 in Linux Ubuntu Natty Narwhal.

I've been happily hot re-deploying my webapp until it stopped working for apparently no reason. The following exception is displayed:

SEVERE: Allocate exception for servlet Index
java.lang.ClassNotFoundException: obliquid.servlet.Index
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)

  • In Servers tab I've "Tomcat v7.0 Server at localhost [Started,Synchronized]
  • My project appears as a child of Tomcat v7.0 Server
  • In Properties, Java Build Path, Source I've Project/src Source folder
  • In Properties, Web Deployment Assembly, I've the following mappings: /WebContent -> /, /src -> /WEB-INF/classes, /test -> /build/classes
  • My src directory contains a Servlet in obliquid/servlet/Index.java
  • I tried already to click on Clean Module Work Directory... and Publish
  • I tried to stop and start the Server from within Eclipse Servers tab

What else should I check? Thank you.

UPDATE Despite now I'm working with the new project, I came back to check the old one, and mysteriously now it's working. I think I won't be able to find what has happened.

However today with the new project, I had 404 errors with no apparent reason and I found out that right clicking on the Tomcat server and selecting "Clean..." can be useful. Maybe it could have helped.

Selecting "Clean..." says: "Clean will discard all publish state and republish from scratch. Are you sure you want to clean all published resources?". Selecting yes, I solved the problem

UPDATE 2 It happened again on the new project. 404 errors, this time they don't go away.

Stop -> Clean... -> Start (404)
Stop -> Clean Tomcat Work Directory... -> Start (404)
Stop -> Clean Tomcat Work Directory... -> Clean... -> Start (404)
Stop -> Remove on the application ->  Clean... -> Run As -> Run on Server -> (404)  
Exit Eclipse, Start Eclipse
Start the server -> (404)

UPDATE 3 It turned out that this time I just didn't notice an exception caused by a listener-class during startup. After solving the problem, it worked. Guess I should stop working at 3 AM.

解决方案

While on Tomcat 6 and Eclipse Ganymede I found out the following chain to work like charm:

1 stop server

2 project -> clean

3 project build (I had automatic build disabled)

4 delete server

5 delete Servers folder

6 restart Eclipse

7 create new server, add project and start :)

takes some time but worked like charm. My problem was a irritating Listener start problem, but this seems to be something similar: a property at tomcat. Btw: nowadays I am also a big Glassfish fan.

这篇关于eclipse / tomcat:deploy不再工作(ClassNotFoundException)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆