0

I have a couple of Java EE web application on my workspace, everything seemed to work fine until I restarted Eclipse (Spring Tool Suite), every time i try to open a Java class, i got this error - on all the projects-:

Incompatible magic value 1107317504 in class file org/eclipse/jdt/core/dom/AnonymousClassDeclaration

I'm using maven on all the projects, I tried to eclipse:clean / update Project , delete and import the projects but still the error remains. Any help to understand this issue will be appreciated , Thanks.

Arjan Tijms
  • 36,666
  • 12
  • 105
  • 134
Rafik BELDI
  • 3,920
  • 4
  • 20
  • 37

2 Answers2

0

It might be caused by the Java Cache. If so, you will need to clean the Java Cache to fix the error with the incompatible magic value.

If your OS is Windows, then you should go to the Control Panel and start the Java Control Panel and then go to the General tab. Next, you choose Settings under "Temporary Internet Files" and click "Delete Files".

Then you should try to re-run your web application again. Perhaps you will need to restart your server first, if you have one up and running.

FNL
  • 103
  • 1
  • 6
  • It seems like the ClassLoader does not recognize the class file for some reason. It sees it as corrupt. Perhaps you have divided your classes into different .jar files or compiled the classes with a newer Java version than the Java version being used for running the web application? – FNL Jun 21 '14 at 12:52
  • It doesn't recognize All the .java files, even java editor is not launching. Other than that everything is fine. – Rafik BELDI Jun 21 '14 at 13:00
  • If it is not too time consuming for you, I advice you to create a new Eclipse workspace beside the one you already have, and then import the projects from the old workspace (as a copy) into the new one and see if everything works again within the new workspace. You could also try to close the projects causing troubles, and then re-open these (in your current workspace), as this is less time consuming compared to creating a entire new workspace. – FNL Jun 21 '14 at 13:06
  • I've tried that too, still the same error when it comes to java editor – Rafik BELDI Jun 21 '14 at 13:08
  • It sure is getting harder to figure out, what the problem is. Since it happened for all projects and is a problem with a new workspace + the Java editor, I suspect the Java version that Eclipse itself is using. Perhaps the Java version used for running Eclipse is incompatible with the Java version you use for your projects somehow. You could check your the Java version of Eclipse here: http://stackoverflow.com/questions/557169/find-out-what-jvm-eclipse-is-running-on – FNL Jun 21 '14 at 13:16
0

It turned out that it was a workspace Issue.

  • I've deleted this file :

    .metadata\.plugins\org.eclipse.e4.workbench\workbench.xmi

this file contains all the workspace meta data, It was corrupted because of some runtime issues. Now everythings is running fine. Thanks

Rafik BELDI
  • 3,920
  • 4
  • 20
  • 37