You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Dustin Callaway <DC...@hfnweb.com> on 2000/02/11 17:29:15 UTC

Servlet reloading?

Does anyone know how servlet reloading works (or if it works) with Tomcat?
With many commercial servlet containers, the servlets directory uses a
special class loader to automatically reload servlets after they are
altered. Does the classes directory within each context work the same with
Tomcat? Or is there another directory that supports automatic servlet
reloading?

Dustin Callaway
(callaway@sourcestream.com)

Re: Servlet reloading?

Posted by "Craig R. McClanahan" <cm...@mytownnet.com>.
costin@eng.sun.com wrote:

> > > Does anyone know how servlet reloading works (or if it works) with Tomcat?
> >
> > Your parenthetical comment speaks to the actual situation -- it's not
> > currently implemented, although there's work in progress to attempt to
> > implement this in time for 3.1.
>
> There is a partial implementation, it should work for development if you
> don't do something special - I have no ideea how it interacts with Session
> objects or context attributes ( which are already loaded by the old class
> loader), but it should work at the same level as JServ ( the code is just
> cut&paste from there and the logic is the same ).
>

Costin, you'll want to do one of two things for the sessions to avoid class cast
errors:

* Persist them to session store before reloading, then load them again.

* Just kill them all.

Also, have you defined some mechanism to decide what "class path" is subject to
auto-reloads -- probably the WEB-INF/lib JAR files and the WEB-INF/lib classes?
Anything loaded by the system class loader isn't going to be reloadable.

>
> Nobody tested it, I just added the glue code and did a small sanity check.
>
> Costin
>

Craig



Re: Servlet reloading?

Posted by co...@eng.sun.com.
> > Does anyone know how servlet reloading works (or if it works) with Tomcat?
> 
> Your parenthetical comment speaks to the actual situation -- it's not
> currently implemented, although there's work in progress to attempt to
> implement this in time for 3.1.

There is a partial implementation, it should work for development if you 
don't do something special - I have no ideea how it interacts with Session 
objects or context attributes ( which are already loaded by the old class
loader), but it should work at the same level as JServ ( the code is just
cut&paste from there and the logic is the same ).

Nobody tested it, I just added the glue code and did a small sanity check.

Costin


Re: Servlet reloading?

Posted by "Craig R. McClanahan" <cm...@mytownnet.com>.
Dustin Callaway wrote:

> Does anyone know how servlet reloading works (or if it works) with Tomcat?

Your parenthetical comment speaks to the actual situation -- it's not
currently implemented, although there's work in progress to attempt to
implement this in time for 3.1.

>
> With many commercial servlet containers, the servlets directory uses a
> special class loader to automatically reload servlets after they are
> altered. Does the classes directory within each context work the same with
> Tomcat? Or is there another directory that supports automatic servlet
> reloading?
>

None at all yet.  How it will work when implemented remains to be defined by
whoever implements it :-).

>
> Dustin Callaway
> (callaway@sourcestream.com)

Craig