as i read the site docs this is the correct list where to post the issue
to make the story short : jasper leaves filehandles open as it's compiling
any jsp. the bug is in the

org/apache/jasper/compiler/Compiler.java named file
around the lines ~500
function called public boolean isOutDated(boolean checkClass)

(i really have no time to play around with the cvs,  have a lot of work to do,
hey but at least i found out where the problem resides. so all this information here
is from jakarta-tomcat-5.0.19-src)

the thing is that the code there does the following action to check if the src of
the jsp is up to date (in this case asking for it's last modified time) :

---
jspRealLastModified = jspUrl.openConnection().getLastModified();
---

you see the problem is that the jspUrl.openConnection() opens a stream
to the file when getLastModified is being asked, but it never gets closed.
as tomcat seems to call garbage collect right after this compilation the
garbage-collector manages to clean it up. but if the garbage collector
isn't called for a while (as an example in jetty server) the file handles stay
open althrough they really aren't used for anything besided the getLastModified() call.

now when i fixed it to this

---
java.net.URLConnection uc = jspUrl.openConnection();
jspRealLastModified = uc.getLastModified();
uc.getInputStream().close();
--

it closes up nicely and no "forgotten" streams are left in the jvm, also
it doesn't need a garbage collect after it to clean the filehandle up.


i hope someone who has write access to the jasper source can fix it, i'm not sure that my code written here should be "the one" to use, but at least it works.

Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to