4

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.

ROMANIA_engineer
  • 51,252
  • 26
  • 196
  • 186
pankaj
  • 51
  • 1
  • 1
  • 5

4 Answers4

10

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.

Sarjit Delivala
  • 487
  • 2
  • 13
  • 25
  • You sir, are a genius. I've seen up to 20 solutions to this issue today and yours was by far the shortest and the clearest. Thanks! – Mindsect Team Aug 08 '17 at 21:14
0

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!

CJBS
  • 14,479
  • 5
  • 82
  • 129
mimi Mery
  • 3
  • 1
0

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.

B--rian
  • 5,011
  • 10
  • 34
  • 73
Keshav Lodhi
  • 1,820
  • 1
  • 14
  • 19
0

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"/>
Mugeesh Husain
  • 171
  • 1
  • 12