Tomcat Eclipse Error: Multiple contexts having same path

I got the following error while working on a JSP project on Eclipse IDE. I have been using Tomcat server version 7.

Here is the error message:

‘Publishing to Tomcat v7.0 Server at localhost…’ has encountered a problem.

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

Solution

We can solve this problem either from Eclipse IDE itself or by editing a file outside of Eclipse.

From Eclipse

– Open “Project Explorer”
– Go inside “Servers -> Tomcat v7.0 Server at localhost”
– Open server.xml
– Search for tag
– There should be multiple definitions for the path of your project.
Remove the multiple one.

From Directory

– Go to workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/conf
– Edit server.xml file
– Search for tag
– There should be multiple definitions for the path of your project.
Remove the multiple one.

This should solve the error.

Hope it helps. Thanks.