• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

How does Tomcat 6 know to automatically redeploy an application?

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I shut Tomcat down and then thought I could remove an application by simply deleting its directory under the webapps directory.

However when I restarted Tomcat it automatically redeployed (installed) the application.

The application build is on the same machine and under my d:\"eclipse workspace" directory (this is Windows 7). I grepped the whole of the tomcat installation to see if I could find this value anyway (that is, where Tomcat would find the files to redeploy) but didn't come up with anything.

How does Tomcat know where and how to find and redeploy an application? Is there a file that represents the central repository for a Tomcat installation for what applications it should find? I looked through the files in the %TOMCAT_HOME%\conf and didn't find what I was looking for there either.

thanks - pat
 
patrick flaherty
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Perhaps I was wrong and Tomcat doesn't have a central listing of applications - perhaps it just bases itself off of what it finds in webapps.

I removed my application again by simply deleting the its directory and contents from the file system. When I reran Tomcat it did not redeploy.

So I deployed it from using http://localhost:8080/manager/html using the Tomcat application root directory name and the project's WAR file from its build location under Eclipse and that worked.

Anyone know how to deploy to Tomcat 6 from Eclipse 3.6? Its an Eclipse maven project using m2e. I've looked around inside Eclipse and have yet to figure out how to successfully use Eclipse to deploy. 'Build', 'package', etc: yes. But the maven install puts the both the WAR and extracted WAR into a local Eclipse directory. There must be some way of telling Eclipse where the Tomcat install directory is.
 
Saloon Keeper
Posts: 28472
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nope. Tomcat doesn't have a central registry of webapps. What it does is scan the webapp contexts when it starts up. And, by default, periodically thereafter. The contexts that are scanned are as follows:

1. The TOMCAT_HOME/webapps directory. If an exploded WAR is found, Tomcat attempts to deploy it. If an unexploded WAR is found AND there is no corresponding exploded WAR, Tomcat will explode it and deploy it (assuming default server config).

2. The webapp context directory. This is typically TOMCAT_HOME/conf/catalina/localhost. Contexts found there will be deployed.

3. The Tomcat server.xml file. However, this is no longer a recommended place to put webapp Context definitions and hasn't been for a long, long time.

I have probably missed a place or 2. And, in case anyone's wondering, "TOMCAT_HOME" is the cop-out shorthand I use when referring to the Tomcat server's root directory and am too lazy to lookup whether it should be the CATALINA_HOME location or the CATALINA_BASE location, since usually they're the same place.
 
patrick flaherty
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks Tim - that's helpful.

I now have it sorted out and working.
 
If you are using a rototiller, you are doing it wrong. Even on this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic