IBM Support

MalformedURLException when using pathmap to load resources from the EMF Editor

Troubleshooting


Problem

When trying to load resources from the Eclipse Modeling Framework (EMF) Editor of IBM® Rational® Software Architect (RSA) using an URI containing a pathmap (like [] pathmap://MYPATHMAP/MyLibModel.uml []) the following exception may be raised: [] java.net.MalformedURLException: unknown protocol: pathmap at java.net.URL.(Unknown Source) at java.net.URL.(Unknown Source) at java.net.URL.(Unknown Source) at org.eclipse.emf.ecore.resource.impl.URIConverterImpl.createURLInputStream(UnknownSource) []

Cause

A possible cause is that the pathmap is not recognized. Adding it to Window > Preferences > Modeling Path Maps will not solved the problem.

Resolving The Problem

DISCLAIMER

All source code and/or binaries attached to this document are referred to here as "the Program". IBM is not providing program services of any kind for the Program. IBM is providing the Program on an "AS IS" basis without warranty of any kind. IBM WILL NOT BE LIABLE FOR ANY ACTUAL, DIRECT, SPECIAL, INCIDENTAL, OR INDIRECT DAMAGES OR FOR ANY ECONOMIC CONSEQUENTIAL DAMAGES (INCLUDING LOST PROFITS OR SAVINGS), EVEN IF IBM, OR ITS RESELLER, HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

In v7, the pathmap for this editor has to be declared in a plugin extending org.eclipse.emf.ecore.uri_mapping (see attached project):


    1) Create a plugin project

    2) Create a subfolder and copy into it all files that have to be found using your pathmap

    3) Open the plugin.xml with the Plug-in Manifest Editor

    4) On the Dependencies tab, ensure that the following plugins are added:


      - org.eclipse.ui

      - org.eclipse.core.runtime

      - org.eclipse.gmf.runtime.emf.core


    5) On the Extensions tab, add the extension org.eclipse.emf.ecore.uri_mapping

    6) Right-click on it and select New > Mapping

    7) Enter, for example,:


      source=pathmap://MYPATHMAP/

      target=platform:/plugin/PathMap14503/Test/


    Where Test is the subdirectory created in Step 2)

    8) On the Build tab, ensure that the subdirectory created in Step 2 and all the nested files are selected under Binary Build

    9) Save all

    10) Run the plugin as an Eclipse Application

    11) Open an EMF or GMF model

    12) Right-click on the editor and select Load Resource

    13) Enter an URI using the declared pathmap (like

    pathmap://MYPATHMAP/MyLibModel.uml )

URI_PATHMAP.zip

[{"Product":{"code":"SSYK2S","label":"Rational Software Architect Designer"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Modeling","Platform":[{"code":"PF033","label":"Windows"}],"Version":"7.0.0.3","Edition":"All Editions","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SSCLKU","label":"Rational Software Modeler"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Modeling","Platform":[{"code":"PF033","label":"Windows"}],"Version":"7.0.0.3","Edition":"All Editions","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SSJP3D","label":"Rational Systems Developer"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Modeling","Platform":[{"code":"PF033","label":"Windows"}],"Version":"7.0.0.3","Edition":"All Editions","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
10 September 2020

UID

swg21281749