Bug 106951 - Compiler reports class types as missing inconsistently; while the project compiles fully on other days
Summary: Compiler reports class types as missing inconsistently; while the project co...
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 critical with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
: 108450 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-08-13 18:01 EDT by Missing name CLA
Modified: 2009-08-30 02:07 EDT (History)
3 users (show)

See Also:


Attachments
Zip file containing .classpath and .project files for each project (6.76 KB, application/octet-stream)
2005-08-16 22:40 EDT, Missing name CLA
no flags Details
console output (634.46 KB, text/plain)
2005-11-02 18:24 EST, Missing name CLA
no flags Details
Console Log Trace (587.15 KB, text/plain)
2005-11-12 22:19 EST, Missing name CLA
no flags Details
debug console log (26.56 KB, text/plain)
2005-11-16 15:56 EST, Neil Swingler CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Missing name CLA 2005-08-13 18:01:18 EDT
Hi,

I have 6 projects one depending on the other and each depending on some libs.
I have setup lib export and project dependency correctly. Eclipse compiles all
projects without any errors on most days.

But on every 5th or 6th day, the same project group reports compilation errors
stating that some of the types are missing.

Nothing has changed as far as the dependency is concerned; none of the libs have
been removed or the project exports changed.

As part of my investigation I just remove and add any arbitrary lib from any of
the project ( just to trigger a rebuild ) and the whole project compiles
successfuly.

Again after 3 to 4 days it reports types are missing ?

After much frustration I added access rules to each sub project making all
classes "**"  "Accessible" and the problem seems to have gone away until today.

Now I have added "**"  "Accessible" to all the libs - not sure how long this
will help me. I will add futher to this bug.

The compiler must be consistent with the problems reported.

Project compiles perfectly with ant.
Comment 1 Missing name CLA 2005-08-13 18:42:01 EDT
A resource change on the disk also seems to trigger this.

For example the project was compiling fully just now. I replaced a png file on
the hard disk. This triggered the "resource change" checking in Eclipse 3.1 IDE,
and it started rebuilding. Now it reports a number of "classes not found" errors
starting with this line as the first error:

  "The project was not built since its build path is incomplete. Cannot find the
class file for javax.help.HelpSet. Fix the build path then try building this
project"

But when I trigger a full rebuild (just add and remove any arbit lib to trigger
this) the project fully compiles !!!!!!!!!

Please treat this bug as CRITICAL ... the full rebuild takes a lot of time.

Cheers





Comment 2 Kent Johnson CLA 2005-08-16 16:16:13 EDT
Any chance we can get a hold of your workspace?

If not, can you attach the .classpath & .project files for each project?
Comment 3 Missing name CLA 2005-08-16 22:40:14 EDT
Created attachment 26175 [details]
Zip file containing .classpath and .project files for each project

As requested by you .classpath and .project files for each project have been
zipped and attached
Comment 4 Missing name CLA 2005-08-17 03:20:49 EDT
Another thing might be significant.

All of my projects are outside of the "workbench" directory.

By default eclipse attempts to create under the workbench; but in my case I
created from existing source dirs.  In case this helps.

In any case the compiler must be consistent.
Cheers.
Comment 5 Missing name CLA 2005-08-24 01:07:44 EDT
Just an update on this.

I had to trigger a rebuild again today, but I just noticed ( this was probably
happening before) that some of my files continue to show error annotation for
some of the libs (i.e. types) reported missing.

Note that there are no errors in the Problems view and project runs and builds
fine. 

Strange
Comment 6 Missing name CLA 2005-10-06 00:58:00 EDT
Any progress on this ? How can I help ?
Am I the only person having this problem ?

I tried 3.2M2 - same problem.

It seems to be something to do with how jar files are exported from one project
to other and project dependency.
Comment 7 Kent Johnson CLA 2005-10-06 10:21:20 EDT
No we have not heard of this problem from anyone else. Suspect it has 
something to do with your setup.

Are you running any Ant scripts to build parts of your projects?
Comment 8 Missing name CLA 2005-10-06 19:06:26 EDT
Ant is not run for day to day development; only to build deployment jars. 
All projects and files are available to Eclipse.

Javac is not used to compile the files via Ant so far anyway.

I will investigate this further in the following weeks because we are going to
start using JAXB and generate java files via ant. We intend to compile it with
Eclipse. I understand that Eclipse uses it's own compiler.
Comment 9 Kent Johnson CLA 2005-10-17 15:00:17 EDT
It does appear that we are tracking a similar problem in bug 108450.

We'll leave both PRs open for now to see if we can find a repeatable case, or 
at least get more details.



When this happens again AND before you do anything to 'fix' it, can you please 
try a few things first:

