I get this problem when I'm doing an external compile (
maven) that fails. Eclipse gets totally confused even after I fix the problem and compile clean.
I don't have a totally cookbook solution, but stopping and restarting Eclipse is a start along with a Refresh operation. Usually that doesn't fix a whole lot, however, since apparently there's some scrambled project metadata. Often "touching" a module will make it recover. I suppose a manual Eclipse "rebuild" might help, but I haven't tried.