I have two different tomcat servers in the same folder. But I have changed the port numbers in both the server.xml files to avoid any conflict. Also I am able to start both the servers as well. But after 1-2 minutes, which ever the server was started first will be stopped. Only the recently started server will be working. Request you to please help me out to resolve this issue.
There are 2 environment variables used by Tomcat: CATALINA_HOME and CATALINA_BASE.
CATALINA_HOME contains directories that can be shared between multiple instances of Tomcat. That includes such things as the bin and lib directories.
CATALINA_BASE contains the stuff that cannot be shared. You have to have a separate CATALINA_BASE for each instance of the Tomcat server. CATALINA_BASE contains things like the conf, webapps, work, temp, and logs directories.
For single-instance Tomcat users, CATALINA_HOME and CATALINA_BASE can point to the same root directory, but in your case, that's not possible.
An IDE is no substitute for an Intelligent Developer.