user1970284
user1970284

Reputation:

Failed to create the part's controls in Eclipse with Salesforce

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.

Upvotes: 19

Views: 98058

Answers (14)

Sam YC
Sam YC

Reputation: 11617

If you are encountering this issue after installed Lombok plugin in your Eclipse, remember clean all the classes file if not the Java file can't be opened, it is due to mis-match of compiled class with the Java source.

Upvotes: 0

Dragana
Dragana

Reputation: 121

In my case, the file wouldn't open because there was an extra parenthesis. I removed it in another editor and after restarting eclipse, it worked...

Upvotes: 1

el-teedee
el-teedee

Reputation: 1341

Had a similar stacktrace on failed to create the part's controls while trying to open Git repositories view in Git perspective.

enter image description here

My case (cause) is different since I was migrating an Eclipse workspace from an Ubuntu VM to Windows.

Many thing were copied like projects, .git folders, or also .metadata Eclipse folder.

Tried with no success:

  • uninstall all egit component (installation details, then, install new software
  • restart eclipse -clean
  • reset Git repository perspective

I searched and found this invalid UNIX : separator in .metadata\.plugins\org.eclipse.core.runtime\.settings\org.eclipse.egit.core.prefs file.

GitRepositoriesView.GitDirectories=/path1/.git\:/path2/.git

Here, the : is invalid path separator on Windows.

I simply removed the value in this line, saved file, and restarted Eclipse:

GitRepositoriesView.GitDirectories=

(alternative: if needed, try to migrate those linux paths to their Windows equivalent too)

Git repositories view is back.

enter image description here

Upvotes: 0

Simran Agrawal
Simran Agrawal

Reputation: 11

This worked for me----> Right click on pom.xml-->open with-->xml editor

Upvotes: 1

I also had for the same problem and fixed it by updating eclipse. Help > Check for Updates.

Upvotes: 0

Roland Lee
Roland Lee

Reputation: 11

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.

Upvotes: 1

Stan
Stan

Reputation: 41

I solved my problem like this:

myeclipse

Upvotes: 4

Satyam
Satyam

Reputation: 761

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.

Upvotes: 1

user2740011
user2740011

Reputation: 21

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

Upvotes: 2

UnearthOS
UnearthOS

Reputation: 153

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 .

Upvotes: 9

LConrad
LConrad

Reputation: 846

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.

Upvotes: 2

Ajaykumar Kadam
Ajaykumar Kadam

Reputation: 309

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

Upvotes: 1

Damian kober
Damian kober

Reputation: 11

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

Upvotes: 0

gmodica
gmodica

Reputation: 649

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.

Upvotes: 62

Related Questions