You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by sn...@hotmail.com on 2001/12/12 09:01:07 UTC

SERVLET CACHING PROBLEM IN TOMCAT- SNODX

Greetings,
         I am facing a servlet caching problem in Tomcat. I create a
servlet .java file compile it and put it in the webapps folder of the
TOMCAT_HOME folder. I start the Tomcat server and invoke the servlet via
http://localhost:<TomCat port no>/servlet/<Servlet name> in Netscpe. It gets
invoked. All is well uptil now.

         Problem comes when I make changes in the .java file, recompile it,
place it in the same TOMCAT_HOME/webapps folder, and again invoke it in
Netscape via http://localhost:<Tomcat Port No>/servlet/<Servlet name>. The
ALTERED sevlet does NOT get invoked, the old servlet is getting invoked.

         This must mean Tomcat is caching its sevlets somewhere, and it is
picking up the servlets from that cache, ignoring the actual .class servlet file in
the webapps folder. Maybe the cache gets cleared everytime Tomcat restarts, but
I find it inconvenient to frequently restart Tomcat.

         So what is the one time solution to this servlet caching problem,
WITHOUT HAVING TO REGULARLY RESTART TOMCAT? Will a startup servlet running
continuosly alongwith Tomcat, performing the servlet cache cleaning
operation- regularly say every 10 seconds- solve the problem? If so then
what should be the coding of the servlet? Should I use classes of the
java.lang.ref package- PhantomReference e.t.c- (
http://java.sun.com/products/jdk/1.2/docs/api/java/lang/ref/package-summary.html
)? Or can some changes in server.xml do the trick?

         I have Apache 1.3.19, Tomcat 3.23 installed, configured and
running on RedHat Linux 6.2 platform.

         Waiting for an early response. Thanks in advance.
                                                             SNODX

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


RE: SERVLET CACHING PROBLEM IN TOMCAT- SNODX

Posted by Amit Kelkar <am...@postmodern.com.au>.
That does not necessarily solve the problem. We were running Tomcat 3.1/3.2
for close to 12 months with reloadable=true set, and yet tomcat would not
reload class files without restarting...

My recommendation would be to upgrade to tomcat4, will solve all your
problems... the upgrade is not hard.


Amit Kelkar



-----Original Message-----
From: Volker Leidl [mailto:leidl@nt.imp.univie.ac.at]
Sent: Wednesday, 12 December 2001 9:46 PM
To: Tomcat Users List
Subject: RE: SERVLET CACHING PROBLEM IN TOMCAT- SNODX

Add reloadable="true" to your webb apps context tag in server.xml.

Volker.

> -----Original Message-----
> From: snodx@hotmail.com [mailto:snodx@hotmail.com]
> Sent: Wednesday, December 12, 2001 9:01 AM
> To: tomcat-user@jakarta.apache.org
> Subject: SERVLET CACHING PROBLEM IN TOMCAT- SNODX
>
>
> Greetings,
>          I am facing a servlet caching problem in Tomcat. I create a
> servlet .java file compile it and put it in the webapps folder of the
> TOMCAT_HOME folder. I start the Tomcat server and invoke the servlet via
> http://localhost:<TomCat port no>/servlet/<Servlet name> in
> Netscpe. It gets
> invoked. All is well uptil now.
>
>          Problem comes when I make changes in the .java file,
> recompile it,
> place it in the same TOMCAT_HOME/webapps folder, and again invoke it in
> Netscape via http://localhost:<Tomcat Port No>/servlet/<Servlet name>. The
> ALTERED sevlet does NOT get invoked, the old servlet is getting invoked.
>
>          This must mean Tomcat is caching its sevlets somewhere, and it is
> picking up the servlets from that cache, ignoring the actual
> .class servlet file in
> the webapps folder. Maybe the cache gets cleared everytime Tomcat
> restarts, but
> I find it inconvenient to frequently restart Tomcat.
>
>          So what is the one time solution to this servlet caching problem,
> WITHOUT HAVING TO REGULARLY RESTART TOMCAT? Will a startup servlet running
> continuosly alongwith Tomcat, performing the servlet cache cleaning
> operation- regularly say every 10 seconds- solve the problem? If so then
> what should be the coding of the servlet? Should I use classes of the
> java.lang.ref package- PhantomReference e.t.c- (
> http://java.sun.com/products/jdk/1.2/docs/api/java/lang/ref/packag
e-summary.html
)? Or can some changes in server.xml do the trick?

         I have Apache 1.3.19, Tomcat 3.23 installed, configured and
running on RedHat Linux 6.2 platform.

         Waiting for an early response. Thanks in advance.
                                                             SNODX

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


RE: SERVLET CACHING PROBLEM IN TOMCAT- SNODX

Posted by Volker Leidl <le...@nt.imp.univie.ac.at>.
Add reloadable="true" to your webb apps context tag in server.xml.

Volker.

> -----Original Message-----
> From: snodx@hotmail.com [mailto:snodx@hotmail.com]
> Sent: Wednesday, December 12, 2001 9:01 AM
> To: tomcat-user@jakarta.apache.org
> Subject: SERVLET CACHING PROBLEM IN TOMCAT- SNODX
>
>
> Greetings,
>          I am facing a servlet caching problem in Tomcat. I create a
> servlet .java file compile it and put it in the webapps folder of the
> TOMCAT_HOME folder. I start the Tomcat server and invoke the servlet via
> http://localhost:<TomCat port no>/servlet/<Servlet name> in
> Netscpe. It gets
> invoked. All is well uptil now.
>
>          Problem comes when I make changes in the .java file,
> recompile it,
> place it in the same TOMCAT_HOME/webapps folder, and again invoke it in
> Netscape via http://localhost:<Tomcat Port No>/servlet/<Servlet name>. The
> ALTERED sevlet does NOT get invoked, the old servlet is getting invoked.
>
>          This must mean Tomcat is caching its sevlets somewhere, and it is
> picking up the servlets from that cache, ignoring the actual
> .class servlet file in
> the webapps folder. Maybe the cache gets cleared everytime Tomcat
> restarts, but
> I find it inconvenient to frequently restart Tomcat.
>
>          So what is the one time solution to this servlet caching problem,
> WITHOUT HAVING TO REGULARLY RESTART TOMCAT? Will a startup servlet running
> continuosly alongwith Tomcat, performing the servlet cache cleaning
> operation- regularly say every 10 seconds- solve the problem? If so then
> what should be the coding of the servlet? Should I use classes of the
> java.lang.ref package- PhantomReference e.t.c- (
> http://java.sun.com/products/jdk/1.2/docs/api/java/lang/ref/packag
e-summary.html
)? Or can some changes in server.xml do the trick?

         I have Apache 1.3.19, Tomcat 3.23 installed, configured and
running on RedHat Linux 6.2 platform.

         Waiting for an early response. Thanks in advance.
                                                             SNODX

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>