Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 196716 - IllegalStateException: zip file closed
IllegalStateException: zip file closed
Status: CLOSED WONTFIX
Product: platform
Classification: Unclassified
Component: JDK Problems
7.0
All All
: P2 (vote)
: 7.0.1
Assigned To: Jesse Glick
issues@platform
jdk_bug_7050028 EXCEPTIONS_REPORT
:
: 196093 196347 196815 197259 198692 199149 205119 220368 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-03-15 09:30 UTC by villentretenmerth
Modified: 2012-10-22 08:53 UTC (History)
19 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
stacktrace (4.74 KB, text/plain)
2011-03-15 09:30 UTC, villentretenmerth
Details
Minimal test case (1.43 KB, text/x-java)
2011-05-31 15:50 UTC, Jesse Glick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description villentretenmerth 2011-03-15 09:30:25 UTC
Build: NetBeans IDE Dev (Build 201103140400)
VM: Java HotSpot(TM) 64-Bit Server VM, 21.0-b03, Java(TM) SE Runtime Environment, 1.7.0-ea-b133
OS: Windows 7

User Comments:
lhochet: on first opening of a new version upgrading a previous daily

GUEST: Occurs whenever interacting with the source code editor.




Stacktrace: 
java.lang.IllegalStateException: zip file closed
   at java.util.zip.ZipFile.ensureOpen(ZipFile.java:595)
   at java.util.zip.ZipFile.getInputStream(ZipFile.java:341)
   at java.util.jar.JarFile.getInputStream(JarFile.java:403)
   at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:162)
   at sun.misc.URLClassPath$Loader$1.getInputStream(URLClassPath.java:553)
   at sun.misc.Resource.cachedInputStream(Resource.java:77)
Comment 1 villentretenmerth 2011-03-15 09:30:29 UTC
Created attachment 107011 [details]
stacktrace
Comment 2 Marian Mirilovic 2011-03-15 11:35:17 UTC
feel free to reassign
Comment 3 Jesse Glick 2011-03-15 21:30:41 UTC
Several different roots of the stack, mostly unrelated, all culminating in

java.lang.IllegalStateException: zip file closed
        at java.util.zip.ZipFile.ensureOpen(ZipFile.java:595)
        at java.util.zip.ZipFile.getInputStream(ZipFile.java:341)
        at java.util.jar.JarFile.getInputStream(JarFile.java:401)
        at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:162)
        at sun.misc.URLClassPath$Loader$1.getInputStream(URLClassPath.java:553)
        at sun.misc.Resource.cachedInputStream(Resource.java:77)
        at sun.misc.Resource.getByteBuffer(Resource.java:160)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:436)

Here URLClassPath.Loader.getResource is called (not JarLoader, note!), and the JarURLConnection has a jarFile which is closed. This is only reported by JDK 7 users, starting with build 128 - which is where 6896088 was fixed, and the lines of that fix are implicated here. So it seems to be a recent JDK 7 regression.
Comment 4 Jesse Glick 2011-04-05 21:56:12 UTC
*** Bug 197259 has been marked as a duplicate of this bug. ***
Comment 5 Antonin Nebuzelsky 2011-04-07 11:10:30 UTC
See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7033142

Raised priority of the JDK issue and added comments about the gathered NB exception reports.

Closing wontfix with the link to the JDK bug.
Comment 6 Jesse Glick 2011-05-02 12:51:34 UTC
#7033142 is according to its evaluator something different, related to Java Plugin; currently closed.
Comment 7 Jesse Glick 2011-05-26 14:59:25 UTC
*** Bug 198692 has been marked as a duplicate of this bug. ***
Comment 8 Jesse Glick 2011-05-26 15:01:00 UTC
Duplicate was P2. Probably need to file a fresh JRE bug referencing #7033142 but giving a different use case - especially if we have reliable steps to reproduce.
Comment 9 Jaroslav Tulach 2011-05-27 13:37:26 UTC
I don't have rights to report bugs to JDK. Assigning to default owner of "JDK Problems" category.
Comment 10 Jaroslav Tulach 2011-05-30 11:23:49 UTC
We need to report this bug to JDK team. To make them believe the bug is in JDK they need easy to use sample that will work on JDK6 and fail on JDK7. They are unlikely to follow the steps described in bug 198692 - they are too complex. Especially the need to have glassfish around and recompile would be a blocker imho. We need something simpler.

