如何禁用 eclipse 服务器启动超时?
默认情况下,在 Eclipse Web Tools 中使用 webapp 服务器时,服务器启动将在 45 秒超时后失败。 我可以在服务器实例属性中增加此超时,但我没有找到完全禁用超时的方法(在调试应用程序启动时很有用)。 有没有办法做到这一点?
By default when using a webapp server in Eclipse Web Tools, the server startup will fail after a timeout of 45 seconds. I can increase this timeout in the server instance properties, but I don't see a way to disable the timeout entirely (useful when debugging application startup). Is there a way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
只是另一个数据点。 如果您在控制台中看到“服务器在 NNN 毫秒内启动”,但服务器视图仍然显示它正在尝试启动,然后超时并最终终止服务器,则可能是您没有配置普通 HTTP 连接器。 例如,如果您的 Tomcat 中仅配置了 2 路 SSL 连接器,则它可以通过“TOMCAT_HOME/bin”中的脚本正常启动,但如果您尝试使用 Eclipse Server 视图启动它,则不会能够打开到 HTTP 端口的连接,并在超时时终止。 (这是一个相当旧的STS 2.1.0。不知道它是否在以后的版本中修复)
Joe
Just another data point. If you see in your Console "Server startup in NNN ms", but the Server view still shows that it is trying to start, and then times out eventually killing the server, it might be that you have no plain HTTP connector configured. For example, if you have only a 2-way SSL connector configured in your Tomcat, it will start fine with the scripts in "TOMCAT_HOME/bin", but if you try to start it with the Eclipse Server view, it won't be able to open a connection to the HTTP port, and will terminate when it hits the timeout. (This was with a fairly old STS 2.1.0. Don't know if it's fixed in later versions)
Joe
如果一切正常,服务器应该开始。
If everything is okay, the server should start.
在 Eclipse Indigo 中,您可以通过双击“服务器”中的服务器来编辑默认超时查看并更改启动超时(见图)。 保存您的更改,然后就可以开始了!
In Eclipse Indigo, you can edit the default timeout by double-clicking on the server in the "servers" view and changing the timeout for start (see graphic). Save your changes, and you're good to go!
朱莉的回答给了你很长的超时时间,但不是无限的。 您可以将服务器配置文件移至工作区,然后直接编辑 xml 文件并设置大于 1800 的限制。这是一个丑陋的 hack,但应该可行。
Julie's answer gives you a long timeout, but not unlimited. You can move the server configuration file to the workspace, and then edit the xml file directly and set a limit greater than 1800. It's an ugly hack, but should work.
转到窗口> 首选项> 服务器
从下拉菜单中将“服务器超时延迟”设置为“无限制”。
或
转到 $WORKSPACE/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.wst.server.core.prefs
在此处添加/更新行 machine-speed= -1
,-1 ~ 无限制
Goto Window > Preferences > Server
Set 'Server timeout delay' as Unlimited from drop-down menu.
or
Goto $WORKSPACE/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.wst.server.core.prefs
Add/update line machine-speed= -1
here, -1 ~ Unlimited
如果更改超时设置后仍然存在问题,那么最好删除 Eclipse 中的服务器配置(在“服务器视图”选项卡中)并重新创建它。
服务器--> 新服务器。
这对我有用。
If you still has issue after changing timeout settings, then it's best to remove the server configuration in Eclipse (in Server view tab) and re-create it again.
Server --> New Server.
It worked for me.
是的,这可行,但最大限制是 1800,即 30 分钟。
有时,在重建整个数据库时(在服务器初始启动时),这可能会持续超过 30 分钟并导致问题。
yes this works, but the maximum limit is 1800, which is 30mins.
Sometimes when rebuilding our entire database (on server initial start) this can go for longer than 30mins and causes problems.
在 eclipse 2019-09 (4.13.0) 中,没有 UI 功能来设置无限值。 它必须介于 1 到 84600 秒(一天)之间。
但是,如果您在工作区中编辑
.metadata/.plugins/org.eclipse.wst.server.core/servers.xml
文件并设置服务器的start-timeout
属性在我的例子中,对于大量-1
,在达到这样的时间之前,它不会中止服务器启动。 我必须重新启动 Eclipse 才能读取更改。注意:使用 UI 编辑其他值会将您的值合并为允许范围内的值。
In eclipse 2019-09 (4.13.0) there is no UI capability to set an unlimited value. It must be between 1 and 84600 seconds (a day).
But if you edit the
.metadata/.plugins/org.eclipse.wst.server.core/servers.xml
file in the workspace and set the server'sstart-timeout
attribute to a large number of in my case-1
it will not abort the server startup until such time is reached. I had to restart eclipse for the change to be read.NOTE: using the UI to edit other values will coalesce your value to a value within the allowable range.