Community
Participate
Working Groups
I've got the following internal error a couple of times when trying to save a .java file that I have just edited: The file did get saved though, although I had to restart Eclipse in order to get rid of the bug. java.lang.InternalError: jzentry == 0 at java.util.zip.ZipFile$2.nextElement(ZipFile.java:297) at org.eclipse.jdt.internal.core.builder.ClasspathJar.isPackage (ClasspathJar.java:70) at org.eclipse.jdt.internal.core.builder.ClasspathJar.findClass (ClasspathJar.java:48) at org.eclipse.jdt.internal.core.builder.NameEnvironment.findClass (NameEnvironment.java:216) at org.eclipse.jdt.internal.core.builder.NameEnvironment.findType (NameEnvironment.java:232) at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createPackage (LookupEnvironment.java:329) at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.buildTypeBindings (CompilationUnitScope.java:73) at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.buildTypeBindings (LookupEnvironment.java:119) at org.eclipse.jdt.internal.compiler.Compiler.beginToCompile(Compiler.java:300) at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:323) at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile (AbstractImageBuilder.java:219) at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile (AbstractImageBuilder.java:166) at org.eclipse.jdt.internal.core.builder.IncrementalImageBuilder.build (IncrementalImageBuilder.java:108) at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildDeltas (JavaBuilder.java:177) at org.eclipse.jdt.internal.core.builder.JavaBuilder.build (JavaBuilder.java:109) at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:386) at org.eclipse.core.internal.runtime.InternalPlatform.run (InternalPlatform.java:802) at org.eclipse.core.runtime.Platform.run(Platform.java:416) at org.eclipse.core.internal.events.BuildManager.basicBuild (BuildManager.java:120) at org.eclipse.core.internal.events.BuildManager.basicBuild (BuildManager.java:176) at org.eclipse.core.internal.events.BuildManager.basicBuild (BuildManager.java:186) at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:146) at org.eclipse.core.internal.runtime.InternalPlatform.run (InternalPlatform.java:802) at org.eclipse.core.runtime.Platform.run(Platform.java:416) at org.eclipse.core.internal.events.BuildManager.basicBuild (BuildManager.java:160) at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:211) at org.eclipse.core.internal.resources.Workspace.endOperation (Workspace.java:733) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1366) at org.eclipse.ui.actions.WorkspaceModifyOperation.run (WorkspaceModifyOperation.java:78) at org.eclipse.ui.texteditor.AbstractTextEditor.performSaveOperation (AbstractTextEditor.java:2090) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.performSaveOperati on(CompilationUnitEditor.java:635) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.doSave (CompilationUnitEditor.java:683) at org.eclipse.ui.internal.EditorManager$11.run(EditorManager.java:979) at org.eclipse.ui.internal.EditorManager$8.run(EditorManager.java:848) at org.eclipse.jface.operation.ModalContext.runInCurrentThread (ModalContext.java:299) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:249) at org.eclipse.jface.window.ApplicationWindow$1.run(ApplicationWindow.java:384) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:64) at org.eclipse.jface.window.ApplicationWindow.run(ApplicationWindow.java:381) at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:1062) at org.eclipse.ui.internal.EditorManager.runProgressMonitorOperation (EditorManager.java:854) at org.eclipse.ui.internal.EditorManager.saveEditor(EditorManager.java:984) at org.eclipse.ui.internal.WorkbenchPage.saveEditor(WorkbenchPage.java:1913) at org.eclipse.ui.internal.SaveAction.run(SaveAction.java:32) at org.eclipse.jface.action.Action.runWithEvent(Action.java:749) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0 (ActionContributionItem.java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java:47) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:75) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:825) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1527) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1289) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1177) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1160) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:739) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:462) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:244) at org.eclipse.core.launcher.Main.run(Main.java:693) at org.eclipse.core.launcher.Main.main(Main.java:526)
I forgot to say that I am using the F2 build.
Is it reproducable? If yes, could you please provide some steps to reproduce. Thanks.
It is not easy to reproduce - I think that I'm zeroing in on it though... If I first save the file with some compile errors in it, and then fixes the errors and save again, then it sometimes occurs. I think that somehow, the builder decides to delete some .class files since a rebuild of dependant classes are required, but it does not fully rebuild them. I am only guessing though... I'll try to nail it down further, it only happens once every few hours though :(
Kim, which VM are you using to run Eclipse?
I'm using sun's JVM, version 1.3.1 java full version "1.3.1-b24" I have used eclipse for about 10 hours today, and it hasn't occured yet, I'll try to provoke it tonight too.
This has nothing to do with writing individual .java or .class files... you have a corrupted jar file in this project. Whichever type you were changing at the time has a reference to a type in the jar file & its entry is corrupted.
Protected against corrupt jar files in isPackage().
If the problem is caused by a corrupted .jar file, then restarting Eclipse fixes the .jar file... this sounds a bit odd to me.
Indeed, but the stack trace clearly exposes the fact that a zip entry could not be decoded. Might have been a VM bug, but adding some protection in our code will not hurt.