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

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

 

在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代码 复制代码 收藏代码
  1. <?xmlversion="1.0"encoding="UTF-8"standalone="no"?>
  2. <servers>
  3. <serverauto-publish-setting="2"
  4. auto-publish-time="1"
  5. configuration-id="/Servers/Tomcat v6.0 Server at localhost-config"
  6. deployDir="wtpwebapps"
  7. hostname="localhost"
  8. id="Tomcat v6.0 Server at localhost"
  9. name="Tomcat v6.0 Server at localhost"
  10. runtime-id="Apache Tomcat v6.0"
  11. server-type="org.eclipse.jst.server.tomcat.60"
  12. server-type-id="org.eclipse.jst.server.tomcat.60"
  13. <spanstyle="color: rgb(255, 0, 0);">start-timeout="45"</span>
  14. stop-timeout="15"
  15. testEnvironment="true"
  16. timestamp="1">
  17. <listkey="modules"value0="zmks_rest::org.eclipse.jst.jee.server:zmks_rest::jst.web::2.5"/>
  18. </server>
  19. </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="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"?>

Xml代码 复制代码 收藏代码
  1. <servers>
  2. <serverauto-publish-setting="2"
  3. auto-publish-time="1"
  4. configuration-id="/Servers/Tomcat v6.0 Server at localhost-config"
  5. deployDir="wtpwebapps"
  6. hostname="localhost"
  7. id="Tomcat v6.0 Server at localhost"
  8. name="Tomcat v6.0 Server at localhost"
  9. runtime-id="Apache Tomcat v6.0"
  10. server-type="org.eclipse.jst.server.tomcat.60"
  11. server-type-id="org.eclipse.jst.server.tomcat.60"
  12. <spanstyle="color: rgb(255, 0, 0);">start-timeout="1000"</span>
  13. stop-timeout="15"
  14. testEnvironment="true"
  15. timestamp="1">
  16. <listkey="modules"value0="zmks_rest::org.eclipse.jst.jee.server:zmks_rest::jst.web::2.5"/>
  17. </server>
  18. </servers>
<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。

来自 http://124937028-qq-com201202060842.iteye.com/blog/1405624

你可能感兴趣的:(eclipse)