I guess the simplest way to show the problem is to create a small, self contained ZIP file which they can extract and run on JDK6 and JDK7.

David, can you please turn your example from bug 198692 into such ZIP file?
Comment 11 David Konecny 2011-05-30 21:23:36 UTC
(In reply to comment #10)
> David, can you please turn your example from bug 198692 into such ZIP file?

I would love to help, but I do not know how could I simplify it more - the example ZIP bundles the jars from glassfish so the only dependency of my test case is on NetBeans module system to reproduce the problem. And I do not know which aspect of NB module system is causing it and whether it is possible to further narrow it down.
Comment 12 Antonin Nebuzelsky 2011-05-31 12:41:07 UTC
I was able to reproduce the case that David reported in issue 198692, with the sample plugin. It manifests the problem with JDK 7 EA b143 and works OK with 6u25.
Comment 13 Antonin Nebuzelsky 2011-05-31 12:41:49 UTC
I was able to reproduce the case that David reported in issue 198692, with the sample plugin. It manifests the problem with JDK 7 EA b143 and works OK with 6u25.

The problem is we need to be very specific in the JDK report and explain why it needs to be fixed in JDK 7 and not in our module system.

Jesse will evaluate. Thanks, Jesse.
Comment 14 Jesse Glick 2011-05-31 15:50:39 UTC
Created attachment 108629 [details]
Minimal test case

Workaround in TestClassLoading is to replace e.g.

  new URL("jar:file:"+GLASSFISH+"/javax.servlet.jar!/")

with

  new URL("file:"+GLASSFISH+"/javax.servlet.jar")
Comment 15 Jesse Glick 2011-05-31 16:07:02 UTC
Filed a new JRE bug.
Comment 16 Jan Stola 2011-06-04 11:39:30 UTC
*** Bug 199149 has been marked as a duplicate of this bug. ***
Comment 17 Marek Fukala 2011-06-15 14:19:06 UTC
*** Bug 196815 has been marked as a duplicate of this bug. ***
Comment 18 Jesse Glick 2011-06-21 13:45:23 UTC
Claimed fixed in b146.
Comment 19 Marian Mirilovic 2011-06-21 14:02:25 UTC
Confirmed as fixed - verified. Please use JDk7 build 146 and higher ... thanks in advance.
Comment 20 Michel Graciano 2011-06-21 14:09:08 UTC
I knoe it is a little off topic, but anyone know how can I get this build? I can see just build #145 at http://jdk7.java.net/download.html

Regards
Comment 21 Michel Graciano 2011-06-22 17:39:31 UTC
I have tested it again and now looks like it is fixed.

Product Version: NetBeans IDE 7.0.1 Dev (Build 201106020000)
Java: 1.7.0; Java HotSpot(TM) Client VM 21.0-b16
System: Linux version 2.6.32-33-generic-pae running on i386; ISO-8859-1; en_US (nb)
Comment 22 Marek Fukala 2011-11-02 13:46:13 UTC
*** Bug 196093 has been marked as a duplicate of this bug. ***
Comment 23 Marek Fukala 2011-11-07 16:37:46 UTC
*** Bug 196347 has been marked as a duplicate of this bug. ***
Comment 24 Martin Fousek 2011-11-16 05:42:58 UTC
*** Bug 205119 has been marked as a duplicate of this bug. ***
Comment 25 Martin Fousek 2012-10-22 08:53:24 UTC
*** Bug 220368 has been marked as a duplicate of this bug. ***


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo