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

Bug 347300

Summary: Exception raised when activating/deactivating editors: "No file system is defined for scheme: pathmap"
Product: [Modeling] Papyrus Reporter: Alain Le Guennec <alain.leguennec>
Component: CoreAssignee: Cedric Dumoulin <cedric.dumoulin>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipse-bugzilla, hess, mathieu.velten
Version: 0.8.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Alain Le Guennec CLA 2011-05-26 07:57:19 EDT
Build Identifier: 3.7.0RC1

When activating/deactivating editors, the following exception is raised:
org.eclipse.core.runtime.CoreException: No file system is defined for scheme: pathmap
	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.emf.workspace.util.WorkspaceSynchronizer.getFile(WorkspaceSynchronizer.java:357)
	at org.eclipse.emf.workspace.util.WorkspaceSynchronizer.getFile(WorkspaceSynchronizer.java:270)
	at org.eclipse.papyrus.core.adaptor.gmf.GmfMultiDiagramDocumentProvider.computeModificationStamp(GmfMultiDiagramDocumentProvider.java:171)
	at org.eclipse.papyrus.core.adaptor.gmf.GmfMultiDiagramDocumentProvider.getModificationStamp(GmfMultiDiagramDocumentProvider.java:348)
	at org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor.sanityCheckState(DiagramDocumentEditor.java:722)
	at org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor.safelySanityCheckState(DiagramDocumentEditor.java:708)
	at org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor$ActivationListener.handleActivation(DiagramDocumentEditor.java:1179)
	at org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor$ActivationListener.partActivated(DiagramDocumentEditor.java:1137)
	at org.eclipse.ui.internal.PartListenerList$1.run(PartListenerList.java:72)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.runtime.Platform.run(Platform.java:888)
	at org.eclipse.ui.internal.PartListenerList.fireEvent(PartListenerList.java:57)
	at org.eclipse.ui.internal.PartListenerList.firePartActivated(PartListenerList.java:70)
	at org.eclipse.ui.internal.PartService.firePartActivated(PartService.java:187)
	at org.eclipse.ui.internal.PartService.setActivePart(PartService.java:306)
	at org.eclipse.ui.internal.WWinPartService.updateActivePart(WWinPartService.java:134)
	at org.eclipse.ui.internal.WWinPartService.access$0(WWinPartService.java:125)
	at org.eclipse.ui.internal.WWinPartService$WWinListener.partDeactivated(WWinPartService.java:50)
	at org.eclipse.ui.internal.PartListenerList2$4.run(PartListenerList2.java:115)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.runtime.Platform.run(Platform.java:888)
	at org.eclipse.ui.internal.PartListenerList2.fireEvent(PartListenerList2.java:55)
	at org.eclipse.ui.internal.PartListenerList2.firePartDeactivated(PartListenerList2.java:113)
	at org.eclipse.ui.internal.PartService.firePartDeactivated(PartService.java:242)
	at org.eclipse.ui.internal.PartService.setActivePart(PartService.java:300)
	at org.eclipse.ui.internal.WorkbenchPagePartList.fireActivePartChanged(WorkbenchPagePartList.java:57)
	at org.eclipse.ui.internal.PartList.setActivePart(PartList.java:136)
	at org.eclipse.ui.internal.WorkbenchPage.setActivePart(WorkbenchPage.java:3642)
	at org.eclipse.ui.internal.WorkbenchPage.internalActivate(WorkbenchPage.java:691)
	at org.eclipse.ui.internal.WorkbenchPage.activate(WorkbenchPage.java:663)
	at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2963)
	at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2856)
	at org.eclipse.ui.internal.WorkbenchPage.access$10(WorkbenchPage.java:2848)
	at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2799)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2795)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2779)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2762)

The problem seems to lie with org.eclipse.papyrus.core.adaptor.gmf.GmfMultiDiagramDocumentProvider:
It is failing when trying to map the resources making up the model onto resource of the workbench, for resources whose URI uses the "pathmap" scheme (which is typically the case for profiles or libraries that are contributed through plugins).


Reproducible: Always
Comment 1 Cedric Dumoulin CLA 2011-06-03 12:14:38 EDT
There is two related bugs in Eclipse:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=310446
https://bugs.eclipse.org/bugs/show_bug.cgi?id=324788

In Papyrus, the exception is raised because when a resource is modified,  the method org.eclipse.papyrus.core.adaptor.gmf.GmfMultiDiagramDocumentProvider.computeModificationStamp is called.
This in turn calls the  org.eclipse.core.internal.filesystem.InternalFileSystemCore.getFileSystem() method, which fails to find PATHMAP. 


This bug also happen in the following condition:
-Create a model
-Create 2 class diagrams
-Import a profile (Ecore for example)

The exception is raised, because a pathmap variable is added to the model, and the model is modified.
A possible solution is to change the computeModificationStamp() method in order to catch faulty resources (with faulty URIs) before the  call to getFileSystem().
The solution remove the exceptions, but I am not sure that it does'nt introduce other bugs. 
We should understand why we try to get a URI with a scheme 'pathmap'  or 'platform', and why this fail. Do we forgot to register something ?
Comment 2 Mathieu Velten CLA 2011-06-14 08:58:44 EDT
I am pretty sure that the problem does not come from papyrus since pathmap and platform URI are valid EMF URIs.

I am a little worried that this change breaks something.
Why not put WorkspaceSynchronizer.getFile in a try-catch, since file variable is checked against null right after, it should fix the problem with less regression possibilities.
Comment 3 Mathieu Velten CLA 2011-06-14 09:05:12 EDT
more infos here :
https://bugs.eclipse.org/bugs/show_bug.cgi?id=333690

looks like we should just ignore the error log entry until it's fixed upstream.
Comment 4 Cedric Dumoulin CLA 2011-06-15 10:29:27 EDT
I have choose to prevent the exception rather than catching it for performance reasons: it looks like the call to getFile() is time consuming (to be confirmed) when the file is not found. I was reluctant to apply this patch, because it could hide others problems in the future.
We could change the code in order to let it report the first exception, and skip the remaining ones.
Comment 5 Stefan Hess CLA 2011-09-09 04:44:07 EDT
I think this bug is a duplicate of bug 351813.
I tried the patched version from Mariot Chauvin which solved the platform/pathmap error for me.
This fix is in the indigo repository for SR1
(Source : https://bugs.eclipse.org/bugs/show_bug.cgi?id=351813#c6)
Comment 6 Camille Letavernier CLA 2013-05-03 07:11:01 EDT
Cannot reproduce anymore.

> This fix is in the indigo repository for SR1

I close this task