Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 355339

Summary: [M2x IDE Integration] CoreException when invoking XtendXpandUtil#getUnderlyingFile(String, ResourceLoader) for resources stored in plug-ins
Product: [Automotive] Sphinx Reporter: Stephan Eberle <stephaneberle9>
Component: CoreAssignee: Stephan Eberle <stephaneberle9>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ali.akar82, idydieng
Version: 0.7.0   
Target Milestone: 0.7.0   
Hardware: All   
OS: All   
Whiteboard:

Description Stephan Eberle CLA 2011-08-22 02:42:02 EDT
org.eclipse.core.runtime.CoreException: No file system is defined for scheme: bundleresource
	at org.eclipse.core.internal.filesystem.Policy.error(Policy.java:55)
	at org.eclipse.core.internal.filesystem.Policy.error(Policy.java:50)
	at org.eclipse.core.internal.filesystem.InternalFileSystemCore.getFileSystem(InternalFileSystemCore.java:65)
	at org.eclipse.core.internal.filesystem.InternalFileSystemCore.getStore(InternalFileSystemCore.java:107)
	at org.eclipse.core.filesystem.EFS.getStore(EFS.java:470)
	at org.eclipse.core.internal.localstore.FileSystemResourceManager.findLinkedResourcesPaths(FileSystemResourceManager.java:142)
	at org.eclipse.core.internal.localstore.FileSystemResourceManager.allPathsForLocationNonCanonical(FileSystemResourceManager.java:124)
	at org.eclipse.core.internal.localstore.FileSystemResourceManager.allPathsForLocation(FileSystemResourceManager.java:62)
	at org.eclipse.core.internal.localstore.FileSystemResourceManager.allResourcesFor(FileSystemResourceManager.java:216)
	at org.eclipse.core.internal.resources.WorkspaceRoot.findFilesForLocationURI(WorkspaceRoot.java:113)
	at org.eclipse.core.internal.resources.WorkspaceRoot.findFilesForLocationURI(WorkspaceRoot.java:104)
	at org.eclipse.sphinx.xtendxpand.util.XtendXpandUtil.getUnderlyingFile(XtendXpandUtil.java:86)
	at org.eclipse.sphinx.xtendxpand.ui.util.WorkspaceStorageFinder.findStorage(WorkspaceStorageFinder.java:82)
	at org.eclipse.xtend.shared.ui.Activator.findStorage(Activator.java:239)
	at org.eclipse.xtend.shared.ui.core.internal.XtendXpandProject.loadXtendXpandResource(XtendXpandProject.java:310)
	at org.eclipse.xtend.shared.ui.core.internal.XtendXpandProject.loadXtendXpandResource(XtendXpandProject.java:298)
	at org.eclipse.xtend.shared.ui.core.internal.XtendXpandProject.findExtXptResource(XtendXpandProject.java:244)
	at org.eclipse.xtend.shared.ui.core.internal.XtendXpandProject.findXtendXpandResource(XtendXpandProject.java:397)
	at org.eclipse.xtend.shared.ui.core.builder.XtendXpandBuilder.fullBuild(XtendXpandBuilder.java:324)
	at org.eclipse.xtend.shared.ui.core.builder.XtendXpandBuilder.build(XtendXpandBuilder.java:158)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
    ...
Comment 1 Idrissa Dieng CLA 2011-08-22 10:19:32 EDT
I think the exception occur only for Eclipse 3.7. Indeed, the org.eclipse.core.internal.localstore.FileSystemResourceManager#findLinkedResourcesPaths(URI inputLocation, final ArrayList<IPath> results) throws CoreException method is used in FileSystemResourceManager#allPathsForLocationNonCanonical(URI) for Eclipse 3.7 like this:
  
....
try {
     findLinkedResourcesPaths(inputLocation, results);
} catch (CoreException e) {
     Policy.log(e);
}

For Eclipse 3.6, the org.eclipse.core.internal.localstore.FileSystemResourceManager#findLinkedResourcesPaths() does not exist and is not used (i.e., below code as missing). That is why the bug occur only for Eclipse 3.7.
Comment 2 Stephan Eberle CLA 2011-08-23 01:21:54 EDT
According to the exception stack trace, the critical point is more likely org.eclipse.core.internal.filesystem#InternalFileSystemCore#getFileSystem(String), line 65. It logs an internal error no matter if the calling application catches and handles the exception subsequently or not. In our case XtendXpandUtil#getUnderlyingFile() does catch the exception and returns null (which is the expected behavior), so the problem does not entail any consequences. Nevertheless, it is somehow annoying to see the Error Log view getting filled up even though there is no actual misbehavior.

To avoid that,  XtendXpandUtil.getUnderlyingFile() should be improved so as to make sure that IWorkspaceRoot#findFilesForLocationURI(), and subsequently InternalFileSystemCore#getFileSystem(), do never get invoked with a ''bundleresource'' URL.
Comment 3 Stephan Eberle CLA 2011-08-23 01:22:32 EDT
Fixed as proposed in comment #2.
Comment 4 Balazs Grill CLA 2021-07-14 02:15:41 EDT
Mass-closing Resolved tickets