You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Luke Vanderfluit <lu...@chipcity.com.au> on 2003/08/19 22:25:57 UTC

changing class file and reloading question

Hi,

I'm running tomcat 4.1.27 standalone on Redhat 9

I have a class that I'm changing (development) and don't want to have to
restart tomcat each time I make a change.

It wouldn't be so bad to do that if it wasn't for the fact that
tomcat takes ages to read my servlet every time it's restarted.

I have got the following entry in my server.xml file

#####################################
<DefaultContext reloadable="true"/>

        <!-- Tomcat Root Context -->

        <Context path="" docBase="ROOT" debug="0" reloadable="true">
        </Context>
#####################################

The class I'm changing is in the ROOT/WEB-INF/classes directory

the console message when I hit 'reload' on the browser is:

WebappClassLoader:   Resource '/WEB-INF/classes/Topic3x4.class' was
modified; Date is now: Wed Aug 20 05:53:59 CST 2003 Was: Wed Aug 20
05:44:04 CST 2003

How do I get tomcat to indeed reload the classes without having to
restart each time?

Thanks,
kind regards,
-- 
====================================
"when my computer smiles, I'm happy"
====================================
Luke Vanderfluit 
Mobile: 0421 276 282


Re: changing class file and reloading question

Posted by Paul Sundling <to...@tkz.net>.
You can reload using the manager app (the link is on the start page when 
you first start tomcat).  You can also use an ant target.  You can 
reload a single webapp, which is probably the better way of doing it.  
Here's an example target from a build.xml that takes an arguement:



  <target name="reload" depends="deploy" description="Reloads Tomcat 
Application (Local)">
    <get src="http://127.0.0.1:8080/manager/reload?path=/${app.name}"
    dest="status.txt"
    username="yourtomcataccount"
    password="yourtomcatpassword" />
    <loadfile property="catalina.reload" srcFile="status.txt" />
    <echo>${catalina.reload}</echo>
    <delete file="status.txt"/>
  </target>


Luke Vanderfluit wrote:

>Hi,
>
>I'm running tomcat 4.1.27 standalone on Redhat 9
>
>I have a class that I'm changing (development) and don't want to have to
>restart tomcat each time I make a change.
>
>It wouldn't be so bad to do that if it wasn't for the fact that
>tomcat takes ages to read my servlet every time it's restarted.
>
>I have got the following entry in my server.xml file
>
>#####################################
><DefaultContext reloadable="true"/>
>
>        <!-- Tomcat Root Context -->
>
>        <Context path="" docBase="ROOT" debug="0" reloadable="true">
>        </Context>
>#####################################
>
>The class I'm changing is in the ROOT/WEB-INF/classes directory
>
>the console message when I hit 'reload' on the browser is:
>
>WebappClassLoader:   Resource '/WEB-INF/classes/Topic3x4.class' was
>modified; Date is now: Wed Aug 20 05:53:59 CST 2003 Was: Wed Aug 20
>05:44:04 CST 2003
>
>How do I get tomcat to indeed reload the classes without having to
>restart each time?
>
>Thanks,
>kind regards,
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: changing class file and reloading question

Posted by Paul Sundling <to...@tkz.net>.
You can reload using the manager app (the link is on the start page when 
you first start tomcat).  You can also use an ant target.  You can 
reload a single webapp, which is probably the better way of doing it.  
Here's an example target from a build.xml that takes an arguement:



  <target name="reload" depends="deploy" description="Reloads Tomcat 
Application (Local)">
    <get src="http://127.0.0.1:8080/manager/reload?path=/${app.name}"
    dest="status.txt"
    username="yourtomcataccount"
    password="yourtomcatpassword" />
    <loadfile property="catalina.reload" srcFile="status.txt" />
    <echo>${catalina.reload}</echo>
    <delete file="status.txt"/>
  </target>


Luke Vanderfluit wrote:

>Hi,
>
>I'm running tomcat 4.1.27 standalone on Redhat 9
>
>I have a class that I'm changing (development) and don't want to have to
>restart tomcat each time I make a change.
>
>It wouldn't be so bad to do that if it wasn't for the fact that
>tomcat takes ages to read my servlet every time it's restarted.
>
>I have got the following entry in my server.xml file
>
>#####################################
><DefaultContext reloadable="true"/>
>
>        <!-- Tomcat Root Context -->
>
>        <Context path="" docBase="ROOT" debug="0" reloadable="true">
>        </Context>
>#####################################
>
>The class I'm changing is in the ROOT/WEB-INF/classes directory
>
>the console message when I hit 'reload' on the browser is:
>
>WebappClassLoader:   Resource '/WEB-INF/classes/Topic3x4.class' was
>modified; Date is now: Wed Aug 20 05:53:59 CST 2003 Was: Wed Aug 20
>05:44:04 CST 2003
>
>How do I get tomcat to indeed reload the classes without having to
>restart each time?
>
>Thanks,
>kind regards,
>  
>