File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Speed Up Development with Hot Deploy ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Speed Up Development with Hot Deploy ? " Watch "Speed Up Development with Hot Deploy ? " New topic

Speed Up Development with Hot Deploy ?

Pete Neu
Ranch Hand

Joined: Feb 18, 2005
Posts: 86
Hello ,

up to now I was using tomcat for developement. But it
always takes so long on my P4 1.6 Ghz for the server
to start up each time I redeploy.

Can I gain some time if I use an application server with
hot deploy? If yes, is there any server which is
especially fast?
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63838

Perhaps you'd be better served to find out why your server startup is so slow. Also, you do know that you do not need to stop and restart the server to re-deploy a context? The manager application allows you to stop and start app contexts individually.

[Asking smart questions] [About Bear] [Books by Bear]
K Riaz
Ranch Hand

Joined: Jan 08, 2005
Posts: 375
Yes this has been a long problem for me too, especially when you add new classes to a web application in Tomcat and need to restart it.
Ben Souther

Joined: Dec 11, 2004
Posts: 13410


Set to true if you want Catalina to monitor classes in /WEB-INF/classes/ and /WEB-INF/lib for changes, and automatically reload the web application if a change is detected. This feature is very useful during application development, but it requires significant runtime overhead and is not recommended for use on deployed production applications. That's why the default setting for this attribute is false. You can use the Manager web application, however, to trigger reloads of deployed applications on demand.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Pete Neu
Ranch Hand

Joined: Feb 18, 2005
Posts: 86
If I read this right you have to create a context.xml in
Tomcat 5.0\conf\Catalina\localhost and there specify the
that it should reload each time a change is done.

Do you have sample context.xml? The default installation
does not include it.
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

No the context element is in an xml fragment file.
The file only contains the <Context... tag (In previous versions of Tomcat this tag would have been entered in your server.xml file).

The name of the file will be the same as your application (context) name.

IE: if your app was named myApp (http://localhost:8080/myApp)
The name of the file would be "myApp.xml"
It's contents would look like this:

<Context docBase="myApp"

Most of the attributes are optional (as they have default values)
The complete list can be found here:
subject: Speed Up Development with Hot Deploy ?
It's not a secret anymore!