jon * wrote: > Hello Joel, > > Any ideas? This is related to a patch that you provided... > > <http://www.working-dogs.com/cvsweb/index.cgi/jserv/src/java/org/apache/java > /lang/AdaptiveClassLoader.java.diff?r1=1.13&r2=1.14> > > thanks, > > -jon > > ---------- > From: Jeff Hutchison <[EMAIL PROTECTED]> > Reply-To: [EMAIL PROTECTED] > Date: 18 Jan 2000 21:30:21 -0000 > To: [EMAIL PROTECTED] > Subject: mod_jserv/5602: AdaptiveClassLoader will not load resource from > zipfile > > >Number: 5602 > >Category: mod_jserv > >Synopsis: AdaptiveClassLoader will not load resource from zipfile > >Confidential: no > >Severity: serious > >Priority: medium > >Responsible: jserv > >State: open > >Class: sw-bug > >Submitter-Id: apache > >Arrival-Date: Tue Jan 18 13:40:00 PST 2000 > >Closed-Date: > >Last-Modified: > >Originator: [EMAIL PROTECTED] > >Release: Apache 1.3.9 + JServ 1.1 > >Organization: > apache > >Environment: > Redhat 6.1 Linux > Linux narwhal.inst.strykercorp.com 2.2.12-20smp #1 SMP Mon Sep 27 10:34:45 > EDT 1999 i686 unknown > java full version "JDK 1.1.8 IBM build l118-19991013 (JIT enabled: jitc)" > >Description: > I've found a bug in AdaptiveClassLoader.loadResourceFromZipfile. This > method returns an InputStream with zipfile.getInputStream from within the > main block of a try/catch/finally statement and then calls zipfile.close > from within the finally block of the same. When I commented out the > finally block of the try/catch/finally, it works fine. (This is how it > was up through 1.1b3.) > > Grossly paraphrased it's doing this: > > try { > ... > return zipfile.getInputStream(entry); > ... > } catch (IOException ex) { > return null; > } finally { > ... > zipfile.close(); > ... > } > > >How-To-Repeat: > Attempt to load property file from repository jar file. > >Fix: > Remove finally block, zipfile should close when gc'd. Should is the operative word here. The zipfile should closed when gc'd but doesn't, thus leaking file descriptors. Now, maybe this is due to a bug in the JVM I'm using ( JDK 1.1.8 on AIX 4.3.2 ), I haven't tried it on other platforms to see if the same problem occurs there. But my code is absolutely crippled if that zipfile doesn't get closed. I think an appropriate fix would be to read in the data from the ZipEntry within the try block above, store it in a byte array and then return it wrappered in a ByteArrayOutputStream. It shouldn't be difficult. I'll try to work up a patch to do this and post it later today. -- Joel Bartley IBM Global Services Burlington, VT [EMAIL PROTECTED] The views expressed above belong to me and do not necessarily represent those of IBM. ���������������������������������������������N�.n�+��������Zr������x�v�,��&N�����r��{�ڽ�ڥ�!{��b���"�ݢ�r����b���ӭ����m��������Zr���?����f���m�_Ϯ��zk��:'� +�)��� ��(
