PC重启后,Eclipse webapp项目无法在Tomcat上正常启动

时间:2012-06-07 23:06:30

标签: eclipse jsf tomcat

当我关闭电脑时,我配置并运行了一个Web应用程序。然后,当我开始时,奇怪的事情开始发生:我使用eclipse indigo ee。它给了我一个类没有找到异常的类,它在正确的地方,我没有修改任何东西,我想在修改之前重新运行应用程序。在另一个项目中它没有识别String类型,所以我重新加载项目然后它有包的问题,​​然后删除并更换包,它工作。那个项目很好。但我正在研究的另一个人说没有找到一个班级。我将它放在另一个包装中,然后将其放回原位。错误消失了。但是出现了一个新的,这是我的控制台输出:

 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

1 个答案:

答案 0 :(得分:8)

显然环境很脏。我建议清理并重建所有。

  1. 从Tomcat中删除项目(右键单击Tomcat,添加/删除项目,删除项目)
  2. 在Eclipse中关闭项目(右键单击项目,关闭
  3. 清理Tomcat(右键单击Tomcat,清理
  4. 在Eclipse中重新打开项目(右键单击项目,打开
  5. 在Eclipse中清理项目(项目&gt;清理...&gt;清理下面的选定项目,选择项目)
  6. 将项目添加到Tomcat(右键单击Tomcat,添加/删除项目,添加项目)
  7. 启动Tomcat(右击Tomcat,开始)。
  8. 无法确定此问题的真正原因,可能因素太多。例如,工作空间未正确关闭,或者Tomcat没有正确关闭,或者您同时执行了“太多”操作,这导致了Eclipse等后台任务中的竞争条件。这与Eclipse + Tomcat组合没有明确关系。这种情况也发生在JBoss AS和Glassfish服务器上。