First of all you also should do that in the lastModifiedTime call of the URLResourceStream class.
But when debugging i see that the JarFile instance field in the JarUrlConnection instance that i get
is not there yet when in the lastModified calll. The last modified call doesn't open the file yet. It just looks to the time stamp of the file i guess.
The real opening of the jar file is in another method:
public InputStream getInputStream() throws ResourceStreamNotFoundException
{
if (inputStream == null)
{
try
{
inputStream = url.openStream();
}
catch (IOException e)
{
throw new ResourceStreamNotFoundException("Resource " + url
+ " could not be opened", e);
}
}
return inputStream;
}
i think this is the big problem.. url.openStream() does a url.openConnection().getInputStream()
And then the jar file is suddenly there!
we do close the input stream but that doesn't have any effect on the JarUrlConnection that is made
byt openConnection()
So i guess we should do that in 2 steps.. First openConnection or self. Keep that in an internal reference just like
inputstream. And also try to close that if we can by testing if it is a httpurlconnection or a jarurlconnection..
can you test that if that works?
johan
On 9/16/06,
Johan Compagner <[EMAIL PROTECTED]> wrote:
Let m know if that helps for your situation.
if really a jar url connection is returned in your case.
Because this doesn't have to be the case. Any kind of UrlConnection can be returned (WebLogic does have its own ZipUrlConnection or something like that)
In the end this is a problem of the ClassLoader not closing its internal stuff. Or that UrlConnection doesn't have a disconnect() method
in its interface what every UrlConnection must implement.. So that we can disconnect any url connection.
I really don't get it why there is a connect() in the interface but no cleanup method
It is know bug in the java bug parade. Dont know directly what the number is. Search this mailing list it is talked about quite a lot.
johanOn 9/16/06, Jean-Baptiste Quenot < [EMAIL PROTECTED]> wrote:Hi,
When deploying a Wicket application in DEVELOPMENT mode with only
JARs in WEB-INF/lib (no WEB-INF/classes), and templates included
in JARs, the number of file descriptors increases steadily,
leading to an OS error: «Too many files open».
When turning configuration to DEPLOYMENT, the problem does not
arise. So it seems like template reloading is leaking JAR file
descriptors.
Note: another Wicket user told me about this exact problem. I'm
not the only one apparently. Are you aware of the problem?
Do you think the attached patch could fix the problem? I will let
the patched system run until tomorrow to see if it is still
leaking files.
To watch the number of times the JARs are open I'm using the
following command:
lsof -p <java-process-id> | grep WEB-INF/lib | cut -b60- | sort | uniq -c
FWIW I found a similar problem described at Sun:
http://bugs.sun.com/bugdatabase/view_bug.do;:YfiG?bug_id=4386865
Thanks for your help,
--
Jean-Baptiste Quenot
aka John Banana Qwerty
http://caraldi.com/jbq/-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-develop mailing list
Wicket-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-develop
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ Wicket-develop mailing list Wicket-develop@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-develop