You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Clive Luk <cl...@ilanet.net.au> on 2003/09/03 09:07:22 UTC

restart tomcat everytime I make change to servlet -- after experiment

OK..... seems i am asking a hard question here. But I did some experiment
myself. just to give out more hints to the list to help solving my problem
and I am hoping someone maybe able to help. I am sure someone in the world
will have the same problem  and been solved.

here is what i have done. after no luck with my virtual host setting. i am
trying going through tomcat directly via port 8080

* I created a directory under {$tomcat_home}/webapps/ call mytest
* I copied the WEB-INF to the default place {$tomcat_home}/webapps/mytest
* under that i have
drwxr-xr-x    2 root     root         4096 Sep  3 16:20 classes
-rw-r--r--    1 root     root          998 Sep  3 16:20 web.xml
* under classes i have
-rw-r--r--    1 root     root          870 Sep  3 16:39 HelloWorld.class


in {$tomcat_home}/conf/server.xml

i added that
        <Context path="/mytest" docBase="mytest" debug="0"
                 reloadable="true" crossContext="true">
          <Logger className="org.apache.catalina.logger.FileLogger"
                     prefix="localhost_mytest_log." suffix=".txt"
              timestamp="true"/>
        </Context>

then I can access the HelloWorld servlet by
http://localhost:8080/mytest/HelloWorld
If i made changes on HelloWorld.java, recompile and replace the old
HelloWorld.class with the new one.

I still can see tomcat knows i am making changes

WebappClassLoader:   Resource '/WEB-INF/classes/HelloWorld.class' was
modified; Date is now: Wed Sep 03 16:39:54 EST 2003 Was: Wed Sep 03 16:26:11
EST 2003

but after I refresh the http://localhost:8080/mytest/HelloWorld I still get
the bunch of java errors.

first reload saying HTTP Status 500
type Exception report
message
description The server encountered an internal error () that prevented it
from fulfilling this request.
exception <SNIP> java errors

second reload saying HTTP Status 503 - Servlet HelloWorld is currently
unavailable
type Status report
message Servlet HelloWorld is currently unavailable
description The requested service (Servlet HelloWorld is currently
unavailable) is not currently available.


Then, since I can see mytest under the tomcat manager. I can "reload" it.
but still the same java errors happened. I had to "stop" and "start" mytest
in order to see the changes. But I don't want to do this STOP START ACTION
again and again after every single change of the servlet.

I thought the reloadable="true" will handle that.

I don't really want to blame on a bug of tomcat. But would that be possible.
OR has anyone in the world has done what I want to do without using any
tools like the tomcat manager? I am greatly appreciated for any help.
THANKS.

I am going to pull all my hair out....... : (

Cheers,
Clive


RE: restart tomcat everytime I make change to servlet -- after experiment

Posted by Mike Curwen <gb...@gb-im.com>.
Don't pull out your hair, check my reply to your first post... (class
reloading is buggy in Tomcat 4.1.27)


> -----Original Message-----
> From: Clive Luk [mailto:clive@ilanet.net.au] 
> Sent: Wednesday, September 03, 2003 2:07 AM
> To: Tomcat Users List
> Subject: restart tomcat everytime I make change to servlet -- 
> after experiment
> 

<snip />

> 
> I don't really want to blame on a bug of tomcat. But would 
> that be possible. OR has anyone in the world has done what I 
> want to do without using any tools like the tomcat manager? I 
> am greatly appreciated for any help. THANKS.
> 
> I am going to pull all my hair out....... : (
> 
> Cheers,
> Clive
>