13

I have Eclipse Juno and Force.com IDE. When I try to create new classes they always show: failed to create the part's controls. It worked for the first time, but now they always show this. Same happens if I create them inside the force.com platform.

Error details:
org.eclipse.core.runtime.AssertionFailedException: assertion failed:
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:110)

etc ...

I would appreciate all help.

Brent Worden
  • 9,586
  • 7
  • 50
  • 50
  • Is this all of the error details, or did you truncate some of them? Better to add the entire trace if possible. Also look in your workspace directory, there should be a .log file, see if any exceptions are logged right after to perform the problem causing steps – Waqas Ilyas Jan 11 '13 at 15:07
  • One answer has a ton of upvotes and is clearly correct. Consider checking it? – fivedogit Oct 06 '17 at 17:46

9 Answers9

55

I had the same error. I fixed it by switching the eclipse workspace. Go to menu File->Switch Workspace->Other, and then select the same workspace you were working with. Eclipse will restart and you should not get the error.

gmodica
  • 571
  • 3
  • 3
  • 2
    Thank you so much for this workaround! Now how am I going to remember it?! – AdamE May 16 '14 at 15:42
  • This works for me and seems to be, in effect, the same as closing and re-opening eclipse. – Marc Jan 16 '15 at 07:15
  • 1
    nope neither switching workspace nor restarting eclipse works. Also I deleted project. Created a new one, created new code files and copy pasted code in them. It compiled and ran. But when I close file and reopen it, it starts giving same error. One more observation: only this project is messed up, others are just fine. – Mahesha999 Aug 05 '15 at 07:04
  • Thanks for workaround. I also faced same issue, after my eclipse is not responding while syn with svn so i closed it from StartTaskManager. – Suseendran P Dec 15 '15 at 13:05
  • My error seemed to have to do with one file and even the content of the file. After deleting and re-pulling the repo, the file would save, but if I pasted in the new changes, the save would fail again. This would happen *even if* I only pasted in a very small section (a few lines) of the new code. So I typed out my changes again to those lines and the saving never failed. – fivedogit Oct 06 '17 at 17:52
  • did not work for me, but it happens for me with the `Data Source` view on some table choosing `Edit Schema...` when it tries to dispay the db schema in the editor (Eclipse Neon 3, 4.6.3) – Andreas Covidiot Nov 20 '18 at 12:44
6

I faced the same issue my default editor for JSP was Web page editor. Which I changed to JSP editor and everything is fine.

PS: To change to JSP editor Right click on JSP page -->open with jsp .

UnearthOS
  • 123
  • 1
  • 8
  • I had selected 'JBOSS JSP Editor' and can't open with 'Failed to create the part's controls' error. I switched to JSP Editor and it opened correctly¡ Thx so much¡ ;) – Terranology Jun 08 '16 at 10:00
2

I got the "failed to create the part's controls" error one day when I opened Eclipse and tried to view a java file I had been working on. When I opened the file I needed, it showed a red X and NullPointerException instead of the code. The error log mentioned "event loop exception" for some reason.
I restarted Eclipse, and the error was still there. I cleaned the project, updated the project, deleted and re-imported the project, deleted and re-imported the file, and the error still was there. As a last resort, I restarted Eclipse again and then the file was fine. So one of the clean/update/delete/import steps worked but I don't know which one.

LConrad
  • 756
  • 1
  • 10
  • 18
  • I suspect you're correct. Much of this sort of work got it going for me on a javascript file. I think the problem is in the workspace. I had to physically remove the folder to a temporary location, clean the workspace, restart eclipse, close eclipse, move the folder back into the workspace and restart eclipse. I did a workspace clean to no effect, similarly a maven clean did not help. There is a maven eclipse clean that I did not try that might have helped. – J E Carter II Feb 12 '18 at 16:23
2

Use eclipse -clean from command prompt to solve this problem.

Vivek Jain
  • 3,703
  • 6
  • 26
  • 45
2

I solved my problem like this:

myeclipse

ekhumoro
  • 98,079
  • 17
  • 183
  • 279
Stan
  • 21
  • 1
1

This problem occur because of in eclipse default editor is not able to identify extension of that file. If you right click on file and open it with respective text editor ,problem will be solved

Ajaykumar Kadam
  • 149
  • 1
  • 1
  • 8
1

enter image description hereIn ecllipse, every file types has some associated default formats and one of the default format set to the particular file type.

You can see this in General -> Editors -> File Associations-

This issue generally occurs when we open any file in the format which is not the default format of the particular types.

I got same issue when I opened one of the Java file in text format in ecllipse and then I started getting the same issue. After research, I observed that AspectJ/Java Editor was setting as default. After reset it to Java Editor, the problem got resolved.

Steps : 1. General -> Editors -> File Associations- 2. Select the content type and choose the default format for it. 3. Restart the ecllipse.

In general, it is some default file format that set in ecllipse causing the same issue.

Satyam
  • 558
  • 4
  • 14
0

in my case problem was that the server was resin and I didn't have the resin server extension installed

0

I solved the problem.

(1)Open the filed with TXT.

(2)Search and Delete the underline between number like:

int a = 10_000;

It works when i compile and run as others used, but it will fail if i save and open again.