permaculture playing cards*
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
Author

Servlet reload Problem

Munavary
Greenhorn

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" >
</Context>

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'?>
<Server>


<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
<GlobalNamingResources>
<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">
<parameter>
<name>factory</name>
<value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
</parameter>
<parameter>
<name>pathname</name>
<value>conf/tomcat-users.xml</value>
</parameter>
</ResourceParams>
</GlobalNamingResources>
<Service name="Catalina">
<Connector acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" port="55" redirectPort="8443">
</Connector>
<Connector port="8009" protocol="AJP/1.3" protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler" redirectPort="8443">
</Connector>
<Engine defaultHost="localhost" name="Catalina">
<Host appBase="webapps" name="localhost">
<Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_log." suffix=".txt" timestamp="true"/>
</Host>
<Logger className="org.apache.catalina.logger.FileLogger" prefix="catalina_log." suffix=".txt" timestamp="true"/>
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"/>
</Engine>
</Service>

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


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.

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

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

It fixed my problem
 
Consider Paul's rocket mass heater.
 
subject: Servlet reload Problem