eclipse Run On Server 异常:could not load the Tomcat Server configuration at Servers\tomcat V5.0 Sertomcat

时间:2023-03-08 15:36:37

eclipse Run On Server 异常:could not load the Tomcat Server configuration at Servers\tomcat V5.0 Sertomcat无法运行 servce运行不了的问题解决

:first-child { margin-top: 0; } blockquote > :last-child { margin-bottom: 0; } img { border: 0; max-width: 100%; height: auto !important; margin: 2px 0; } table { border-collapse: collapse; border: 1px solid #bbbbbb; } td { padding: 4px 8px; border-collapse: collapse; border: 1px solid #bbbbbb; } @media only screen and (-webkit-max-device-width: 1024px), only screen and (-o-max-device-width: 1024px), only screen and (max-device-width: 1024px), only screen and (-webkit-min-device-pixel-ratio: 3), only screen and (-o-min-device-pixel-ratio: 3), only screen and (min-device-pixel-ratio: 3) { html, body { font-size: 17px; } body { line-height: 1.7; padding: 0.75rem 0.9375rem; color: #353c47; } h1 { font-size: 2.125rem; } h2 { font-size: 1.875rem; } h3 { font-size: 1.625rem; } h4 { font-size: 1.375rem; } h5 { font-size: 1.125rem; } h6 { color: inherit; } ul, ol { padding-left: 2.5rem; } blockquote { padding: 0 0.9375rem; } }
-->

eclipse中运行项目时,出现

Could not load the Tomcat server configuration at \Servers\Tomcat v5.5 Server at localhost-config. The configuration may be corrupt or incomplete.

File not found: E:\Eclipse\BJCA\Servers\Tomcat v5.5 Server at localhost-config\web.xml

网上的解决方法:

  1. http://blog.****.net/huangxi_love/article/details/7350733

其实主要是路径问题。因为之前我装了tomcat6版本默认的主目录名是apache-tomcat-6.0.16,并在eclipse中作为项目的 server。后来把他卸掉,再装个新版本的tomcat6。这个版本的默认目录是Tomcat 6.0。在eclipse中要把项目发布到tomcat server中时,eclipse需要读取conf\catalina.policy文件。主目录名改变了,catalina.policy文件当然就找 不到。

解决方法就是将原来的server删掉,在添加一个server,设置server runtime ,tomcat安装目录设对就行了!

2.http://blog.sina.com.cn/s/blog_56296e3f0100ngt2.html

3.然而好像并没有什么用,还是出错,我在出错的同时,程序中有关HttpServlet的类,方法,都出现红色下划线(报错,找不到该类);

后来自己解决的方法如下:

3.1 点击工具栏windows--->preference----->Server----->Runtime   environments,查看右侧是否有tomcat,如下:

eclipse Run On Server 异常:could not load the Tomcat Server configuration at Servers\tomcat V5.0 Sertomcat

eclipse Run On Server 异常:could not load the Tomcat Server configuration at Servers\tomcat V5.0 Sertomcat

eclipse Run On Server 异常:could not load the Tomcat Server configuration at Servers\tomcat V5.0 Sertomcat

3.2再次运行,若还有错,则右键项目名------->properties-------->Java  Build  Path

eclipse Run On Server 异常:could not load the Tomcat Server configuration at Servers\tomcat V5.0 Sertomcat

eclipse Run On Server 异常:could not load the Tomcat Server configuration at Servers\tomcat V5.0 Sertomcat

eclipse Run On Server 异常:could not load the Tomcat Server configuration at Servers\tomcat V5.0 Sertomcat

最后一步,不要忘记!!!

eclipse Run On Server 异常:could not load the Tomcat Server configuration at Servers\tomcat V5.0 Sertomcat

3.3若以上2个都有了还报错,那么检查2个tomcat路径是否一样,要是还不能解决,就删掉原来的tomcat,重装一遍,步骤与3.1 、3.2一样