Eclipse启动Tomcat时偶尔找不到org.apache.struts2.tiles.StrutsTilesListener

发布于 2025-01-04 07:48:29 字数 1734 浏览 1 评论 0原文

我在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

执笏见 2025-01-11 07:48:29
**<listener>
<listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
</listener>**

在我们的 web.xml 文件中使用上面的监听器

**<listener>
<listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
</listener>**

Use the above Listener in our web.xml file

黄昏下泛黄的笔记 2025-01-11 07:48:29

问题是 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

北恋 2025-01-11 07:48:29

我使用的是 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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文