4
votes

I am using Eclipse Luna and getting

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

However I can fix this by making path for docbase = / in context string in server.xml as 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"/>

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.

4

4 Answers

9
votes

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

0
votes

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

0
votes

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

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

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:

<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.