1. Can you find the declaration of a type from the 'missing' jar file 
(assuming you have attached source)?

2. Can you create a new test project with a new class that extends a type  
from the 'missing' jar file?

thx
Comment 10 Missing name CLA 2005-10-18 18:14:59 EDT
Finally ... some body else has decided to report this problem.
It was hard to believe something was wrong with my setup.

Anyway, I got the problem again. This time it reported Jaxb libs missing.
I created a new project. Associated the user lib Jaxb with this project.

Implemented the "javax.xml.bind.ValidationEvent" in a class.
Every thing compiles fine in this new project.

My other projects continue to report jaxb types as missing.

Please let me know what else I can do to help you fix this problem.

Cheers and good will
Comment 11 Kent Johnson CLA 2005-10-19 10:45:05 EDT
A few more questions:

- what happens if you close and then open your project, when it has the 
unresolved errors? Are they fixed after the open project?

- are the missing jar files located inside your workspace, or outside in 
another directory?
Comment 12 Missing name CLA 2005-10-21 16:38:38 EDT
- Closing and opening the projects has no impact. The auto build kicks in and
seems to do some work ( progress bar and all ) but still shows compilation errors.

- All my projects and library jars are outside the workspace.

This problem is so annoying for us, I am happy to do a live chat to discuss this
problem and let you remotely (via myself) manipulate my project settings. If you
think it will help ofcourse.
Comment 13 Kent Johnson CLA 2005-10-26 15:48:57 EDT
Jerome, this one appears to be the same classpath problem as bug 108450
Comment 14 Jerome Lanneluc CLA 2005-11-02 09:38:45 EST
*** Bug 108450 has been marked as a duplicate of this bug. ***
Comment 15 Jerome Lanneluc CLA 2005-11-02 09:42:06 EST
For tracing this problem, can you please add a .options file (say in
c:\temp\.options) 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

Then start eclipse with the following option:
eclipse.exe -debug c:\temp\.options -vm <path to your jdk>\jre\bin\java.exe

You should see some trace in the DOS console when it is building. Please
copy/paste this trace here or in a bug report (against JDT/Core).

Note this trace can be big, so you might want to first increase the size of the
DOS console buffer.
Comment 16 Missing name CLA 2005-11-02 16:29:10 EST
Can you redirect the console output to a log file ?
This would be different from the Error Log created by Eclipse I presume.

I think JBuilder is able to do this, I am sure Eclipse can. Please tell me how ?
Just a redirect on command line ? I doubt it.

Further, you mention "starts building"  in your comment - you mean when eclipse
attempts to rebuild the projects ?  Note that this happens inconsistently at the
IDE's whim at the moment i.e I have not had the problem "reported in this bug"
happening for the last 5 days.

In any case I have done the console thing ,the command buffer size limit is 999
and I have set number of buffers to 10. I hope this works. I have not used the
console for a while.

I am using win xp.

Cheers
Comment 17 Missing name CLA 2005-11-02 16:46:13 EST
Sorry I got it wrong. There is a screen buffer size under layout tab. That goes
upt0 to 9999. Should be good enough ? I have changed it.

It would be best if I can redirect this to a console.log.
Comment 18 Missing name CLA 2005-11-02 18:24:38 EST
Created attachment 29238 [details]
console output

Console output for eclipse startup with the debug switches you recommended.
Note that I am yet to get the build problem described in this bug.
I forced a rebuild, but that did not add any more info to the console.
Comment 19 Missing name CLA 2005-11-02 22:02:16 EST
I take back what I said in my last comment 

i.e "I forced a rebuild, but that did not add any more info to the console"

