Bug 120617 - searching references while Java program is running causes IO errors
Summary: searching references while Java program is running causes IO errors
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2005-12-13 11:45 EST by Alexandra Stehman CLA
Modified: 2009-08-30 02:07 EDT (History)
0 users

See Also:


Attachments
Snapshot of "empty jars" when Eclipse loses references to files (51.93 KB, image/pjpeg)
2005-12-13 13:25 EST, Alexandra Stehman CLA
no flags Details
.log file (100.40 KB, text/plain)
2005-12-14 09:36 EST, Alexandra Stehman CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandra Stehman CLA 2005-12-13 11:45:04 EST
Greetings,

This only occurs when I am running an app in the Eclipse Tomcat plugin.  The exact sequence of events is to double click a method in a source file whose class is currently loaded into the web app.  The method becomes highlighted. Right click on this highlighted method name, and choose References -> Workspace (or Project).  A dialog window comes up reporting "I/O Error" with the details button greyed out.  

I attempted this same search by using a new workspace, and defined a workspace to include both projects at a high level.  This also resulted in the I/O error.

If I attempted this search a third time by editing the workspace to exclude all JAR files from the workspace search, the I/O error does not appear.
Comment 1 Martin Aeschlimann CLA 2005-12-13 11:49:35 EST
something in the .log file?
Comment 2 Alexandra Stehman CLA 2005-12-13 13:21:50 EST
Yes, actually. I noticed that for unknown reasons (and prior this led to a project corruption which required complete project recreation to fix) the jar files seem to lose their references to themselves (show up empty) yet if I remove/re-add them, they don't show up as if Eclispe recognizes them... perhaps this error is the root of that problem.

Here is the stacktrace:

!ENTRY org.eclipse.jdt.core 4 -1 2005-12-12 14:43:58.880
!MESSAGE I/O exception
!STACK 0
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:112)
	at java.util.zip.ZipFile.<init>(ZipFile.java:72)
	at org.eclipse.jdt.internal.core.JavaModelManager.getZipFile(JavaModelManager.java:1461)
	at org.eclipse.jdt.internal.core.JarPackageFragmentRoot.getJar(JarPackageFragmentRoot.java:181)
	at org.eclipse.jdt.internal.core.search.matching.MatchLocator.getBinaryInfo(MatchLocator.java:703)
	at org.eclipse.jdt.internal.core.search.matching.MatchLocator.process(MatchLocator.java:1441)
	at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:958)
	at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:999)
	at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1116)
	at org.eclipse.jdt.internal.core.search.JavaSearchParticipant.locateMatches(JavaSearchParticipant.java:94)
	at org.eclipse.jdt.internal.core.search.BasicSearchEngine.findMatches(BasicSearchEngine.java:208)
	at org.eclipse.jdt.internal.core.search.BasicSearchEngine.search(BasicSearchEngine.java:424)
	at org.eclipse.jdt.core.search.SearchEngine.search(SearchEngine.java:532)
	at org.eclipse.jdt.internal.ui.search.JavaSearchQuery.run(JavaSearchQuery.java:135)
	at org.eclipse.search2.internal.ui.InternalSearchUI$InternalSearchJob.run(InternalSearchUI.java:94)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)
Comment 3 Alexandra Stehman CLA 2005-12-13 13:25:34 EST
Created attachment 31661 [details]
Snapshot of "empty jars" when Eclipse loses references to files
Comment 4 Martin Aeschlimann CLA 2005-12-13 17:06:42 EST
Moving to jdt.core
Comment 5 Frederic Fusier CLA 2005-12-14 02:01:19 EST
Please do not set bug target, it's our responsibility to do it.

Saying that, can you open those zip files outside eclipse? Aren't used by another application?
Have you noticed anything special (and reproduceable) when they become unrecognized (empty) in your workspace? Does the problem still there after a shutdown/restart of your eclipse session?
.log file content would be really helpful here...
Comment 6 Alexandra Stehman CLA 2005-12-14 09:35:55 EST
I have attached the entire .log file, in which you will find the key exception in comment 2.

Yes, I can open the jar files externally. That was the first thing I checked, esp. since I've experienced this problem when the binary bit is not set in CVS for jar files and they get corrupted (although in this case we are using PVCS and are not obtaining the JAR files from PVCS).

To answer the question about how to reproduce it - I am still taking notes on this. On one occasion I had to rebuild the entire projects from scratch - restarting Eclipse did not fix the problem.  Tomcat reported being unable to load jars, and project builds reported being unable to find the basics such as classes within servlet.jar.  I believe this particular instance was related to a power failure which caused all of our PC's to shut down, and I was in the middle of working in Eclipse when this occurred.

Subsequent occurrences seem only to be related to reference searching and not being able to search through the JAR files.  However, TomCat still finds the necessary jar files and runs as it should.  As you can see from the screen shot, the jar files do show up with the 'empty jar' icon (and shouldn't).

First I suspected it was related to the TomCat plugin and TomCat running at the time the reference search operation was attempted.  But later evidence suggests this correlation to be false.  I also suspected it may be a java process running to serve RPC requests, but also that did not seem to be a steady correlation.

Then some unknown event occurred which caused the reference search to start working again. I'm not positive but it may have been related to setting the source for a class which resided in a jar but whose source was in one of the source paths for the project (which I found odd that I needed to set that as I assumed Eclipse would just be able to find the source within its own source paths).

So at present it is functional, but I could not tell you what fixed it.
Comment 7 Alexandra Stehman CLA 2005-12-14 09:36:50 EST
Created attachment 31733 [details]
.log file
Comment 8 Frederic Fusier CLA 2005-12-14 12:59:25 EST
Would it be possible that event which made things working again was a refresh of your workspace? I saw in .log file before and after zip exception that your workspace got desynchronized on some resources...
Comment 9 Alexandra Stehman CLA 2005-12-14 13:03:26 EST
That is absolutely possible.  If this problem occurs again, I will try a refresh first to see if that resolves the issue.
Comment 10 Frederic Fusier CLA 2005-12-14 13:07:59 EST
OK, reopen bug when it occurs again. Please also try to expand jar file in Package Explorer to see if there are similar exceptions and put corresponding stack trace in comment.
Thanks
Comment 11 Denis Roy CLA 2009-08-30 02:07:55 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.