从插件调用代码时出现问题:“org.eclipse.core.resources”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12209034/
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
Problems occurred when invoking code from plug-in: "org.eclipse.core.resources"
提问by Ken Russell
How do I resolve the above reported error message? Additional details are given below:
如何解决上述报告的错误消息?其他详细信息如下:
Exception Stack Trace
异常堆栈跟踪
java.lang.NullPointerException
at org.eclipse.m2e.jdt.internal.MavenClasspathContainerInitializer.initialize(MavenClasspathContainerInitializer.java:48)
at org.eclipse.jdt.internal.core.JavaModelManager.initializeContainer(JavaModelManager.java:2843)
at org.eclipse.jdt.internal.core.JavaModelManager.getClasspathContainer(JavaModelManager.java:1878)
at org.eclipse.jdt.core.JavaCore.getClasspathContainer(JavaCore.java:3128)
at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2691)
at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2855)
at org.eclipse.jdt.internal.core.ClasspathChange.generateDelta(ClasspathChange.java:220)
at org.eclipse.jdt.internal.core.DeltaProcessor.resourceChanged(DeltaProcessor.java:2052)
at org.eclipse.jdt.internal.core.DeltaProcessingState.resourceChanged(DeltaProcessingState.java:470)
at org.eclipse.core.internal.events.NotificationManager.run(NotificationManager.java:291)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:285)
at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:149)
at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:395)
at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1530)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2353)
at org.eclipse.wst.jsdt.internal.core.JavaModelManager.initializeAllContainers(JavaModelManager.java:2153)
at org.eclipse.wst.jsdt.internal.core.JavaModelManager.getJsGlobalScopeContainer(JavaModelManager.java:1530)
at org.eclipse.wst.jsdt.core.JavaScriptCore.getJsGlobalScopeContainer(JavaScriptCore.java:1319)
at org.eclipse.wst.jsdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2740)
at org.eclipse.wst.jsdt.internal.core.JavaProject.getResolvedClasspath(JavaProject.java:2019)
at org.eclipse.wst.jsdt.core.JavaScriptCore.initializeAfterLoad(JavaScriptCore.java:2655)
at org.eclipse.wst.jsdt.internal.ui.InitializeAfterLoadJob$RealJob.run(InitializeAfterLoadJob.java:32)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Session Data
会话数据
eclipse.buildId=I20120608-1400
java.version=1.7.0_08-ea
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments: -product org.eclipse.epp.package.jee.product -keyring /Users/ravisankars/.eclipse_keyring -showlocation
Command-line arguments: -os macosx -ws cocoa -arch x86_64 -product org.eclipse.epp.package.jee.product -keyring /Users/ravisankars/.eclipse_keyring -showlocation
采纳答案by Ken Russell
Quite a few things had happened since I first installed Eclipse, like (a) installing / uninstalling plugins (b) upgrading the IDE without correspondingly upgrading the workspace. Since the history has become complex, troubleshooting also got trick. Fresh installation along with importing the code base again, fixed the issue for me.
自从我第一次安装 Eclipse 以来,发生了很多事情,比如 (a) 安装/卸载插件 (b) 升级 IDE 而没有相应地升级工作区。由于历史变得复杂,故障排除也得到了技巧。全新安装并再次导入代码库,为我解决了这个问题。
回答by Prancer
One thing I did (though I recommend uninstalling and re-installing your plugins first as previously posted by @Rajkumar) is to remove the builder causing the issue. MyProject -> Properties -> Builders ...[Troublesome Builder]... Remove.
我做的一件事(尽管我建议先卸载并重新安装您的插件,如@Rajkumar 之前发布的那样)是删除导致问题的构建器。MyProject -> Properties -> Builders ...[Troublesome Builder]... 删除。
It is a short run solution, you are only circumventing the real issue, but for me, it did what I needed it to for the time being.
这是一个短期的解决方案,你只是在规避真正的问题,但对我来说,它暂时满足了我的需要。
回答by Swapnil
Problem like happens if you have to many resources file like java scripts in your eclipse project. The solution is to remove the java script nature from project facets or disable the java script validation.
如果您的 eclipse 项目中有许多资源文件(如 java 脚本),则会发生类似问题。解决方案是从项目方面删除 java 脚本性质或禁用 java 脚本验证。