File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes Servlet reload Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Servlet reload Problem" Watch "Servlet reload Problem" New topic

Servlet reload Problem


Joined: Oct 06, 2002
Posts: 4
Hi guys
i am running servlets on Tomcat 5.Every time i make changes to the servlet i need to restart the Server which is very much annoying.
I made changes in the server.xml and by adding

<Context path="/CPT" docBase="webapps/CPT" debug="0" reloadable="true" >

at the bottom.But still i need to restart the server everytime to see the changes.

Can anyone of you help me on this.

/**********************server.xml******************************************/ <?xml version='1.0' encoding='utf-8'?>

<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
<Environment name="simpleValue" type="java.lang.Integer" value="30"/>
<Resource auth="Container" description="User database that can be updated and saved" name="UserDatabase" type="org.apache.catalina.UserDatabase"/>
<ResourceParams name="UserDatabase">
<Service name="Catalina">
<Connector acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" port="55" redirectPort="8443">
<Connector port="8009" protocol="AJP/1.3" protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler" redirectPort="8443">
<Engine defaultHost="localhost" name="Catalina">
<Host appBase="webapps" name="localhost">
<Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_log." suffix=".txt" timestamp="true"/>
<Logger className="org.apache.catalina.logger.FileLogger" prefix="catalina_log." suffix=".txt" timestamp="true"/>
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"/>

<Context path="/CPT" docBase="webapps/CPT" debug="0" reloadable="true" >

Shakil Munavary
Joyce Lee
Ranch Hand

Joined: Jul 11, 2003
Posts: 1392
Hi Munavary,

I added the "reloadable" just after <Host...

<!-- Tomcat 5: server.xml -->

<Host name="localhost" debug="0" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">

<!-- added by Joyce -->
<DefaultContext reloadable="true" />

<!-- Defines a cluster for this node,
By defining this element, means that every manager will be changed.

For more info, check out CoreServlets: 4. Turn on Servlet Reloading.

[ October 13, 2004: Message edited by: Joyce Lee ]

Joined: Oct 06, 2002
Posts: 4
Thank you Joyce Lee

It fixed my problem
I agree. Here's the link:
subject: Servlet reload Problem