You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Aejaz Sheriff <sh...@hotmail.com> on 2001/06/10 17:20:38 UTC

Auto update servlet (not loaded by the system classloader)

Hi,

I have read the solutions given below and understood it very well.But my 
problem is that I cannot dynamically reload servlets. I need to restart for 
every reload of servlet.

Although the servlet in question is not in the Default class loader's 
classpath.

So the servlet is only getting loaded by the Tomcat Servers class loader.

My CLASSPATH is pointing only to my servlet.jar.

Any help on this would be much appreciated

Aejaz



>From: Milt Epstein <me...@uiuc.edu>
>Reply-To: tomcat-user@jakarta.apache.org
>To: <to...@jakarta.apache.org>
>Subject: Re: Automaticaly update the servlets
>Date: Fri, 8 Jun 2001 11:41:05 -0500 (CDT)
>
>On Fri, 8 Jun 2001, Pablo Morillas wrote:
>
> > Thanks. I beleive that I'm seen the light. My problem is that my
> > system class loader (in my server) is loading my classes instead
> > Tomcat, ins't it?
>
>Well, I won't guarantee it 100%, but it very well could be the problem.
>
> >                    Could anyone give me an address where I can find
> > information about the way that Tomcat class loader runs?
>
>I don't have a specific source, but I believe there are
>tutorials/articles about on the web -- do a search at www.google.com.
>I'm pretty sure there was a JDC Tech Tips about classloaders (they're
>all up on the JDC site), and other sites (e.g. javaworld) may have
>stuff on it as well.  You can also check the tomcat
>documentation/source.
>
>
> > How can I force to Tomcat Class loader to take my servlets?
>
>Simply change your classpath so that the relevant directories
>(.../WEB-INF/classes, and probably .../WEB-INF/lib as well) are not
>included.  Do that, try again, and let us know whether it worked.
>
>
> > ----- Original Message -----
> > From: "Randy Layman" <ra...@aswethink.com>
> > To: <to...@jakarta.apache.org>
> > Sent: Friday, June 08, 2001 4:25 PM
> > Subject: RE: Automaticaly update the servlets
> >
> >
> > >
> > > The problem is that the System class loader (the one that loads your
> > > CLASSPATH environment variable) is keeping a cache around of the 
>class.
> > > This is why Milt (correctly) told you to remove the WEB-INF/classes 
>from
> > > your classpath if you want the auto-reloading to work as it is 
>supposed
> > to*.
> > > If the System class loader loads your class then its impossible for 
>Tomcat
> > > to load it, and if Tomcat doesn't load it in the first place, then it
> > can't
> > > unload and reload it.
> > >
> > > Randy
> > >
> > > * - Many people have problems with the way that auto-reloading works 
>in
> > > Tomcat.  A large number have problems like yours, and large numbers 
>also
> > > complain that the auto-reloading doesn't work for non-servlet classes
> > (which
> > > it doesn't due to complexity of the problem).
> > >
> > > > -----Original Message-----
> > > > From: Pablo Morillas [mailto:pablo@sortes.com]
> > > > Sent: Friday, June 08, 2001 10:29 AM
> > > > To: tomcat-user@jakarta.apache.org
> > > > Subject: Re: Automaticaly update the servlets
> > > >
> > > >
> > > > Yes, it is in my classpath. But I don't believe that the
> > > > classpath is the
> > > > problem becouse when I start Tomcat as a service it runs
> > > > properly. If I
> > > > change a .jsp it reload properly.
> > > > I don't know what is happen but, when I delete the class file from 
>the
> > > > WEB-INF/classes the servlet run properly (incredible). Then,
> > > > after I restart
> > > > the server a error was reported. I compile it another in the
> > > > WEB-INF/classes
> > > > without restart Tomcat and it runs ok.
> > > > I suppose that the servlet file is in any cache of Tomcat,
> > > > but I can be
> > > > perfectly wrong. Uses Tomcat any type of GUID to run classes?
> > > >
> > > > I don't know what's happen. Please, advice.
> > > >
> > > > ==================================
> > > > Pablo Morillas
> > > > http://www.sortes.com
> > > > pablo@sortes.com
> > > > ==================================
> > > > ----- Original Message -----
> > > > From: "Milt Epstein" <me...@uiuc.edu>
> > > > To: <to...@jakarta.apache.org>
> > > > Sent: Friday, June 08, 2001 3:03 PM
> > > > Subject: Re: Automaticaly update the servlets
> > > >
> > > >
> > > > > On Fri, 8 Jun 2001, Pablo Morillas wrote:
> > > > >
> > > > > > Hello Filip.
> > > > > >
> > > > > > I didn't know that but, unfortunately the servlet is in the
> > > > > > WEB-INF/classes directory. The scheme is that I start tomcat and 
>I
> > > > >
> > > > > Is WEB-INF/classes in your classpath?  Because it shouldn't
> > > > be if you
> > > > > want reloading to work.
>[ ... ]
>
>Milt Epstein
>Research Programmer
>Software/Systems Development Group
>Computing and Communications Services Office (CCSO)
>University of Illinois at Urbana-Champaign (UIUC)
>mepstein@uiuc.edu
>

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.