jQuery in Action, 3rd edition
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Hot Deployement in Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Hot Deployement in Tomcat" Watch "Hot Deployement in Tomcat" New topic

Hot Deployement in Tomcat

Micheal John
Ranch Hand

Joined: Nov 01, 2006
Posts: 344
Hi all,
I am preparing for SCWCD exam.. I am frequently changing something in servlet to play around with it..but whenever I am compiling the new thing, I have to restart the Tomcat server to reflect the changed thing.

Previously I have used to change xml (i think server.xml) for hot deployment, without restarting the server, the changes will be reflected.

How to do this? can anyone tell me?

Micheal John
SCJP 1.4 (86%), SCWCD 1.4 (86%), SCBCD 1.3 (85%), SCDJWS (Just Started...) - Satisfaction Lies in Our EFFORT, Not in the ATTAINMENT
Rajesh Seeram

Joined: Dec 28, 2006
Posts: 9
Edit your /conf/server.xml

To turn on servlet reloading, add
<DefaultContext reloadable="true"/>,
If your web application is the default one.
If your web application is not the default one you can use
<Context path="/MyWebApplication" docBase="MyWebApplication" debug="0" reloadable="true" crossContext="true"/>
where "MyWebApplication" is your Web Application name.


Rajesh Seeram<br />-------------<br />SCJP 1.4 (98%)
Micheal John
Ranch Hand

Joined: Nov 01, 2006
Posts: 344
Thanks Rajesh..

But I have look into Core Servlets and JSP, they have mentioned to add reloadable="true" in the <context> element in context.xml..

may be another way of doing it..

And I have noticed even I am changing this, it takes some time to reflect. When I refreshed the page for 1-2 times, the changed thing in the servlet is not reflected..after sometimes the changes are reflecting..
[ December 28, 2006: Message edited by: Micheal John ]
Rajesh Seeram

Joined: Dec 28, 2006
Posts: 9

You can also use Tomcat manager to reload the Web Application.
To open Tomcat Admin/Manager
type http://servername ortnumber/ it displays Tomcat Admin Home Page.
and click on Tomcat Manager and it prompts for UserName & password.
and it redirects to
Tomcat Web Application Manager
where you can
1)check the status of all Web Applications.
2)check the Number of active Sessions for each Web Application.
3)can do some admin activities like
I agree. Here's the link: http://aspose.com/file-tools
subject: Hot Deployement in Tomcat
It's not a secret anymore!