IBM Support

MalformedURLException when using pathmap to load resources from the EMF Editor

Technote (troubleshooting)


Problem(Abstract)

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.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(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

Cross Reference information
Segment Product Component Platform Version Edition
Software Development Rational Software Modeler Modeling Windows 7.0.0.3 All Editions
Software Development Rational Systems Developer Modeling Windows 7.0.0.3 All Editions

Document information

More support for: Rational Software Architect
Modeling

Software version: 7.0.0.3

Operating system(s): Windows

Software edition: All Editions

Reference #: 1281749

Modified date: 28 January 2011


Translate this page: