一尘不染

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

tomcat

当我关闭PC时,我已配置并正在运行一个Web应用程序。然后,当我开始时,奇怪的事情开始发生:我使用eclipse indigo
ee。它为我提供了一个类未找到的异常,该类位于正确的位置,我没有进行任何修改,我想在修改它之前重新运行该应用程序。在另一个项目中,它无法识别字符串类型,因此我重新加载了项目,然后程序包出现问题,然后删除并替换了程序包,它可以正常工作。这个项目很好。但是我正在研究的另一个人却说找不到一个类。我将其放在另一个包装中,然后放回原处。错误消失了。但是出现了一个新的控制台,这是我的控制台输出:

 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

阅读 381

收藏
2020-06-16

共1个答案

一尘不染

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

  1. 从Tomcat删除项目(右键单击Tomcat, 添加/删除项目 ,删除项目)
  2. 在Eclipse中关闭项目(右键单击项目, 关闭
  3. 清洁Tomcat(右键单击Tomcat, 清洁
  4. 在Eclipse中重新打开项目(右键单击项目, 打开
  5. 在Eclipse中清理项目(“ 项目” >“清理…”>在下面清理选定的项目,选择项目)
  6. 将项目添加到Tomcat(右键单击Tomcat, 添加/删除项目 ,添加项目)
  7. 启动Tomcat(右键单击Tomcat, 单击“开始” )。

不可能找出导致此问题的真正原因,可能的因素太多。例如,工作区未正确关闭,或者Tomcat未正确关闭,或者您同时执行了“太多”操作,从而导致Eclipse等后台任务中出现竞争状况。这与Eclipse
+ Tomcat组合没有明确关系。根据我的经验,在使用JBoss AS和Glassfish服务器时也会发生这种情况。

2020-06-16