我正在尝试通过 Eclipse 运行 Tomcat。这是我过去几年所做的事情。昨天还在工作,现在不行了。我得到的错误是
Server Tomcat v7.0 Server at localhost was unable to start within 45 seconds. If the server requires more time, try increasing the timeout in the server editor.
输出是
Jul 06, 2012 8:32:26 PM 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: D:\Program Files\Java\jdk1.7.0_05\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\QuickTime\QTSystem\;D:\Launch;D:\Program Files\Java\jdk1.7.0_05\bin;%PROGRAMFILES%\Internet Explorer;C:\Program Files (x86)\SMLNJ\bin\;D:\Program Files\TortoiseSVN\bin;C:\ghc\ghc-6.6\bin;D:\Program Files\MySQL\MySQL Server 5.5\bin;%ANT_HOME%/bin;D:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;D:\Program Files\Microsoft SQL Server\100\Tools\Binn\;D:\Program Files\Microsoft SQL Server\100\DTS\Binn\;D:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\;D:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;D:\Program Files (86x)\;.
Jul 06, 2012 8:32:26 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jul 06, 2012 8:32:26 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Jul 06, 2012 8:32:26 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 468 ms
Jul 06, 2012 8:32:26 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jul 06, 2012 8:32:26 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.28
Jul 06, 2012 8:32:26 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\Program Files\Java\apache-tomcat-7.0.28\webapps\docs
Jul 06, 2012 8:32:26 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\Program Files\Java\apache-tomcat-7.0.28\webapps\examples
Jul 06, 2012 8:32:26 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Jul 06, 2012 8:32:26 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Jul 06, 2012 8:32:26 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@5710ddf9')
Jul 06, 2012 8:32:26 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\Program Files\Java\apache-tomcat-7.0.28\webapps\host-manager
Jul 06, 2012 8:32:26 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\Program Files\Java\apache-tomcat-7.0.28\webapps\manager
Jul 06, 2012 8:32:26 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\Program Files\Java\apache-tomcat-7.0.28\webapps\ROOT
Jul 06, 2012 8:32:26 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Jul 06, 2012 8:32:26 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Jul 06, 2012 8:32:26 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 504 ms
我已经四处寻找解决方案几个小时了。但我没有取得任何成功,这可能很简单。我尝试了以下方法:
- 删除Serve并在eclipse中重新制作
- 重启电脑,eclipse
- 重新安装eclipse、tomcat
- 使用 -clean 启动 Eclipse
- 启动没有 Web 应用程序的服务器
- 增加超时
我能够从命令行启动tomcat就好了。但是,我需要通过 eclipse 运行它来调试。我知道这个 SO 帖子,并且已经通过它和许多其他的无济于事。
想法?
更新:我刚刚意识到服务器确实启动了。但是,eclipse 执行的最终功能之一失败了。我观察到这一点的方法是将超时设置为 10 分钟。在那段时间我能够访问服务器,但不能访问 Eclipse 的调试功能。所以 Eclipse 启动它,尝试做一些事情,但事情永远不会完成,Eclipse 在超时时间之后关闭了 Tomcat。
更新:回顾出现此问题时发生的情况,计算机显然安装了 Java 更新。