Java 出现错误“Tomcat 无法在 45 秒内启动。”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24359240/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Getting error "Tomcat was unable to start within 45 seconds."
提问by varun
I am getting an error while running apache tomcat server in ecllipse and the error description is"Server apache-tomcat-7.0.54 at localhost was unable to start within 45 seconds. If the server requires more time, try increasing the timeout in the server editor". After getting this message i have increased the time for server to start but the same message i am getting again.
我在 ecllipse 中运行 apache tomcat 服务器时遇到错误,错误描述为“本地主机上的服务器 apache-tomcat-7.0.54 无法在 45 秒内启动。如果服务器需要更多时间,请尝试增加服务器中的超时时间编辑”。收到这条消息后,我增加了服务器启动的时间,但我又收到了同样的消息。
Console prints error is
控制台打印错误是
Jun 23, 2014 11:05:20 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:example' did not find a matching property.
Jun 23, 2014 11:05:20 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jun 23, 2014 11:05:20 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Jun 23, 2014 11:05:20 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 868 ms
Jun 23, 2014 11:05:20 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jun 23, 2014 11:05:20 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.54
Jun 23, 2014 11:05:21 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Jun 23, 2014 11:05:21 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Jun 23, 2014 11:05:21 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 458 ms
采纳答案by Stefan
Eclipse has a timeout for starting and stopping Tomcat. You can change it, by opening 'Servers' view, double clicking the server name. As I can see form your logs your server did start in 458ms. But this problem might also be caused by components running lazily after server startup, f.e. servlets having a load-on-startup value greater than 0.
Eclipse 具有启动和停止 Tomcat 的超时时间。您可以通过打开“服务器”视图,双击服务器名称来更改它。正如我从您的日志中看到的,您的服务器确实在 458 毫秒内启动。但是这个问题也可能是由于组件在服务器启动后延迟运行造成的,fe servlet 的 load-on-startup 值大于 0。
First check if your server really starts up completly. This is when the green 'play' icon ('Start server') turns into a red 'stop' icon and the message 'starting server...' dissapears in the 'Progress' view. If that is not working increase the startup time, as mentioned before. If even that is not working check your servlets for endless slopes or connection attempts to a webservice or a database.
首先检查您的服务器是否真的完全启动。这是当绿色“播放”图标(“启动服务器”)变成红色“停止”图标并且“正在启动服务器...”消息在“进度”视图中消失时。如果这不起作用,请增加启动时间,如前所述。如果即使这样也不起作用,请检查您的 servlet 是否有无休止的斜坡或连接到 Web 服务或数据库的尝试。