Bug 337500 - org.eclipse.core.runtime.CoreException: I/O exception : Invalid ZIP archive
Summary: org.eclipse.core.runtime.CoreException: I/O exception : Invalid ZIP archive
Status: CLOSED DUPLICATE of bug 229042
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-17 17:57 EST by Michael Matczynski CLA
Modified: 2011-03-15 02:51 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Matczynski CLA 2011-02-17 17:57:28 EST
What steps will reproduce the problem?
1. Installed m2eclipse
2. Started seeing errors in Eclipse, looks like it's trying to open txt files as ZIP/JAR


-- Error Details --
Date: Thu Feb 17 17:35:41 EST 2011
Message: Invalid ZIP archive: third-party/axis/axis2-1.5.4/lib/XmlSchema-LICENSE.txt [in trunk]
Severity: Error
Product: Eclipse 1.3.1.20100913-1228 (org.eclipse.epp.package.jee.product)
Plugin: org.eclipse.jdt.core
Session Data:
eclipse.buildId=M20100909-0800
java.version=1.6.0_23
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.jee.product -clean


Exception Stack Trace:
org.eclipse.core.runtime.CoreException: I/O exception
	at org.eclipse.jdt.internal.core.JavaModelManager.getZipFile(JavaModelManager.java:2524)
	at org.eclipse.jdt.internal.core.JarPackageFragmentRoot.getJar(JarPackageFragmentRoot.java:152)
	at org.eclipse.jdt.internal.core.JarPackageFragmentRoot.computeChildren(JarPackageFragmentRoot.java:78)
	at org.eclipse.jdt.internal.core.JavaProjectElementInfo.initializePackageNames(JavaProjectElementInfo.java:252)
	at org.eclipse.jdt.internal.core.JavaProjectElementInfo.getProjectCache(JavaProjectElementInfo.java:225)
	at org.eclipse.jdt.internal.core.JavaProjectElementInfo.newNameLookup(JavaProjectElementInfo.java:290)
	at org.eclipse.jdt.internal.core.JavaProject.newNameLookup(JavaProject.java:2282)
	at org.eclipse.jdt.internal.core.SearchableEnvironment.<init>(SearchableEnvironment.java:57)
	at org.eclipse.jdt.internal.core.SearchableEnvironment.<init>(SearchableEnvironment.java:64)
	at org.eclipse.jdt.internal.core.CancelableNameEnvironment.<init>(CancelableNameEnvironment.java:26)
	at org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process(CompilationUnitProblemFinder.java:162)
	at org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process(CompilationUnitProblemFinder.java:255)
	at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.makeConsistent(ReconcileWorkingCopyOperation.java:190)
	at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.executeOperation(ReconcileWorkingCopyOperation.java:89)
	at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728)
	at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:788)
	at org.eclipse.jdt.internal.core.CompilationUnit.reconcile(CompilationUnit.java:1244)
	at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:126)
	at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.access$0(JavaReconcilingStrategy.java:108)
	at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy$1.run(JavaReconcilingStrategy.java:89)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:87)
	at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.initialReconcile(JavaReconcilingStrategy.java:178)
	at org.eclipse.jdt.internal.ui.text.CompositeReconcilingStrategy.initialReconcile(CompositeReconcilingStrategy.java:114)
	at org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.initialReconcile(JavaCompositeReconcilingStrategy.java:133)
	at org.eclipse.jface.text.reconciler.MonoReconciler.initialProcess(MonoReconciler.java:105)
	at org.eclipse.jdt.internal.ui.text.JavaReconciler.initialProcess(JavaReconciler.java:398)
	at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:173)
Caused by: java.util.zip.ZipException: error in opening zip file
	at java.util.zip.ZipFile.open(Native Method)
	at java.util.zip.ZipFile.<init>(ZipFile.java:127)
	at java.util.zip.ZipFile.<init>(ZipFile.java:144)
	at org.eclipse.jdt.internal.core.JavaModelManager.getZipFile(JavaModelManager.java:2518)
	... 27 more
Comment 1 Michael Rennie CLA 2011-02-22 10:28:50 EST
moving to JDT core for comment
Comment 2 Jay Arthanareeswaran CLA 2011-02-22 11:02:14 EST
One of the reasons could be that invalid archive file was added to the project's build path. Can you please check if there are any warnings/errors of an invalid classpath entry?
Comment 3 Michael Matczynski CLA 2011-03-14 13:46:48 EDT
This error was the result of XML and TXT files on the build path.

What happened is that I wanted to add all the jars in the axis2/lib directory, and simply selected all the files in the directory (which had XML and TXT files mixed in with JAR files).

Seems like the fix is one or both of the following:
1. Java Build Path's "Add JARs..." dialog should filter out all non-JAR files
2. Someone in the callstack should catch the IOException and log/ignore the error.  It doesn't make sense to start throwing exceptions in the error log and preventing content assist from working if this is a recoverable error.

Thanks!
Mike
Comment 4 Olivier Thomann CLA 2011-03-14 14:35:32 EDT
(In reply to comment #3)
> Seems like the fix is one or both of the following:
> 1. Java Build Path's "Add JARs..." dialog should filter out all non-JAR files
This should be done in the UI.
Moving to JDT/UI
Comment 5 Dani Megert CLA 2011-03-15 02:51:34 EDT

*** This bug has been marked as a duplicate of bug 229042 ***