Community
Participate
Working Groups
In ProjectAnalyzer#loadMetamodelsForProject an ResourceException can occur when the resource is a linked folder. This happens for example when running a runtime workbench and having a plugin opened in the development workbench. Stack: org.eclipse.core.internal.resources.ResourceException: Resource '/.org.eclipse.jdt.core.external.folders/.link1' does not exist. at org.eclipse.core.internal.resources.Resource.checkExists(Resource.java:326) at org.eclipse.core.internal.resources.Resource.checkAccessible(Resource.java:200) at org.eclipse.core.internal.resources.Resource.accept(Resource.java:53) at org.eclipse.core.internal.resources.Resource.accept(Resource.java:110) at org.eclipse.core.internal.resources.Resource.accept(Resource.java:94) at org.eclipse.xtend.typesystem.emf.ui.ProjectAnalyzer.loadMetamodelsForProject(ProjectAnalyzer.java:128) at org.eclipse.xtend.typesystem.emf.ui.ProjectAnalyzer.run(ProjectAnalyzer.java:90) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
there seems to be a general problem with linked resources... not only when loading metamodels. You will run into a similar problem when you use extensions in your runtime-workbench templates which are distributed by plugins in your development workbench
It seems that I'm experiencing the same error on a Windows machine. Here is a link to the corresponding Eclipse Forum thread: http://www.eclipse.org/forums/index.php/m/757280/
Came across this bug again and think that I finally could nail it down. JDT creates this external folders project through class ExternalModelManager. This project creates links for all managed external folders. But this project does not have a Java nature, thus any method on IJavaProject will fail. I think that this project should have the Java nature enabled, so I raised Bug#394568. Until this is fixed the XtendXpandBuilder might fix the situation.
Turned out that this is no JDT bug. The problem is as follows: 1) The JDTStorageFinder searches the IStorage for an Xtend file, which is on a linked folder Folder might be e.g. F/.org.eclipse.jdt.core.external.folders/.link1 2) IFolder#findMember() resolves this to its original location, e.g. L/.org.eclipse.jdt.core.external.folders/.link1/<path-to-xtend-file> 3) XtendXpandProject#loadXtendXpandResource() gets this IStorage and asks the XtendResourceParser to load the Resource ResourceContributor#create(storage,fqn) 4) XtendResourceParser#parse() retrieves the wrong (!) project through IResource#getProject. It points to the External Folders project! 5) The PluginExtensionFactory is instantiated with this non-Java project. This fails subsequently to retrieve Java types from it. The PluginExtensionFactory must be instantiated with the IJavaProject from which the request originates. The ResourceContributor interface does not allow to pass the project to the parser. This is required as additional argument to the create() method. Therefore an interface extension ResourceContributor2 is required.
Forgot to close it. Fixed with 979f50390e5c8308b974c71bae5c2176c32967f9 on 2012-11-26.
Requested via bug 522520. -M.