This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Hot Deployement in Tomcat" Watch "Hot Deployement in Tomcat" New topic
Author

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
Greenhorn

Joined: Dec 28, 2006
Posts: 9
Hi,
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.


Thanks,


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
Greenhorn

Joined: Dec 28, 2006
Posts: 9
Hi,

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
a)start
b)Stop
c)Reload
d)Undeploy
e)Deploy
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hot Deployement in Tomcat
 
Similar Threads
How can I prevent my software from deploying web in WAR format? I want folders!
Running code when session killed by Hot Deployment
Eclipse Integrated with Tomcat for Hot Deployment
Tomcat NoClassDefFoundError + LifecycleException
Hot Deployment