在 Eclipse 中更改 Tomcat 服务器的超时时间
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4845219/
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
Change Tomcat Server's timeout in Eclipse
提问by Dejell
When I try to run my Tomcat I get a message:
当我尝试运行 Tomcat 时,我收到一条消息:
Server Tomcat v6.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.
Where is this server editor? I didn't find it in windows preference server.
这个服务器编辑器在哪里?我在 Windows 首选项服务器中没有找到它。
I am using Eclipse 3.6.
我正在使用 Eclipse 3.6。
回答by Bozho
Open the Servers view -> double click tomcat -> drop down the Timeouts section
Open the Servers view -> double click tomcat -> drop down the Timeouts section
There you can increase the startup time for each particular server.
在那里您可以增加每个特定服务器的启动时间。
回答by Aniket Thakur
- Go to server View
- Double click the server for which you want to change the time limit
- On the right hand side you have timeouts dropdown tab. Select that.
- You then have option to change the time limits.
- 转到服务器视图
- 双击要更改时间限制的服务器
- 在右侧,您有超时下拉选项卡。选择那个。
- 然后您可以选择更改时间限制。
回答by Stephane Manou
SOLVED: That's it!!!! For me was compiling with JDK6 but running Tomcat with JDK7, WST uses the system properties and not the eclipse settings. I also configure the same JDK Version in eclipse and in System (check it with java -version in cmd line)
已解决:就是这样!!!!对我来说,使用 JDK6 编译但使用 JDK7 运行 Tomcat,WST 使用系统属性而不是 eclipse 设置。我还在 eclipse 和 System 中配置了相同的 JDK 版本(在 cmd 行中使用 java -version 进行检查)
Details: I try to configure eclipse like describe here, but it didn′t solve the problem, then I notice in eclipse′s error log that tomcat was started with jre 1.7. in spite of my configurations.
详情:我尝试像这里描述的那样配置eclipse,但没有解决问题,然后我在eclipse的错误日志中注意到tomcat是用jre 1.7启动的。尽管我的配置。
I also try, in cmd line, 'java -version' and obtained '1.7' instead of expected '1.6'.
我还尝试在 cmd 行中使用“java -version”并获得“1.7”而不是预期的“1.6”。
I also decide to configure java 1.6 (like in eclipse) in system panel but it didn′t solve the problem. I also desinstall jre 1.7 restart eclipse AND IT SUCCESS!.. It was a very usefull clue, thank you.
我还决定在系统面板中配置 java 1.6(如在 eclipse 中),但它没有解决问题。我还卸载了 jre 1.7 重新启动 eclipse 并且它成功了!.. 这是一个非常有用的线索,谢谢。
回答by Medo
回答by user3509005
double click tomcat , see configure setting with "timeout" modify the number. Maybe this not the tomcat error.U can see the DB connection is achievable.
双击tomcat,查看configure setting with "timeout" 修改数量。也许这不是tomcat错误。U可以看到数据库连接是可以实现的。
回答by Rohitdev
The issue is also created if you have setup breakpoints in the code and trying to start tomcat in debug mode post some code overhaul.
如果您在代码中设置了断点并尝试在调试模式下启动 tomcat 并发布一些代码检修,也会产生该问题。
Solution is to clear all the breakpoints.
解决方法是清除所有断点。
回答by Jon
Windows->Preferences->Server
Windows->首选项->服务器
Server Timeout can be specified there.
可以在那里指定服务器超时。
or another method via the Servers tab here:
或通过此处的“服务器”选项卡使用其他方法:
http://henneberke.wordpress.com/2009/09/28/fixing-eclipse-tomcat-timeout/
http://henneberke.wordpress.com/2009/09/28/fixing-eclipse-tomcat-timeout/
回答by Ribo
This problem can occur if you have altogether too much stuff being started when the server is started -- or if you are in debug mode and stepping through the initialization sequence. In eclipse, changing the start-timeout by 'opening' the tomcat server entry 'Servers view' tab of the Debug Perspective is convenient. In some situations it is useful to know where this setting is 'really' stored.
如果在服务器启动时启动的东西太多,或者如果您处于调试模式并逐步执行初始化序列,则可能会发生此问题。在 Eclipse 中,通过“打开”调试透视图的 tomcat 服务器条目“服务器视图”选项卡来更改启动超时很方便。在某些情况下,了解此设置的“真正”存储位置很有用。
Tomcat reads this setting from the element in the element in the servers.xml file. This file is stored in the .metatdata/.plugins/org.eclipse.wst.server.core directory of your eclipse workspace, ie:
Tomcat 从servers.xml 文件的元素中的元素中读取此设置。此文件存储在 eclipse 工作区的 .metatdata/.plugins/org.eclipse.wst.server.core 目录中,即:
//.metadata/.plugins/org.eclipse.wst.server.core/servers.xml
//.metadata/.plugins/org.eclipse.wst.server.core/servers.xml
There are other juicy configuration files for Eclipse plugins in other directories under .metadata/.plugins as well.
在 .metadata/.plugins 下的其他目录中还有其他多汁的 Eclipse 插件配置文件。
Here's an example of the servers.xml file, which is what is changed when you edit the tomcat server configuration through the Eclipse GUI:
这是servers.xml 文件的一个示例,当您通过Eclipse GUI 编辑tomcat 服务器配置时,该文件发生了变化:
Note the 'start-timeout' property that is set to a good long 1200 seconds above.
请注意上面设置为 1200 秒的 'start-timeout' 属性。
回答by Marcus Hoelscher
I also had the issue of the Eclipse Tomcat Server timing out and tried every suggestion including:
我也遇到了 Eclipse Tomcat 服务器超时的问题,并尝试了所有建议,包括:
- increasing timeout seconds
- deleting various .metadata files in workspace directory
- deleting the server instance in Eclipse along with the Run Config
- 增加超时秒数
- 删除工作区目录中的各种 .metadata 文件
- 删除 Eclipse 中的服务器实例以及运行配置
Nothing worked until I read Rohitdev's comment and realized that I had, in fact added a breakpoint in an interceptor class after a big code change and had forgotten to toggle it off. I removed it and all other breakpoints and Tomcat started right up.
直到我阅读 Rohitdev 的评论并意识到我实际上在大的代码更改后在拦截器类中添加了一个断点并且忘记将其关闭之前,什么都没有起作用。我删除了它并删除了所有其他断点,然后 Tomcat 立即启动。
回答by Umesh Annegirikar
I have tomcat 8 Update 25 and tomcat 7 but facing the same issue it shows the message 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.
我有 tomcat 8 Update 25 和 tomcat 7,但面对同样的问题,它显示消息 Server Tomcat v7.0 Server at localhost was failed to start in 45 秒。如果服务器需要更多时间,请尝试在服务器编辑器中增加超时时间。