Eclipse – Multiple contexts with the same path error running web service in Eclipse using Tomcat

axiseclipsetomcatweb services

This is the error that I got when I created my first Axis2 web service using Eclipse. After I wrote the class, I created the web service with Apache Axis2. When I click the start server button in eclipse it gives an error message:

Could not publish server configuration for Tomcat v6.0 Server at
localhost.
Multiple contexts have a path of "/FirstApache".

FirstApache is the dynamic web project that I created before. I selected the correct web project from the configuration part in the web service wizard.

How can I fix this?

Best Answer

Search for the server.xml file and check your <Context> tags, probably there are multiple definitions for the same path. Remove the duplicates and it should work for you.

Check out the answer here.

Auto-format the xml file (control + shift + f) since the second <Context> tag may be on the same line, but outside the viewport and really far away from the visible one.