Eclipse启动Tomcat时偶尔找不到org.apache.struts2.tiles.StrutsTilesListener
我在 Eclipse 中使用 Tomcat。每当我每天第一次打开 Eclipse(或随时关闭并重新打开它)时,都会出现这个问题。我必须清理它或重新添加服务器才能使 Tomcat 服务器正常工作。
我想知道是否有人遇到同样的问题。任何帮助将不胜感激。
以下是例外情况,但 StrutsTilesListener
类就在那里,我对此非常确定:
Feb 9, 2012 3:51:40 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class org.apache.struts2.tiles.StrutsTilesListener
java.lang.ClassNotFoundException: org.apache.struts2.tiles.StrutsTilesListener
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1688)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1533)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:525)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:507)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:124)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4701)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5260)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1525)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1515)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
I'm using Tomcat inside Eclipse. This problem happens to me whenever I open Eclipse for the first time every day (or close it and re-open it anytime). I have to clean it or re-add the server to make the Tomcat server working.
I'm wondering if anyone was having the same problem. Any help would be appreciated.
The following is the exception, but the StrutsTilesListener
class is out there and I'm pretty sure about it:
Feb 9, 2012 3:51:40 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class org.apache.struts2.tiles.StrutsTilesListener
java.lang.ClassNotFoundException: org.apache.struts2.tiles.StrutsTilesListener
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1688)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1533)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:525)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:507)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:124)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4701)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5260)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1525)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1515)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在我们的 web.xml 文件中使用上面的监听器
Use the above Listener in our web.xml file
问题是 eclipse tomcat 插件将一些配置(针对 Eclipse WTP),包括类路径定义放入到我的 webapp 上下文的 tomcat 中,位于 conf/Catalina/localhost 中。
这是自动的。
类路径包括大多数 jar,但不是全部。
所以你最好将服务器和IDE分开。
http://struts.1045723.n5.nabble.com/ClassNotFoundException-StrutsTilesListener -td3553672.html
The problem is that eclipse tomcat plugin puts some configuration (for Eclipse WTP) including classpath definitions into tomcat for my webapp context, in conf/Catalina/localhost.
This is automatic.
The classpaths include most of the jars but not all of them.
So you better keep the server and ide separate.
http://struts.1045723.n5.nabble.com/ClassNotFoundException-StrutsTilesListener-td3553672.html
我使用的是 eclipse Luna for Java Developers(64 位),并在此版本上安装了 Web Tools Platform (WTP),以便在 eclipse 内使用 Tomcat 6.0.39。也有同样奇怪的行为。
安装后&使用干净的 eclipse Luna EE 版本,不再使用 Struts2 Tiles jar 的
ClassNotFoundException
。不知道为什么会发生这种情况,也不知道为什么现在没有发生,但我使用 eclipse EE 4 个小时了,从那以后一切正常。
你使用的是哪个版本的 eclipse?
I was using eclipse Luna for Java Developers (64bits) and I installed Web Tools Platform (WTP) over this version for work with Tomcat 6.0.39 inside eclipse. Also got this same weird behavior.
After install & use a clean eclipse Luna EE edition, no more
ClassNotFoundException
with Struts2 Tiles jar.Don't know why that it happened and don't know why isn't happening now, but I'm using eclipse EE for 4 hours and it's ok since then.
Which version of eclipse are you using?