It does add, but all the output looks the same and it has all now scrolled over
9999 lines. I get a lot "Fake Exceptions"; not sure what these are.
Comment 20 Jerome Lanneluc CLA 2005-11-03 07:39:18 EST
(In reply to comment #16)
> Can you redirect the console output to a log file ?
> This would be different from the Error Log created by Eclipse I presume.
To redirect the output to a file, use this commmand line instead:
<path to your jdk>\jre\bin\java.exe -classpath .\startup.jar
org.eclipse.core.launcher.Main -debug c:\temp\.options > c:\temp\trace.txt
 
> Further, you mention "starts building"  in your comment - you mean when
> eclipse attempts to rebuild the projects ? 
Sorry that was a copy/paste glitch. I meant when Eclipse starts up.

> Note that this happens inconsistently at the
> IDE's whim at the moment i.e I have not had the problem "reported in this bug"
> happening for the last 5 days.
Please run with tracing all the time. And report the trace only when you get the
problem. Ensure that the trace file doesn't exist before you startup Eclipse.
Comment 21 Jerome Lanneluc CLA 2005-11-03 07:42:17 EST
(In reply to comment #18)
> Created an attachment (id=29238) [edit]
> console output
> 
> Console output for eclipse startup with the debug switches you recommended.
> Note that I am yet to get the build problem described in this bug.
> I forced a rebuild, but that did not add any more info to the console.
> 
I don't see anything wrong with this trace, but as I said earlier the trace is
interesting only if you see the problem.
Comment 22 Missing name CLA 2005-11-03 20:37:23 EST
I tried the following cmd:

"G:\Program Files\J2SE5.0_05\pubjre\bin\java.exe" -cp
"D:\ProgramFiles\Eclipse-3.2M2-Lite\eclipse\startup.jar"
org.eclipse.core.launcher.Main -debug
D:\ProgramFiles\Eclipse-3.2M2-Lite\eclipse\.options >
D:\ProgramFiles\Eclipse-3.2M2-Lite\console.log

eclipse starts up, 
console still displayed, 
debug options are recognised 
but 
output not redirected to console.log

am I missing something ?
Comment 23 Jerome Lanneluc CLA 2005-11-04 05:43:37 EST
I just tried it with the same VM and it worked for me:

d:\jdk1.5.0\jre\bin\java.exe -cp d:\eclipse\sdk\eclipse\startup.jar
org.eclipse.core.launcher.Main -debug d:\temp\.options > d:\temp\console.log

d:\temp\.options has the content from comment 15.
This created a console.log file in d:\temp. I was able to see the contents of
.options once I exited Eclipse.

More details:
d:\jdk1.5.0\jre\bin\java.exe -version
java version "1.5.0_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b03)
Java HotSpot(TM) Client VM (build 1.5.0_05-b03, mixed mode)

Eclipse build ID: I20051102-1600
Comment 24 Missing name CLA 2005-11-04 21:54:41 EST
I had it set as command line of a shortcut in XP. Does not work that way for
some reason.

Works fine from command prompt.
Thanks
Comment 25 Missing name CLA 2005-11-12 22:14:12 EST
I got this problem today. Please find console.log attached. This is the Eclipse
startup trace as suggested by Jerome.

The Projects were fully compiling yesterday. Today they do not. The Problem view
reports the following error:

"The project was not built since its build path is incomplete. Cannot find the
class file for junit.framework.TestCase. Fix the build path then try building
this project FW"

and similar msg for other projects using JUnit.

It also reports the "import com.borland.jbcl" in many files. 
The type junit.framework.TestCase cannot be resolved. It is indirectly
referenced from required .class files etc.

All errors are for JUnit types and JBCL types.

Note that each time this error occurs the library/type reported missing is not
consistently the same it could have been any one of the libs.

If I trigger a rebuild by removing/adding any lib it will rebuild fully without
errors.





Comment 26 Missing name CLA 2005-11-12 22:19:50 EST
Created attachment 29832 [details]
Console Log Trace

Software configuration
----------------------------------------------------------------------
Windows XP Version 5.1 (Build 2600.xpsp_sp2_gdr.050301-1519: Service Pack 2)
-----------------------------------------------------------------------
java version "1.5.0_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode)
---------------------------------------------------------------------
eclipse-platform-3.2M3-win32
eclipse-PDE-3.2M3
eclipse-JDT-3.2M3
xsd-runtime-2.1.0
emf-sdo-runtime-2.1.0
GEF-runtime-3.1
VE-runtime-1.1.0.1
wtp-1.0M8
subclipse-0.9.36
-------------------------------------------------------------------
Comment 27 Neil Swingler CLA 2005-11-16 15:56:18 EST
Created attachment 30097 [details]
debug console log

I have the same problem but I only have one large project. If I do a clean
build I always get the import and type not resolved problems. If I force an
incremental build by changing the files reporting the errors it builds cleanly.


So it appears to be a cycle problem. There are package cycles here although I
could not reproduce the problem with a trivial example.

I am attaching my debug output.
Comment 28 Neil Swingler CLA 2005-11-17 02:49:59 EST
I should add I am using 3.2M3 - the same problem occurred when I reverted to M2
Comment 29 Neil Swingler CLA 2005-11-21 06:58:17 EST
After rereading this bug report, my problem seems to be a bit different so I have raised bug 117302
Comment 30 Jerome Lanneluc CLA 2005-11-21 09:23:57 EST
(In reply to comment #26)
> Created an attachment (id=29832) [edit]
> Console Log Trace
> 
> Software configuration
> ----------------------------------------------------------------------
> Windows XP Version 5.1 (Build 2600.xpsp_sp2_gdr.050301-1519: Service Pack 2)
> -----------------------------------------------------------------------
> java version "1.5.0_05"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
> Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode)
> ---------------------------------------------------------------------
> eclipse-platform-3.2M3-win32
> eclipse-PDE-3.2M3
> eclipse-JDT-3.2M3
> xsd-runtime-2.1.0
> emf-sdo-runtime-2.1.0
> GEF-runtime-3.1
> VE-runtime-1.1.0.1
> wtp-1.0M8
> subclipse-0.9.36
> -------------------------------------------------------------------

I don't see anything wrong with this trace. However I noticed that your Jar files are on a network drive. This is not recommended as the network drive could go down and you would see this kind of problems.

Did you try refreshing the project (from the Java perspective, File > Refresh) after you had these problems ?
Comment 31 Missing name CLA 2005-11-21 15:25:46 EST
All my jars are on this pc ? What are you inferring this from ? Can you paste part of the dump here ? Which jars are we talking about ?

Further, my workbench is set on auto refresh - shouldn't that be enough ? (may be not for network jars ?)

Cheers.
Comment 32 Neil Swingler CLA 2005-11-22 03:00:51 EST
Jerome, did you look at my log by accident? All my files are on N: but this is just a share on my local hard disk anyway.
Comment 33 Jerome Lanneluc CLA 2005-11-22 04:36:53 EST
I actually looked at the log from comment 26 and I suspected that the H: drive was a network drive. If this is not the case, then the only explanation I have is that one of the non Eclipse SDK plugins (xsd, subeclipse, etc.) is interferring (we've seen that before).

Without steps to reproduce, I don't see how we can debug this further.
Comment 34 Missing name CLA 2005-11-22 05:06:47 EST
I have a few disk partitions, that's all.

I think this problem existed much before I started using Subclipse so we might rule that out.

I understand it is hard to debug without being able to consistently reproduce.

I must say the frequency has gone down since I started using 3.2 milestones prior to that it used to happen every 3rd day. At least I think it did. 

If I see a pattern I will comment.

Jerome, thank you for your hard work so far. Cheers.
Comment 35 Jerome Lanneluc CLA 2006-01-31 09:33:29 EST
Please reopen when you have more information.
Comment 36 Missing name CLA 2006-02-20 00:44:23 EST
Problem continues through to 3.2M5. Almost once every week. I have switched off "Workspace/Refresh Automatically" that seems to have brought the frequency down.

-------------------------------------------------------
Cheers and goodwill
-----------------------------------------------------------------------
Configuration
----------------------------------------------------------------------
Intel Pentium III 448Mhz, 320 MB of RAM
----------------------------------------------------------------------
Windows XP Version 5.1 (Build 2600.xpsp_sp2_gdr.050301-1519: Service Pack 2)
----------------------------------------------------------------------
rh8 kernel 2.4.18-14
-----------------------------------------------------------------------
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)
---------------------------------------------------------------------
eclipse-platform-3.2M5-win32
eclipse-PDE-3.2M5
eclipse-JDT-3.2M5
xsd-runtime-2.2.0M4
emf-sdo-runtime-2.2.0M4
GEF-runtime-3.2M4
JEM-runtime-1.2M1
wtp-1.5M4
subclipse-0.9.106
-----------------------------------------------------------
Comment 37 Nobody CLA 2006-06-13 09:07:52 EDT
This starts again to happen since I switched from 3.1.2 to 3.2M6. Before it worked for  quite a while without problems - I almost forgot about it. Here we are again...
Comment 38 Neil Swingler CLA 2006-06-13 09:33:10 EDT
I wonder if bug 117302 is related. I can hack the jdt compiler to get around that problem. It might be interesting to try the same hack (increasing MAX_AT_ONCE) variable and see if it solves your problem. 
Comment 39 Nobody CLA 2006-06-13 10:27:04 EDT
(In reply to comment #38)
> I wonder if bug 117302 is related. I can hack the jdt compiler to get around
> that problem. It might be interesting to try the same hack (increasing
> MAX_AT_ONCE) variable and see if it solves your problem. 
Hm, not necessarily. The files are already compiled (almoust all) before it starts to complain. I think sometimes this problems happens just after the start of Eclipse in the morning (In the eavning the day before everything was fine). But mostly after a CVS update. 

Comment 40 Missing name CLA 2007-01-18 14:21:48 EST
Just an update. This problem continues through to 3.2.1.
I am running everything on Java 6.0. Nothing else has changed.
Still not able to produce it consistently.
Comment 41 Jerome Lanneluc CLA 2007-03-22 08:58:28 EDT
It might be a long shot, but can you please try the patch as indicated in bug 154984 and report here if it helps.
Comment 42 Denis Roy CLA 2009-08-30 02:07:52 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.