欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Eclipse+Tomcat加载项目后,启动运行出错,超时啦!

程序员文章站 2022-07-13 17:27:56
...

依旧菜鸟级问题,放在我的博客里,我好找,大神绕行。

 

在Eclipse中用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.”

问题在于,Tomcat设定启动时间太短,只有45s,而工程大,45s启动它不够用。

在WorkSpace中找文件:WorkSpace——.metadata——.plugins——org.eclipse.wst.server.core——servers.xml,打开修改:

 

修改前:

 

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<servers>
  <server auto-publish-setting="2" 
	auto-publish-time="1" 
	configuration-id="/Servers/Tomcat v6.0 Server at localhost-config" 
	deployDir="wtpwebapps" 
	hostname="localhost" 
	id="Tomcat v6.0 Server at localhost" 
	name="Tomcat v6.0 Server at localhost" 
	runtime-id="Apache Tomcat v6.0" 
	server-type="org.eclipse.jst.server.tomcat.60" 
	server-type-id="org.eclipse.jst.server.tomcat.60" 
	start-timeout="45" 
	stop-timeout="15" 
	testEnvironment="true" 
	timestamp="1">
    <list key="modules" value0="zmks_rest::org.eclipse.jst.jee.server:zmks_rest::jst.web::2.5"/>
  </server>
</servers>

 

修改后:

 <?xml version="1.0" encoding="UTF-8" standalone="no"?>

<servers>
  <server auto-publish-setting="2" 
	auto-publish-time="1" 
	configuration-id="/Servers/Tomcat v6.0 Server at localhost-config" 
	deployDir="wtpwebapps" 
	hostname="localhost" 
	id="Tomcat v6.0 Server at localhost" 
	name="Tomcat v6.0 Server at localhost" 
	runtime-id="Apache Tomcat v6.0" 
	server-type="org.eclipse.jst.server.tomcat.60" 
	server-type-id="org.eclipse.jst.server.tomcat.60" 
	start-timeout="1000" 
	stop-timeout="15" 
	testEnvironment="true" 
	timestamp="1">
    <list key="modules" value0="zmks_rest::org.eclipse.jst.jee.server:zmks_rest::jst.web::2.5"/>
  </server>
</servers>

 

修改的是start-timeout的值。

 

要重启Eclipse。