how to resolve org.eclipse.core.internal.resources.ResourceException
-
28-10-2019 - |
Question
I never encountered this exception before
org.eclipse.core.internal.resources.ResourceException: Resource '/External Plug-in Libraries' is not open.
at org.eclipse.core.internal.resources.Project.checkAccessible(Project.java:137)
at org.eclipse.core.internal.resources.Project.isNatureEnabled(Project.java:817)
at newmodulewizrd.ui.Integrate.printProjectInfo(Integrate.java:130)
at newmodulewizrd.ui.Integrate.getWorkSpace(Integrate.java:123)
at newmodulewizrd.ui.Integrate.presentOptionsAndAddToMain(Integrate.java:117)
at newmodulewizrd.ui.Integrate$2.actionPerformed(Integrate.java:84)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
this is my code
try {
if (project.isNatureEnabled("org.eclipse.jdt.core.javanature")) {
IJavaProject javaProject = JavaCore.create(project);
if(flag2==0) {
printPackageInfos(javaProject);
flag2=1;
} else {
IPackageFragmentRoot srcFolder = cm.createNewSourceFolder(project);
newModule = srcFolder.createPackageFragment(textfield.getText(), true,null);
printPackageInfos(javaProject);
try {
cm.refreshWorkspace();
} catch (CoreException e) {
e.printStackTrace();
}
}
} else {
System.out.println("something went wrong here");
}
} catch (CoreException e) {
e.printStackTrace();
}
I suspect it is trying to access my 'jre system library [jre6] folder {below my src folder}' inside my java project
Any idea on how to resolve it?
Solution
i found solution to problem so m posting it here so that anyone with same problem can benefit
apparently there was a link to a "phantom project" as mentioned here
Phantom project in an Eclipse plugin
so i followed the steps
1. Activate the 'Plug-ins' view by going to Window > Show View > Other > PDE > Plug-ins.
2. Select all plug-ins in the view.
and restarted my IDE. my "External Plug-in Libraries Java project" was visible now. i deleted this project and now everything is fine.
OTHER TIPS
I had this error when text searching into my workspace. It started happening after importing a new C++ library project from GIT into my Eclipse CDT project list.
I removed the directory below to fix this. It seems like it was corrupted and it was containing a link to an old deleted file that couldn't be found when text searching.
- C:\Users\me\workspace\.metadata\.plugins\org.eclipse.core.resources