tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Larry Isaacs <Larry.Isa...@sas.com>
Subject RE: Can a servlet exit? (Dynamic deploy ?)
Date Thu, 07 Feb 2002 21:11:26 GMT
Tomcat 3.2.x has problems with reloading because it
only tries to "reload" the web application's context
classloader.  The default behavior for Tomcat 3.3
is to "restart" the web application, which I think
is what Tomcat 4.x does as well.  This is much more
likely to succeed.

I believe Tomcat 3.3 will detect changes to classes
in WEB-INF/classes, jars in WEB-INF/lib, and changes
to web.xml.  Changes to web.xml will included in
the "restart".

Note that problems have been found with Java2's
URLClassLoader (at least for JDK 1.3.x) such that
updated jars in WEB-INF/lib don't always reload
properly.  To deal with this in Tomcat 3.3.1,
a new attribute, "use11Loader" has been added to the
LoaderInterceptor11 module.  Setting this true
will cause Tomcat to use a JDK 1.1.x compatible
classloader, very similar to the one used in Tomcat
3.2.x.  It is able to successfully reload jars.
You can use this option in the current Tomcat 3.3.1-dev
if you need jar reloading.

It is also possible to trigger a "re-deploy restart"
if a WAR file is updated, though I think this behavior
is disabled by default.

Cheers,
Larry

> -----Original Message-----
> From: Eli Spizzichino [mailto:jdev@javanet.info]
> Sent: Thursday, February 07, 2002 3:30 PM
> To: Tomcat Users List
> Subject: Re: Can a servlet exit? (Dynamic deploy ?)
> 
> 
> Hi to all,
> reading this mail and other I understand the version 3.3 and 
> previous are 
> unable to dynamic reload classes or init parameter without 
> restart the 
> whole application server.
> Instead the nightly build of Tomcat the 4.0-20020124 is able 
> dynamic load 
> classes and web.xml etc.
> Is this correct?
> I not have big experience but what automatic WAR deploy is for?
> And reloadable=true in server.xml?
> 
> Probably I misunderstand something, let me know
> 
> Eli
> 
> 
> At 08.49 07/02/2002 -0800, you wrote:
> 
> 
> >On 7 Feb 2002, Gary Lawrence Murphy wrote:
> >
> > > Date: 07 Feb 2002 01:55:42 -0500
> > > From: Gary Lawrence Murphy <garym@canada.com>
> > > Reply-To: Tomcat Users List <tomcat-user@jakarta.apache.org>,
> > >      Gary Lawrence Murphy <garym@canada.com>
> > > To: Tomcat Users <tomcat-user@jakarta.apache.org>
> > > Subject: Can a servlet exit?
> > >
> > >
> > > can a servlet remove itself?
> >
> >No.  Java provides no means to remove an existing class from a class
> >loader, once it has been loaded.
> >
> > >  I have a situation where a servlet's
> > > configuration file may require on-the-fly edits, but the site runs
> > > dozens of servlets and we don't want to restart tomcat just to
> > > restart one webapp.
> > >
> > > Long term, we plan to re-write the servlet to include a "reload"
> > > function (the proper way to do this), but for now the easiest path
> > > would seem to be to have the servlet purge itself from the servlet
> > > container such that it will be completely reloaded on the next
> > > request.  Is this possible?
> > >
> >
> >The only choice (and the one that Tomcat implements when you reload a
> >webapp) is to shut down the application, throw away its 
> class loader, and
> >load things up again.
> >
> >Craig
> >
> > > --
> > > Gary Lawrence Murphy <garym@teledyn.com> TeleDynamics 
> Communications Inc
> > > Business Innovations Through Open Source Systems: 
http://www.teledyn.com
> > "Computers are useless.  They can only give you answers."(Pablo Picasso)
> >
> >
> > --
> > To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> > For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
> > Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>
> >
> >
>
>
>--
>To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
>For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
>Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>



--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>

--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message