1

I was using Tomcat with Eclipse nicely. Now I cannot start the server. I get the following exception when trying to start. Things were working great. I'm not aware of having changed anything, but obviously something changed.

Apr 7, 2012 12:28:29 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.apache.myfaces.webapp.StartupServletContextListener
java.lang.NoClassDefFoundError: org/apache/commons/digester/Digester
    at org.apache.myfaces.config.impl.digester.DigesterFacesConfigUnmarshallerImpl.<init>(DigesterFacesConfigUnmarshallerImpl.java:42)
    at org.apache.myfaces.config.FacesConfigurator.getUnmarshaller(FacesConfigurator.java:262)
    at org.apache.myfaces.config.FacesConfigurator.feedStandardConfig(FacesConfigurator.java:566)
    at org.apache.myfaces.config.FacesConfigurator.configure(FacesConfigurator.java:487)
    at org.apache.myfaces.webapp.AbstractFacesInitializer.buildConfiguration(AbstractFacesInitializer.java:296)
    at org.apache.myfaces.webapp.Jsp21FacesInitializer.initContainerIntegration(Jsp21FacesInitializer.java:73)
    at org.apache.myfaces.webapp.AbstractFacesInitializer.initFaces(AbstractFacesInitializer.java:118)
    at org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:111)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1566)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1556)
    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)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.digester.Digester
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1711)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1556)
    ... 18 more
Apr 7, 2012 12:28:29 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
Apr 7, 2012 12:28:29 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/webApp_appNameT] startup failed due to previous errors
Apr 7, 2012 12:28:29 PM org.apache.catalina.core.StandardContext listenerStop
SEVERE: Exception sending context destroyed event to listener instance of class org.apache.myfaces.webapp.StartupServletContextListener
java.lang.IllegalStateException: No Factories configured for this Application. This happens if the faces-initialization does not work at all - make sure that you properly include all configuration settings necessary for a basic faces application and that all the necessary libs are included. Also check the logging output of your web application and your container for any exceptions!
If you did that and find nothing, the mistake might be due to the fact that you use some special web-containers which do not support registering context-listeners via TLD files and a context listener is not setup in your web.xml.
A typical config looks like this;
<listener>
  <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>

    at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:172)
    at org.apache.myfaces.context.servlet.FacesContextImplBase.getApplication(FacesContextImplBase.java:131)
    at org.apache.myfaces.webapp.AbstractFacesInitializer._dispatchApplicationEvent(AbstractFacesInitializer.java:239)
    at org.apache.myfaces.webapp.AbstractFacesInitializer.destroyFaces(AbstractFacesInitializer.java:273)
    at org.apache.myfaces.webapp.StartupServletContextListener.contextDestroyed(StartupServletContextListener.java:153)
    at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4819)
    at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5466)
    at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1566)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1556)
    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)
Apr 7, 2012 12:28:29 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/webApp_appNameT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@1d98a]) and a value of type [org.apache.myfaces.config.RuntimeConfig] (value [org.apache.myfaces.config.RuntimeConfig@1712651]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Apr 7, 2012 12:28:29 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/webApp_appNameT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@18aab40]) and a value of type [org.apache.myfaces.context.servlet.StartupFacesContextImpl] (value [org.apache.myfaces.context.servlet.StartupFacesContextImpl@f102d3]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Apr 7, 2012 12:28:29 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/webApp_appNameT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@f07355]) and a value of type [org.apache.myfaces.context.servlet.StartupFacesContextImpl] (value [org.apache.myfaces.context.servlet.StartupFacesContextImpl@23f1bb]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Apr 7, 2012 12:28:29 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Apr 7, 2012 12:28:29 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Apr 7, 2012 12:28:29 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1756 ms
Jasper de Vries
  • 19,370
  • 6
  • 64
  • 102
Dale
  • 1,289
  • 3
  • 16
  • 36
  • 2
    The libraries being deployed; you're missing at least commons-digester. – Dave Newton Apr 07 '12 at 16:33
  • @DaveNewton where do I need to place the commons-digester jar? It was working 30 minutes ago, so my confusion is what happened to it? – Dale Apr 07 '12 at 17:08
  • 1
    I really wouldn't know where it went. – Dave Newton Apr 07 '12 at 17:09
  • What is your build process? Are you using maven or any other particular build tool whose configuration might have changed? Bottom line is what were the changes in environment from last time that it worked till time when it stopped. – Shahzeb Apr 10 '12 at 00:18

2 Answers2

4

I had the same problem. Webapp and Tomcat in Eclipse ran nice, then eclipse freezed; I had to kill it with TaskManager. However when I restarted tomcat, above error java.lang.NoClassDefFoundError: org/apache/commons/digester/Digester appeared.

It did not make sense because the webapp ran nicely before. I solved it by cleaning the eclipse tomcat webapp directory.

  1. Go to the Servers tab -> Right click on your webapp -> Clean Module directory.
  2. Go to the Servers tab -> Right click on used Tomcat instance -> Clean...

After that the error disappeared and the webapp ran again like before.

Thero
  • 109
  • 4
3
Caused by: java.lang.ClassNotFoundException: org.apache.commons.digester.Digester

This just tells you that the mentioned class is missing in the runtime classpath. As the package name hints, it's Apache Commons Digester which is available at http://commons.apache.org/digester. If you download the JAR file and drop it in one of the paths covered by the webapp's runtime classpath, such as /WEB-INF/lib, then this problem should disappear.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • I added that jar to the /WEB-INF/lib and I got the same results. That jar wasn't there 30 minutes ago when it was working. Any other ideas? – Dale Apr 07 '12 at 16:54