Recently I have been playing around with Eclipse and Tomcat for a class project. Today I decided to debug something and after I was done, I couldn’t run my code. I kept getting the “Two or more Web modules defined in the configuration have the same context root” error. It had me pulling out my hair for an hour. Finally figured out the solution. Here it is:
note:I have indigo version of Eclipse.
On the left hand side, expend the Servers folder and edit server.xml. Look for two occurrences of the same line. The line will look like the following, where “someApplication” would be your context root.
Context docBase="someApplication" path="/someApplication" reloadable="true" source="org.eclipse.jst.jee.server:someApplication"
Hit Ctrl+F and look for “docBase”, if you see two lines which look alike, delete one of them.