问题
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)
回答1:
**<listener>
<listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
</listener>**
Use the above Listener in our web.xml file
回答2:
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
回答3:
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?
来源:https://stackoverflow.com/questions/9219663/org-apache-struts2-tiles-strutstileslistener-occasionally-not-found-when-startin