This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 205387 - [71cat] java.util.zip.ZipException: error in opening zip file
Summary: [71cat] java.util.zip.ZipException: error in opening zip file
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP Parser (show other bugs)
Version: 7.1
Hardware: All All
: P2 normal (vote)
Assignee: Martin Fousek
URL:
Keywords:
: 204781 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-11-21 21:21 UTC by javydreamercsw
Modified: 2012-05-10 09:56 UTC (History)
10 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 175070


Attachments
stacktrace (1.09 KB, text/plain)
2011-11-21 21:21 UTC, javydreamercsw
Details
stacktrace (1.09 KB, text/plain)
2011-12-07 07:09 UTC, Exceptions Reporter
Details
Log (78.59 KB, application/octet-stream)
2011-12-08 19:08 UTC, javydreamercsw
Details
stacktrace (1.10 KB, text/plain)
2011-12-20 13:30 UTC, maitrikgpanchal
Details

Note You need to log in before you can comment on or make changes to this bug.
Description javydreamercsw 2011-11-21 21:21:08 UTC
Build: NetBeans IDE 7.1 RC1 (Build 201111171527)
VM: Java HotSpot(TM) Client VM, 21.1-b02, Java(TM) SE Runtime Environment, 1.7.0_01-b08
OS: Windows 7

User Comments:
javydreamercsw: Deploying a web applciation.

qpolarbear: Checked out a new branch in git (outside of the IDE).  Caused NetBeans to rescan.

kahatlen: Right-clicked a project and chose "Clean and Build" from the pop-up menu.




Stacktrace: 
java.util.zip.ZipException: error in opening zip file
   at java.util.zip.ZipFile.open(ZipFile.java:0)
   at java.util.zip.ZipFile.<init>(ZipFile.java:214)
   at java.util.zip.ZipFile.<init>(ZipFile.java:144)
   at java.util.jar.JarFile.<init>(JarFile.java:152)
   at java.util.jar.JarFile.<init>(JarFile.java:89)
   at sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:93)
Comment 1 javydreamercsw 2011-11-21 21:21:11 UTC
Created attachment 113386 [details]
stacktrace
Comment 2 Exceptions Reporter 2011-12-07 07:09:58 UTC
Created attachment 113902 [details]
stacktrace
Comment 3 javydreamercsw 2011-12-08 19:08:49 UTC
Created attachment 113973 [details]
Log
Comment 4 javydreamercsw 2011-12-08 19:09:19 UTC
The error is preventing me from debugging a Web application. See attachment.
Comment 5 Petr Jiricka 2011-12-09 08:37:51 UTC
Hi, which server (and version) are you deploying to? If you are using GlassFish 3.1.1, then I suspect you may be running into a jar locking problem on the GlassFish side, see:
https://netbeans.org/bugzilla/show_bug.cgi?id=202419
http://java.net/jira/browse/GLASSFISH-17339

The GlassFish bug report says that it was fixed in GF 3.1.2 promoted build 13, so can you please check if this problem disappears if you use this build as the target server?
http://dlc.sun.com.edgesuite.net/glassfish/3.1.2/promoted/

Thanks.
Comment 6 javydreamercsw 2011-12-09 13:55:23 UTC
I was using Tomcat 7.0.23. I was able to make it work after wiping out my user dir and restarting NetBeans a couple of times.
Comment 7 Petr Jiricka 2011-12-09 14:05:39 UTC
It's possible that there may be a locking problem in Tomcat as well.
Comment 8 Vince Kraemer 2011-12-09 15:35:57 UTC
This doesn't look like the windows file locking problem.  there are non-windows instances of this exception.
Comment 9 maitrikgpanchal 2011-12-20 13:30:58 UTC
Created attachment 114353 [details]
stacktrace

loading project from pendrive...
Comment 10 javydreamercsw 2011-12-20 13:51:58 UTC
Now that you mention it I want to add that I work from an External hard drive. Both NetBeans and my projects are in an external hard drive.
Comment 11 Petr Jiricka 2012-04-27 09:32:15 UTC
Can you please try if this is still happening in the latest build of NetBeans 7.2? http://bits.netbeans.org/download/trunk/nightly/ The JSP parser was recently updated to the version from GlassFish 3.1.2, so this may help. 

Also, the weird thing is that there are no reports of this problem with JDK 6, so there is a possibility that this is a regression on the JDK side between 6 and 7. Can anyone reproduce with JDK 6? It may also be a good idea to try with the recently released JDK 7u4, which contains a lot of bugfixes.
Comment 12 Martin Fousek 2012-05-04 06:50:41 UTC
By updating to GF 3.1.2 JSP parser exactly the call where the exception starts was removed (although some reflection still stays). So I would propose to close this one as fixed or worksforme and if that problem still exists, an issue will be raised with the new stacktrace.

So closing as workforme since web-main #646171d74911 (you can see that the "cache.getLocation("");" was commented out and another way used for refreshing tlds caches).
Comment 13 Martin Fousek 2012-05-08 07:49:59 UTC
It looks that the problem stays also for the newest jdk and nb sources (which was probably expected), reopenning.
Comment 14 Petr Jiricka 2012-05-09 07:26:32 UTC
I am thinking how this could be happening. Any ideas?

Some wild guesses:
- Both server and the IDE (JSP parser included in the IDE) are trying to access the same jar file at the same time (in theory, they should open the file for just a short while and close it as soon as they're done reading from it, but they could clash at some point).
- Someone is not closing the jar file correctly (maybe due to an exception and missing finally block where the close method would be called?)

I am thinking if it would help if we were logging the exact location of the failing jar file, what do you think?
Comment 15 Martin Fousek 2012-05-09 08:24:29 UTC
It doesn't look to me that there is any problem with the jspparser call. Anyway I didn't figured out yet why the exception is not catched as InvocationTargetException.

The situation how it looks like to me: The JSP parser was properly called and it refreshes and scans all jars which it needs. By doing that some of JAR files can't be opened and throws ZipException. But this exception should be wrapped into InvocationTargetException and logged with Level.INFO level what probably didn't happen since another exception report come.
Comment 16 Martin Fousek 2012-05-09 08:32:24 UTC
I got it (at least the cause). This exception is logged directly by the TldScanner with the WARNING level, so these exceptions are catched by our exception reporter. So there is just needed to find a way how to disable its own logger and use our one.
Comment 17 Martin Fousek 2012-05-09 12:07:36 UTC
Ok, these TldScanner warnings are filtered out and logged with INFO level by our logger now.

Fixed in web-main #f896897654aa.
Comment 18 Martin Fousek 2012-05-10 06:09:05 UTC
*** Bug 204781 has been marked as a duplicate of this bug. ***
Comment 19 Quality Engineering 2012-05-10 09:56:53 UTC
Integrated into 'main-golden', will be available in build *201205100400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/f896897654aa
User: Martin Fousek <marfous@netbeans.org>
Log: #205387 - [71cat] java.util.zip.ZipException: error in opening zip file