3

当我关闭我的电脑时,我配置并运行了一个 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
4

1 回答 1

8

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

  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 服务器上。

于 2012-06-07T23:30:16.077 回答