See below.

On Thu, 31 May 2001, Remy Maucherat wrote:

> > i was litlle un detailed sorry but i try to explain.
> >
> > This can be test with Tomcat 4.0 b6-dev (last week CVS version at least i
> haven't see this to be fixed)
> >
> > and turn reloading on to test/ context then create servlet that uses this
> Class [test.TestIt] (i think you know how to do it) make it print number and
> string to HTML page. then do same to index.jsp (i all so think you can do
> it)
> >
> > then compile these to test/WEB-INF/classes and run tomcat. then Look what
> you have there (what are outputs) and changes those string and number and
> recompile classes.
> >
> > after about 15 secs servlet has new context but JSP doesn't. I allready
> have fix this and submit a patch but now one have replyed anything:) it's
> just a little bug there..
> >
> > Tuukka
> >
> > ps. need for more details??
> >
> > pss. if someone allready has this fixed he/she is really glad because this
> BUG forces to stop Tomcat and reload it again everytime when Classes that
> belongs to JSP changes. I have spent to much time waiting:P
> >
> 
> Ok, I understand the bug a bit better now.
> To fix it, I would always load the external classes using the thread's
> context class loader instead of trying to keep an up to date reference on
> it, using something like :
> 
> RCS file:
> /home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/servlet/Jasp
> erLoader.java,v
> retrieving revision 1.3
> diff -r1.3 JasperLoader.java
> 174c174
> <  // Class is in a package, delegate to parent
> ---
> >  // Class is in a package, delegate to thread context class loader
> 176c176,177
> <      clazz = parent.loadClass(name);
> ---
> >      clazz = Thread.currentThread().getContextClassLoader()
> >                 .loadClass(name);
> 
> [ Note : Since the parent is now not used anymore, a lot of useless code
> should be removed. ]
> 
> I'm not a Jasper guru, so I don't know if it's a good idea to do this.
> 
> Remy
> 
> 

I'm not sure this proposed change would really make any difference.  The
"parent" classloader here is the web app classloader already, which is the
same thing that the context class loader is set to.

NOTE:  If we do something like this, we need to make sure that
getResource() and getResourceAsStream() work in JasperLoader as well.

I'll do some more investigation today.

Craig


Reply via email to