无法使用 Salesforce 在 Eclipse 中创建部件的控件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14280402/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Failed to create the part's controls in Eclipse with Salesforce
提问by gmodica
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.
我有 Eclipse Juno 和 Force.com IDE。当我尝试创建新类时,它们总是显示:failed to create the part's controls。这是第一次有效,但现在他们总是显示这一点。如果我在force.com
平台内创建它们,也会发生同样的情况。
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.
我将不胜感激所有帮助。
回答by gmodica
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.
我有同样的错误。我通过切换 eclipse 工作区来修复它。转到菜单 File->Switch Workspace->Other,然后选择您正在使用的相同工作区。Eclipse 将重新启动,您应该不会收到错误消息。
回答by UnearthOS
I faced the same issue my default editor for JSP was Web page editor. Which I changed to JSP editor and everything is fine.
我遇到了同样的问题,我的 JSP 的默认编辑器是网页编辑器。我改成 JSP 编辑器,一切都很好。
PS: To change to JSP editor Right click on JSP page -->open with jsp .
PS: 切换到 JSP 编辑器 右键单击 JSP 页面 --> open with jsp 。
回答by user2740011
Use eclipse -clean
from command prompt to solve this problem.
使用eclipse -clean
from 命令提示符来解决这个问题。
回答by LConrad
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.
有一天,当我打开 Eclipse 并试图查看我一直在处理的 Java 文件时,我收到了“无法创建部件的控件”错误。当我打开我需要的文件时,它显示一个红色的 X 和 NullPointerException 而不是代码。错误日志出于某种原因提到了“事件循环异常”。
我重新启动Eclipse,错误仍然存在。我清理项目,更新项目,删除并重新导入项目,删除并重新导入文件,错误仍然存在。作为最后的手段,我再次重新启动 Eclipse,然后文件就正常了。所以清理/更新/删除/导入步骤之一有效,但我不知道是哪一个。
回答by Satyam
In ecllipse, every file types has some associated default formats and one of the default format set to the particular file type.
在 ecllipse 中,每种文件类型都有一些关联的默认格式,其中一种默认格式设置为特定文件类型。
You can see this in General -> Editors -> File Associations-
您可以在 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.
当我在 ecllipse 中打开一个文本格式的 Java 文件时遇到了同样的问题,然后我开始遇到同样的问题。经过研究,我观察到 AspectJ/Java 编辑器设置为默认值。将其重置为 Java Editor 后,问题得到解决。
Steps : 1. General -> Editors -> File Associations- 2. Select the content type and choose the default format for it. 3. Restart the ecllipse.
步骤: 1. General -> Editors -> File Associations- 2. 选择内容类型并为其选择默认格式。3. 重新启动椭圆。
In general, it is some default file format that set in ecllipse causing the same issue.
通常,在 ecllipse 中设置的某些默认文件格式会导致相同的问题。
回答by Stan
I solved my problem like this:
我这样解决了我的问题:
回答by Ajaykumar Kadam
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
出现此问题是因为在 Eclipse 默认编辑器中无法识别该文件的扩展名。如果您右键单击文件并使用相应的文本编辑器打开它,问题将得到解决
回答by Damian kober
in my case problem was that the server was resin and I didn't have the resin server extension installed
就我而言,问题是服务器是树脂,而我没有安装树脂服务器扩展