Eclipse Luna - 出现错误 - '无法在本地主机上发布 Tomcat v7.0 服务器的服务器配置。多个上下文的路径为“/abc”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/27411015/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 22:17:26  来源:igfitidea点击:

Eclipse Luna - Getting error - 'Could not publish server configuration for Tomcat v7.0 Server at localhost. Multiple Contexts have a path of "/abc"

eclipsetomcatserver.xml

提问by pankaj

I am using Eclipse Luna and getting

我正在使用 Eclipse Luna 并获得

Could not publish server configuration for Tomcat v7.0 Server at localhost.
Multiple Contexts have a path of /TestProject.

无法在本地主机上发布 Tomcat v7.0 服务器的服务器配置。
多个上下文的路径为 /TestProject。

However I can fix this by making path for docbase = /in context string in server.xmlas in context docBase="abc" path="/" reloadable="true"source="org.eclipse.jst.jee.server:abc"/> docBase="xyz" path="/TestProject" reloadable="true" source="org.eclipse.jst.jee.server:xyz"/>

不过,我可以通过使路径解决这个问题docbase = /,在上下文字符串server.xml作为上下文docBase="abc" path="/" reloadable="true"source="org.eclipse.jst.jee.server:abc"/> docBase="xyz" path="/TestProject" reloadable="true" source="org.eclipse.jst.jee.server:xyz"/>

So I wanted to know what role does attribute 'path' play in context and how do I fix it permanently. I have seen the path get carried over when I copy a application to another application.

所以我想知道属性“路径”在上下文中扮演什么角色,以及如何永久修复它。当我将一个应用程序复制到另一个应用程序时,我已经看到路径被保留了下来。

回答by Sarjit Delivala

Go to [workspace folder]->Servers->[Tomcat folder] then open server.xmlfile and search for <Context>tag. There will be multiple <Context>tags, remove the duplicates. Restart your server. Hope this helps.

转到[工作区文件夹]->服务器->[Tomcat文件夹]然后打开server.xml文件并搜索<Context>标签。会有多个<Context>标签,删除重复项。重新启动您的服务器。希望这可以帮助。

回答by mimi Mery

This is related to the server.xmlfile. I had the same problem, and I just switched to a new workspace and now it works!

这与server.xml文件有关。我遇到了同样的问题,我刚刚切换到一个新的工作区,现在它可以工作了!

回答by Keshav Lodhi

Go to [workspace folder]->Servers->[Tomcat folder]then open server.xmlfile and search for the <Context>tag. There will be multiple <Context>tags, remove the duplicates, something like this:

转到[工作区文件夹]->服务器->[Tomcat文件夹]然后打开server.xml文件并搜索<Context>标签。会有多个<Context>标签,删除重复项,如下所示:

<Context docBase="service-name" path="/path of your service" reloadable="true" 
        source="org.eclipse.jst.jee.server:your-service-name" />  
<Context ................... /> 

so remove this second <Context>tag.

所以删除第二个<Context>标签。

回答by Mugeesh Husain

In your eclipse tomcat, open server.xml and search "/abc", you will get this line, please keep only one and remove duplicate lines

在你的eclipse tomcat中,打开server.xml并搜索“/abc”,你会得到这一行,请只保留一个并删除重复行

<Context docBase="abc" path="/abc" reloadable="true" source="org.eclipse.jst.jee.server:abc"/>