Changing web project deploy name in Tomcat server

Before I start with details, I would like to give a brief of the problem so that you exactly know what I mean to say here.

Have you ever tried copying the same project in you workspace to make a duplicate so that you can fiddle with the code and ensure that the original code is not lost. If yes, then while running the project you might have come across the problem where the Tomcat server complained that there was already a project deployed with the same name. Well, this blog is about getting across this problem.

The first thing that comes to mind to get around this problem is changing the following things
1. Project Name
2. The 'Context Root' in 'Web Project Settings'

Below is an image of  the problem.



But to surprise it still doesn't work. Tomcat server picks the deploy name of the project from some where else.

After a bit of finding, I found following file in my project's folder i.e. org.eclipse.wst.common.component
It is located in the ".settings" folder in your project's folder.

The content of the file is as below,



You need to change the "deploy-name" under "wb-module" tag to a different name as I have highlighted above.

That's it. Start eclipse, refresh your workspace and then redeploy your project. You can see the new name there. Well, You are now ready to continue creating wonders.. :-) Cheers!!!

0 comments:

Post a Comment