Bug 152926 - jars in user libraries appear empty on occasion
Summary: jars in user libraries appear empty on occasion
Status: CLOSED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal with 6 votes (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: needinfo
: 110115 199599 215652 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-08-06 18:42 EDT by Matthew Cooper CLA
Modified: 2019-12-30 13:47 EST (History)
8 users (show)

See Also:
douknow_me563: review?
douknow_me563: review?


Attachments
Before workaround (73.70 KB, image/jpeg)
2006-08-06 18:49 EDT, Matthew Cooper CLA
no flags Details
After workaround (73.04 KB, image/jpeg)
2006-08-06 18:50 EDT, Matthew Cooper CLA
no flags Details
Same library with broken jar on one project - fine on other. (94.18 KB, image/jpeg)
2006-08-09 19:04 EDT, Matthew Cooper CLA
no flags Details
Debug log capture (928.55 KB, text/plain)
2007-04-24 14:55 EDT, Ernest Zapata CLA
no flags Details
Debug log capture - 2 (920.63 KB, application/octet-stream)
2007-05-10 13:36 EDT, Ernest Zapata CLA
no flags Details
debug log for failure comment 17 (203.59 KB, text/plain)
2007-06-18 12:08 EDT, Mitch Claborn CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Cooper CLA 2006-08-06 18:42:24 EDT
Sometimes when I start Eclipse it seems to have problems with some jars in user libraries. Its as if the jars are empty. Nothing has changed since it worked last session and manual inspection shows the paths are correct. I have tried refreshing the project, rebuilding the project, closing and opening the project and closing and opening eclipse - all to no avail. The way to solve it is to edit the library definition in preferences, remove the offending jar(s) and re-add them - then it all works again. Its not all jars and it seems random but come to think of it - it could be the same few jars re-offending.

Rather then remove and add I have tried editing the jar within the library definition and selecting the same jar again at which point it removes the jar from the library definition as if I had chosen remove. I will add some snapshots to show I am not imagining it.
Comment 1 Matthew Cooper CLA 2006-08-06 18:49:45 EDT
Created attachment 47455 [details]
Before workaround
Comment 2 Matthew Cooper CLA 2006-08-06 18:50:35 EDT
Created attachment 47456 [details]
After workaround
Comment 3 Matthew Cooper CLA 2006-08-08 21:25:37 EDT
I just fired up Eclipse and had the problem with some jars. This time I closed Eclipse, opened it again and rebuilt all projects and the jars are now fine.
Comment 4 Frederic Fusier CLA 2006-08-09 04:44:13 EDT
What is your exact build ID? Is there anything in the .log file?
Comment 5 Matthew Cooper CLA 2006-08-09 18:31:26 EDT
eclipse.buildId=M20060629-1905  but I had the same symptoms on variopus 3.1 incarnations too.

Nothing in the log file to help.

I'm trying to find out the circumstances in which it happens. It seems more likely, but not guaranteed, to happen when I reboot windows with eclipse open (have just tried this several times). The eclipse 'saving workspace' dialog box flashes up but I'm not convinced it has enough tome to finish. Anyway, when loading eclipse after the machine has restarted I am likely to get broken jars but its not consistent (5 just now which took 5 minutes to fix by removing and adding to the user libraries). However, just now after reboot, eclipse started and did some building (no prompting from me - auto build is on but nothing has changed so don't know why it did that) and all was OK. I did a rebuild of all projects and I now have broken jars again.

Maybe that gives you some clues?
Comment 6 Matthew Cooper CLA 2006-08-09 19:04:12 EDT
Created attachment 47666 [details]
Same library with broken jar on one project - fine on other.

Oh well. I just double checked if the reboot thing really has anything to do with it and it seems now. So without reboots I refresh and rebuild all projects and its all fine. I shut eclipse and open and all fine. Shutdown and open again and all fine. Refresh and then build all and roughly the same 5 or 6 jars are broken. Same ones out of say tens I am using. In one project it had apache commons beanutils, cli and lang libraries each with broken jars in. I fxed one of them and the others in that project are now miraculously OK. And I just noticed - lang is now working on most projects but on one it is empty - same library but with empty jar on one project and working jar on others - see the attachment.
Comment 7 Gilles WIART CLA 2007-03-30 03:48:13 EDT
Same for me in Eclipse 3.3 build I20070327-0800.

It doesn't occur every time I launch Eclipse, but maybe once or twice a day...

The workaround for me is to close Eclipse and relaunch it. I always close Eclipse cleanly on evening, but when I relaunch Eclipse in the morning, it often starts with this problem... I don't reboot my PC, so I think it has nothing to do with reboot. Maybe more a problem when closing Eclipse.

Nothing in the log file.
Comment 8 Jerome Lanneluc CLA 2007-03-30 05:26:37 EDT
Could you please enable some tracing as follows to help us understand what's going on ?
1. Create a .options file with the following content:
# Turn on debug tracing for org.eclipse.jdt.core plugin
org.eclipse.jdt.core/debug=true
# Reports classpath variable initialization, and classpath container resolution
org.eclipse.jdt.core/debug/cpresolution=true
2. Start eclipse with the following command:
eclipse.exe -debug <path to your .options file> -vm <path to java.exe>
e.g. eclipse.exe -debug c:\temp\.options -vm c:\jdk1.5.0\bin\java.exe
=> this should open a DOS console
3. Ensure that the DOS console buffer size is as big as possible 
(Properties > Layout > Screen Buffer Size > set width and height to 9999)
4. When the problem occurs, copy/paste the content of the DOS console into a file, and attach the file to this bug
Comment 9 Matthew Cooper CLA 2007-04-18 02:03:07 EDT
We are currently using Version: 3.2.2, Build id: M20070212-1330  with the latest WTP installed. We don't seem to be getting the problem at the moment so I can't help with extra info. If we get it again then I will do as you request.
Comment 10 Ernest Zapata CLA 2007-04-24 14:55:40 EDT
Created attachment 64777 [details]
Debug log capture

I am seeing this problem as described. It seems to happen on a somewhat regular basis when I start eclipse. I have a project I am currently working on, and when launching Eclipse, random User Libraries appear empty as describe by original poster. I can usually correct the problem by just closing and re-opening the project.

The Eclipse version as reported is Version: 3.2.2.r322_v20070104-R4CR0Znkvtfjv9-
Build id: M20070212-1330. This is running under Windows XP SP2.

This instance is installed and used along with MyEclipse (Version: 5.1.1 GA
Build id: 20070302-5.1.1-GA).

I tried the instructions as documented by Jerome Lanneluc (https://bugs.eclipse.org/bugs/show_bug.cgi?id=152926#c8), but the console size is too small to hold all of the output, but does log "CPContainer INIT - FAILED (initializer did not initialize container)" messages for some of the class libraries which appeared empty when I launched Eclipse with the debug option.

I will attach the partial log I captured. If a full debug log is required, I will need more instructions on how to capture more of the output.
Comment 11 Jerome Lanneluc CLA 2007-04-26 07:48:13 EDT
For people using 3.2.2 (Matthew, Ernest), could you please try the patch in bug 154984 comment 52 and let me know if this fixes the problem ?

For people using a 3.3 build (Gilles), could you please enable the tracing as described in comment 8 and attach it to this bug when the problem occurs ?
Comment 12 Ernest Zapata CLA 2007-04-26 09:44:34 EDT
(In reply to comment #11)
> For people using 3.2.2 (Matthew, Ernest), could you please try the patch in bug
> 154984 comment 52 and let me know if this fixes the problem ?
> 
> For people using a 3.3 build (Gilles), could you please enable the tracing as
> described in comment 8 and attach it to this bug when the problem occurs ?
> 

I have installed the updated JDT Core jar file and will run with it for a while to see if the failure occurs. Thanks for the response.
Comment 13 Ernest Zapata CLA 2007-05-03 08:58:15 EDT
I have been starting Eclipse at least three or four times a day since April 26 and have not had this problem occur, until this morning.

I started Eclipse and the status bar showed the "Building workspace" message, I saw the errors associated with the user defined libraries not being found.

I had copied the org.eclipse.jdt.core_3.2.3.z20070319-1931.jar file into my Eclipse plugin directory, having renamed the original org.eclipse.jdt.core_3.2.3.v_686_R32x.jar to org.eclipse.jdt.core_3.2.3.v_686_R32x.jar.original.
Comment 14 Jerome Lanneluc CLA 2007-05-04 09:29:51 EDT
(In reply to comment #13)
> I saw the errors associated with the user defined libraries not being found.
Could you please attach the trace as described in comment 8 ? 

Comment 15 Ernest Zapata CLA 2007-05-05 08:59:40 EDT
I have been launching Eclipse without the procedure outlined in comment #8, but will start using that procedure every time. The next time the problem occurs, I will attach the log.

As I previously mentioned, the console output appears to scroll off the top of the buffer when I last got the log, even though I set the rows/columns to max values. I will try the technique specified in this article http://www-128.ibm.com/developerworks/rational/library/06/0221_rossner/#N10153.
Comment 16 Ernest Zapata CLA 2007-05-10 13:36:25 EDT
Created attachment 66721 [details]
Debug log capture - 2

I had the problem occur again. This time, it was only one user defined library that appears to have been 'lost'. The library was called defined as "itext-1.4.1". When the problem occurred, the actual user library definition was missing from the list at Window -> Preferences -> Java -> Build Path -> User Libraries.

I checked the file .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs in my workspace to check that the definition was still there, and it was.

I have attached the debug log.
Comment 17 Mitch Claborn CLA 2007-06-18 12:06:38 EDT
I have the exact problem as described above - mine seems to be repeatable on demand.  I've narrowed it down somewhat.  It only seems to happen when I open Eclipse with 2 different projects open.  (They have different JRE's - wonder if that contributes to the problem?)  In the attached log project 'Adv Ret Planner' is the one that encounters the error with the User Library 'NetscapeJavascript' containing a single jar file 'C:/JavaLibs/netscape/netscape.jar'.

Here is the sequence of events:  
with Eclipse running, I fix the problems from before and run the project (an applet) to make sure all is OK.  
Shutdown Eclipse
Restart Eclipse
Make a change to one of the files in the project.
Attempt to run the project - get the errors that the various classes in that JAR file cannot be resolved.
The attached log is from this occurrence.
Comment 18 Mitch Claborn CLA 2007-06-18 12:08:33 EDT
Created attachment 71626 [details]
debug log for failure comment 17
Comment 19 Frederic Fusier CLA 2007-06-21 07:04:47 EDT
*** Bug 110115 has been marked as a duplicate of this bug. ***
Comment 20 Jerome Lanneluc CLA 2007-06-28 06:58:02 EDT
Mitch, are you running with the patch from bug 154984 comment 52 ?
Comment 21 Jerome Lanneluc CLA 2007-07-04 12:10:28 EDT
(In reply to comment #20)
> Mitch, are you running with the patch from bug 154984 comment 52 ?
> 
For 3.2.x users, the URL of the patch has changed (the fix for bug 154984 is still the same). It is now available at http://www.eclipse.org/jdt/core/r3.2/index.php#UPDATES
Comment 22 Ernest Zapata CLA 2007-07-10 08:55:49 EDT
I downloaded 3.3 last week and installed and started using it. In the past 3 days, I have had this problem occur twice.

Is there an update for Eclipse 3.3?
Comment 23 Jerome Lanneluc CLA 2007-08-09 06:28:13 EDT
(In reply to comment #22)
> I downloaded 3.3 last week and installed and started using it. In the past 3
> days, I have had this problem occur twice.
> 
> Is there an update for Eclipse 3.3?
> 
Sorry Ernest, we are still trying to figure out what's wrong. The trace you attached from 3.2 did not help. However the tracing changed in 3.3. So could you please attach a new trace when the problem occurs using 3.3 ?
Comment 24 Jerome Lanneluc CLA 2007-08-14 10:00:37 EDT
*** Bug 199599 has been marked as a duplicate of this bug. ***
Comment 25 Bas velthuizen CLA 2007-09-24 06:38:50 EDT
I saw the same problem. It occurred after my PC had been shut down without closing  Eclipse first.
After looking at the MyEclipse-forum (http://www.myeclipseide.com/index.php?name=PNphpBB2&file=viewtopic&p=83288#83288) I tried starting with the -clean option. 
This worked, all my user libraries were back.

Cheers,
Bas
Comment 26 Jerome Lanneluc CLA 2007-09-24 06:51:03 EDT
(In reply to comment #25)
Bas, could you please indicate the Eclipse build ID you were using ?
Comment 27 Bas velthuizen CLA 2007-09-24 07:10:01 EDT
(In reply to comment #26)
> (In reply to comment #25)
> Bas, could you please indicate the Eclipse build ID you were using ?
> 

I'm using Eclipse build ID Build id: 6.0.0-GA-200708
Comment 28 Bas velthuizen CLA 2007-09-24 07:12:32 EDT
(In reply to comment #27)
> (In reply to comment #26)
> > (In reply to comment #25)
> > Bas, could you please indicate the Eclipse build ID you were using ?
> > 
> 
> I'm using Eclipse build ID Build id: 6.0.0-GA-200708
> 

Sorry, that's the Myeclipse id...
the JDT build id = I20070625-1500
Comment 29 Jerome Lanneluc CLA 2007-09-24 07:24:51 EDT
(In reply to comment #28)
> the JDT build id = I20070625-1500
Thanks. Could you please either try http://www.eclipse.org/jdt/core/r3.3/index.php#UPDATES, or 3.3.1 (coming soon) ? And let us know if this fixes the problem ?
Comment 30 Bas velthuizen CLA 2007-09-25 04:16:31 EDT
I downloaded the patch jar and copied it in mu $ECLIPSE_HOME/eclipse/plugins directory.

After that I killed the eclipse and java task (simulating a computer shutdown) and started eclipse again, and the libraries were there. Strangely though, imports from now existing libraries (In my case jakarta commons http-client) are not found by the compiler. After cleaning the project, the compiler can find the library and thus the imports.

In the 'about' box of eclipse, it indicates that the Java Development Tools core has version 3.3.1.z20070824-1334 so it seems to have taken up the new plugin.

So it seems to help at least somewhat.
Cheers, Bas




Comment 31 Jerome Lanneluc CLA 2007-09-25 05:06:46 EDT
(In reply to comment #30)
> After that I killed the eclipse and java task (simulating a computer shutdown)
> and started eclipse again, and the libraries were there. Strangely though,
> imports from now existing libraries (In my case jakarta commons http-client)
> are not found by the compiler. After cleaning the project, the compiler can
> find the library and thus the imports.
Can you reproduce this behavior? Or did it happen only once? If you can reproduce, can you please enter a separate bug report with enough details so that I can reproduce it on my machine and debug it?
Comment 32 Robert Dean CLA 2007-11-07 15:05:12 EST
Our shop has the same problem, using IBM products (WDSCi 6.0.x and 7.0.x) based on Eclipse 3.x.

We're going to try the workarounds listed here to see if they help.
Comment 33 Jerome Lanneluc CLA 2008-01-17 11:40:50 EST
*** Bug 215652 has been marked as a duplicate of this bug. ***
Comment 34 michael CLA 2008-05-05 07:28:59 EDT
Not able to find the JSP plugin for Eclispe3.3.
Comment 35 michael CLA 2008-05-05 07:34:01 EDT
any update on this...??
Comment 36 Jerome Lanneluc CLA 2008-05-12 11:59:27 EDT
(In reply to comment #35)
> any update on this...??
> 
Are you seeing this problem as well? In this case we would need a debug trace (please see comment 8). Also what is the Eclipse build id?
Comment 37 Eric Moffatt CLA 2008-12-10 10:13:59 EST
I just came across this in the 3.5M4 candidate (I0081210-0100).

Everything OK...then for no apparent reason almost every project showed errors that could basically be tracked back to one general error "Cannot find class file for java.lang.Object".

Clean/rebuild and Shutdown/restart were no help, I've switched back to I20081202-1812 in order to keep working.
Comment 38 Jerome Lanneluc CLA 2008-12-10 11:50:30 EST
(In reply to comment #37)
> I just came across this in the 3.5M4 candidate (I0081210-0100).
> 
> Everything OK...then for no apparent reason almost every project showed errors
> that could basically be tracked back to one general error "Cannot find class
> file for java.lang.Object".
> 
> Clean/rebuild and Shutdown/restart were no help, I've switched back to
> I20081202-1812 in order to keep working.
> 
It looks like a different problem than reported in comment 0. Comment 0 talk about empty jars. You seem to have another symptom: "Cannot find class file for java.lang.Object". Please enter a separate bug report.
Comment 39 Eclipse Genie CLA 2019-12-30 13:47:10 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.