Pio
Pio

Reputation: 4062

Eclipse webapp project does not start properly on Tomcat anymore after a PC restart

I had a web app configured and running when I shut down my PC. Then when I started it strange things started to happen: I use eclipse indigo ee. It gave me a class not found exception for a class which was in the right place, I did not modify anything, I wanted to rerun the app before modifying it. In another project it did not recognize the type String, so I reloaded the project and then it had problems with the package, then removed and replaced the package, it worked. That project is good. But the other one I was working on stated that a class was not found. I placed it in another package and then put it back to its place. The error gone away. But a new one appeared, here is my console output:

 Jun 08, 2012 1:57:07 AM org.apache.catalina.core.AprLifecycleListener init
 INFO: The APR based Apache Tomcat Native library which allows optimal performance in  production environments was not found on the java.library.path: C:\Program Files\Java\jre7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;c:/Program Files/Java/jdk1.7.0_04/bin/../jre/bin/server;c:/Program Files/Java/jdk1.7.0_04/bin/../jre/bin;c:/Program Files/Java/jdk1.7.0_04/bin/../jre/lib/amd64;D:\OracleDB11g\app\oracle\product\11.2.0\server\bin;c:\Program Files\Java\jdk1.7.0_04\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;d:\Programming_Tools\apache-maven-3.0.4\bin\;D:\MySqlServer\bin;C:\Program Files (x86)\QuickTime\QTSystem\;D:\Programming_Tools\eclipse EE;;.
 Jun 08, 2012 1:57:07 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
 WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:TestTomcat' did not find a matching property.
 Jun 08, 2012 1:57:07 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
 WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:OnTheRun' did not find a matching property.
 Jun 08, 2012 1:57:08 AM org.apache.coyote.AbstractProtocol init
 INFO: Initializing ProtocolHandler ["http-bio-80"]
 Jun 08, 2012 1:57:08 AM org.apache.coyote.AbstractProtocol init
 INFO: Initializing ProtocolHandler ["http-bio-8443"]
 Jun 08, 2012 1:57:08 AM org.apache.coyote.AbstractProtocol init
 INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
 Jun 08, 2012 1:57:08 AM org.apache.catalina.startup.Catalina load
 INFO: Initialization processed in 1791 ms
 Jun 08, 2012 1:57:08 AM org.apache.catalina.core.StandardService startInternal
 INFO: Starting service Catalina
 Jun 08, 2012 1:57:08 AM org.apache.catalina.core.StandardEngine startInternal
 INFO: Starting Servlet Engine: Apache Tomcat/7.0.27
 Jun 08, 2012 1:57:12 AM org.apache.catalina.core.ApplicationContext log
 SEVERE: StandardWrapper.Throwable
 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 javax.faces.webapp.FacesServlet.init(FacesServlet.java:112)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1266)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1185)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1080)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5015)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5302)
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.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

 Jun 08, 2012 1:57:12 AM org.apache.catalina.core.StandardContext loadOnStartup
 SEVERE: Servlet /OnTheRun threw load() exception
  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 javax.faces.webapp.FacesServlet.init(FacesServlet.java:112)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1266)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1185)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1080)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5015)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5302)
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.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

 Jun 08, 2012 1:57:12 AM org.apache.coyote.AbstractProtocol start
 INFO: Starting ProtocolHandler ["http-bio-80"]
 Jun 08, 2012 1:57:12 AM org.apache.coyote.AbstractProtocol start
 INFO: Starting ProtocolHandler ["http-bio-8443"]
 Jun 08, 2012 1:57:12 AM org.apache.coyote.AbstractProtocol start
 INFO: Starting ProtocolHandler ["ajp-bio-8009"]
 Jun 08, 2012 1:57:12 AM org.apache.catalina.startup.Catalina start
 INFO: Server startup in 3540 ms

Upvotes: 3

Views: 9669

Answers (1)

BalusC
BalusC

Reputation: 1109715

Apparently the environment is dirty. I'd suggest to clean and rebuild all.

  1. Remove project from Tomcat (rightclick Tomcat, Add/Remove project, remove project)
  2. Close project in Eclipse (rightclick project, Close)
  3. Clean Tomcat (rightclick Tomcat, Clean)
  4. Reopen project in Eclipse (rightclick project, Open)
  5. Clean project in Eclipse (Project > Clean... > Clean selected projects below, select project)
  6. Add project to Tomcat (rightclick Tomcat, Add/Remove projects, add project)
  7. Start Tomcat (rightclick Tomcat, Start).

It isn't possible to pinpoint a real cause for this problem, there are too many possible factors. For example, the workspace wasn't properly shutdown, or Tomcat wasn't properly shutdown, or you did "too many" things simultaneously which caused race conditions in background tasks of Eclipse, etcetera. This is not explicitly related to Eclipse+Tomcat combination. This happens to my experience also so now and then with JBoss AS and Glassfish servers.

Upvotes: 8

Related Questions