问题
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.
回答1:
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.
回答2:
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 .
回答3:
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.
回答4:
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
回答5:
Use eclipse -clean
from command prompt to solve this problem.
回答6:
I solved my problem like this:
回答7:
in my case problem was that the server was resin and I didn't have the resin server extension installed
回答8:
In 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.
来源:https://stackoverflow.com/questions/14280402/failed-to-create-the-parts-controls-in-eclipse-with-salesforce