13

Today I came to work, happy. But when I opened my Eclipse, I saw that one of my projects has errors.
It's weird because it shows that it has errors only in the window bar, and not in the Navigator. I don't have any Java errors, this is a valid project that was fine all the time:

:_(

Some of the errors on the error log of Eclipse:

  • JavaBuilder handling ImageBuilderInternalException while building: SP_Procedure
  • Cannot connect to VM
  • File <SomeFile> has been skipped, problem while reading ('Resource is out of sync with the file system')
  • Unhandled event loop exception
  • Internal error

When I run an application from this project, I get a warning message but when I proceed, it works fine, but still. It's very disturbing and I'm not sure if it's harmless.

I tried to:

  • Restart Eclipse
  • Restart my machine
  • Clean projects and recompiling them.
  • Refresh projects
  • Pray

Nothing helped. What could be the problem? (I'm using Indigo Service Release 2)

Roman C
  • 49,761
  • 33
  • 66
  • 176
Maroun
  • 94,125
  • 30
  • 188
  • 241
  • 4
    Please let me know the reason of downvoting so I can avoid mistakes in the future :) Thanks. – Maroun Nov 05 '13 at 11:31
  • `Resource is out of sync with the file system` is usually a CVS problem. maybe you `mvn clean` out of eclipse? – RamonBoza Nov 05 '13 at 11:31
  • 1
    Have you tried right-click->refresh on your project? – Xavi López Nov 05 '13 at 11:31
  • 2
    @RamonBoza It's a problem only between Eclipse and the local filesystem. CVS can cause it if you let te cvs program update your files outside of Eclipse, but it's not at all specific to CVS. – Marko Topolnik Nov 05 '13 at 11:32
  • @XaviLópez Doesnt cleaning auto-refresh the projects ? – An SO User Nov 05 '13 at 11:32
  • @MarkoTopolnik that's why I used the word 'usually' – RamonBoza Nov 05 '13 at 11:34
  • @LittleChild I wouldn't bet on it, cleaning ony erases all output directories and repeats the build. Refreshing is a separate concept in Eclipse. – Marko Topolnik Nov 05 '13 at 11:34
  • 1
    @RamonBoza Usually, people don't use CVS :) – Marko Topolnik Nov 05 '13 at 11:35
  • @LittleChild Actually it seems it doesn't: http://stackoverflow.com/a/9415133/851811 – Xavi López Nov 05 '13 at 11:35
  • @MarkoTopolnik sorry lord, I mean VCS, which includes, svn, git, mercurial, cvs and so, are you happy now? xD – RamonBoza Nov 05 '13 at 11:38
  • 3
    @LittleChild I've just prayed.. still got errors :_( – Maroun Nov 05 '13 at 11:39
  • What if you close all the projects then reopen them? BTW you may want to ask this in #eclipse on Freenode, although be patient there. – Jason C Nov 05 '13 at 11:44
  • @JasonC What do you mean by closing an reopening them? – Maroun Nov 05 '13 at 11:44
  • I mean close and reopen. Right click -> close. Right click -> open. Theoretically it's the same as a refresh. In practice I sometimes see Eclipse refreshes not being effective. – Jason C Nov 05 '13 at 11:46
  • @JasonC Just did.. doesn't help. – Maroun Nov 05 '13 at 11:47
  • Does closing all open file tabs before refreshing affect anything? Perhaps the errors were temporary and have been resolved but the breadcrumb bar is bugged? – Jason C Nov 05 '13 at 11:48
  • 2
    conversationally, which version of Eclipse is this? I've had plenty of workspace related issues in the past with older versions (3.6 and down); more recent versions seem to be nicer to me. Generally the biggest failure point I have is closing Eclipse which will save the workspace; if "something" goes wrong there (which generally results in a quick error popup and then Eclipse closing), you are in for a treat when you next start Eclipse. – Gimby Nov 05 '13 at 11:55
  • Is it an encoding issue, as in https://bugs.eclipse.org/bugs/show_bug.cgi?id=6708? – VonC Nov 07 '13 at 13:50
  • Have you tried starting eclipse again with the -clean switch? For more information on that you may look at: http://stackoverflow.com/questions/2030064/how-to-run-eclipse-in-clean-mode-and-what-happens-if-we-do-so – Andreas Aumayr Nov 07 '13 at 13:51
  • What do you see in the Problems view? That is typically where you want to look for all Errors/Warnings. – E-Riz Nov 12 '13 at 01:07
  • Try switching your workspace and reimporting the project – Ardavan Kalhori Nov 13 '13 at 04:59

10 Answers10

3

The following nuclear option has desperation written all over it. But I have been where the OP has been with the Juno version of Eclipse.

  • Run a "Synchronize with Repository" and save all of your local updates to a different directory.
  • Delete the project. (Check the box to delete the contents on disk. Scary step, but that's OK, because you saved it in a different directory in the previous step, right?)
  • Read in a fresh project from the repository. It builds happily at this point.
  • Integrate your local updates.
  • Keep on praying.
rajah9
  • 11,645
  • 5
  • 44
  • 57
3

Looks that one unused JAR was deleted, but for some reason, I didn't get errors in any file, even in the files that imports this JAR! So what I did was restoring this JAR, delete unused imports and deleted the JAR again.

I've found this error after two days of navigating on this project on each file.. This is weird that Eclipse didn't recognize that1 this is an error, and throw many unrelated errors such as:

  • Cannot connect to VM
  • File has been skipped, problem while reading ('Resource is out of sync with the file system')
  • Unhandled event loop exception

Is this a bug in Eclipse? (All errors and warnings are enabled!)


1 As seen in the image in the question..

Maroun
  • 94,125
  • 30
  • 188
  • 241
  • Just a tip I've found (it may be my version of Eclipse): the Navigator does not display error or warning icons on project folders. On the other hand, the Package Explorer will. – Eric Nov 09 '13 at 00:13
  • 1
    That's really weird :) – Suresh Atta Nov 14 '13 at 10:29
2

A class from the list of imports for the file seems to have moved out or the jar file containing the class is missing. Expand the imports section and check if you find some classes that are missing but have been imported.

Utsav
  • 404
  • 2
  • 6
1

Though it is a pain, sometimes the easiest solution is to back up all your projects (either in a repository or somewhere else on your computer) then uninstall and reinstall eclipse. No it's not fun, but it should reset eclipse so everything works again. The downfall though is that you have to reconfigure eclipse to any special settings you had/reinatall any extra functionality currently installed (eg. android add-on) and reconnect to any repositories you have. While punting isn't fun, it can be effective... I hope you don't have to resort to this though.

JustWannaFly
  • 301
  • 1
  • 11
1

I have went through that problem a lot of times, and tried everything you tried. Rebuild, recompile, refresh, remove and add JDK, remove and reinstall Eclipse... nothing worked

The only thing I concluded is that the workspace metadata was corrupted.

What I did (every time it happened) was

  • Create an empty workspace
  • Import -> existing projects into worskpace
  • Mark the "copy projects" (else it will only link them)
  • Wait for the copy, and start working with the new workspace

If you work with SCM systems (Git, SVN, etc), making a full checkout will do the trick too, but the worskpace import will let you retrieve those changes you didn't get to commit (if any).

It's a little painful if you have somethings already set (like JDK names, servers, etc), but then I realized it was faster than keep searching how to fix the workspace

Regards!

PS : I've been working with Kepler lately, and everything works fine till now

Cristian Meneses
  • 4,013
  • 17
  • 32
1

Click Window -> Show View -> Other -> General -> Problems

This view will show you what is wrong.

pablosaraiva
  • 2,343
  • 1
  • 27
  • 38
  • 1
    This helped ! An excel file was edited(and closed) but eclipse picked up only after refresh. The above view clearly described the issue. – Silverbullet Jan 11 '19 at 11:03
0

Did you, by any chance, update your virtual machine outside of Eclipse? I can't help but feel that we're both missing a finer detail here. I just keep seeing "cannot connect to VM" and thinking that it's a major clue.

Have you tried running anything from the terminal? Does it work there?

If so, do you know where your current edition of Java is located? Is Eclipse looking somewhere else?

Is this exclusive to one project? Do you use any additional libraries to the JDK?

Michael Oberlin
  • 479
  • 4
  • 4
0

Maybe try this for Resource is out of sync with the file system error:

  • Right click project in Eclipse Package Explorer
  • Close Project.
  • Right click project in Eclipse Package Explorer
  • Open Project.
javaPlease42
  • 4,699
  • 7
  • 36
  • 65
0

Other things not mentioned:

  1. project properties > java build path, see if any of those tabs got changed, local file got moved? read/write permissions on some file you are linking to?
  2. project properties > java compiler, see if workplace settings have changed? maybe under errors/warnings, you can systematically set them to 'ignore' until the error goes away to determine what type of error it is?
  3. maybe update some of the eclipse plugins?
Greg
  • 652
  • 6
  • 7
0

I saw something like this happening for a number of reasons. Mainly because of validation in files other Java source code. See if you are validating XML for instance.

Right click your project and chose Properties (Alt+Enter) and Validation to see the related configuration.

As for the danger, I lived with those marks for ages and nothing wrong ever happened.

Akira
  • 4,001
  • 1
  • 16
  • 24