Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Re: unknown protocol: pathmap
Re: unknown protocol: pathmap [message #476935] Thu, 14 February 2008 16:09 Go to next message
Marcelo Paternostro is currently offline Marcelo PaternostroFriend
Messages: 602
Registered: July 2009
Senior Member
Hi,

Probably you will have a better chance of getting a good answer by
posting this question at the UML2 newsgroup. I am already posting this
answer there.

Cheers,
Marcelo

toufik wrote:
> Hi,
> I'am trying to load a UML2 metamodel (to reference somes metaclasses for
> my profile) withing RSA and using UML2.
>
> I have this exception :
>
> java.net.MalformedURLException: unknown protocol: pathmap
>
> any help?
>
> thanks
>
> toufik
>
Re: unknown protocol: pathmap [message #476936 is a reply to message #476935] Thu, 14 February 2008 18:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: flavio.p.duarte.gmail.com

You have to register the pathmap first, like this:
registerPathmaps( URI.createURI(
" jar:file:/c:/Eclipse/plugins/org.eclipse.uml2.uml.resources_ 2.1.0.v200706251652.jar!/ "
) );

The registerPathmaps is in the Profile tutorial.

Flávio
Registering pathmaps without hardcoded paths [message #476937 is a reply to message #476936] Fri, 15 February 2008 10:19 Go to previous message
Mark Howard is currently offline Mark HowardFriend
Messages: 10
Registered: July 2009
Junior Member
On Thu, 14 Feb 2008 18:55:13 +0000, Flavio Duarte wrote:
> You have to register the pathmap first, like this:
> registerPathmaps( URI.createURI(
> "jar:file:/c:/Eclipse/plugins/
org.eclipse.uml2.uml.resources_2.1.0.v200706251652.jar!/"
> ) );
>
> The registerPathmaps is in the Profile tutorial.


This would be much better if you didn't hard code the path to the jar
file (e.g. code below).

final String profile = "profiles/UML2.profile.uml";
URL url = getClass().getClassLoader().getResource(profile);
if (url == null)
{
throw new RuntimeException("Error getting UML2.profile.uml");
}
String urlString = url.toString();
if (!urlString.endsWith(profile))
{
throw new RuntimeException("Error getting UML2.profile.uml. Got: " +
urlString);
}
urlString = urlString.substring(0, urlString.length() - profile.length());
URI uri = URI.createURI(urlString);
Re: unknown protocol: pathmap [message #626035 is a reply to message #476935] Thu, 14 February 2008 18:55 Go to previous message
Eclipse UserFriend
Originally posted by: flavio.p.duarte.gmail.com

You have to register the pathmap first, like this:
registerPathmaps( URI.createURI(
" jar:file:/c:/Eclipse/plugins/org.eclipse.uml2.uml.resources_ 2.1.0.v200706251652.jar!/ "
) );

The registerPathmaps is in the Profile tutorial.

Flávio
Registering pathmaps without hardcoded paths [message #626036 is a reply to message #476936] Fri, 15 February 2008 10:19 Go to previous message
Mark Howard is currently offline Mark HowardFriend
Messages: 10
Registered: July 2009
Junior Member
On Thu, 14 Feb 2008 18:55:13 +0000, Flavio Duarte wrote:
> You have to register the pathmap first, like this:
> registerPathmaps( URI.createURI(
> "jar:file:/c:/Eclipse/plugins/
org.eclipse.uml2.uml.resources_2.1.0.v200706251652.jar!/"
> ) );
>
> The registerPathmaps is in the Profile tutorial.


This would be much better if you didn't hard code the path to the jar
file (e.g. code below).

final String profile = "profiles/UML2.profile.uml";
URL url = getClass().getClassLoader().getResource(profile);
if (url == null)
{
throw new RuntimeException("Error getting UML2.profile.uml");
}
String urlString = url.toString();
if (!urlString.endsWith(profile))
{
throw new RuntimeException("Error getting UML2.profile.uml. Got: " +
urlString);
}
urlString = urlString.substring(0, urlString.length() - profile.length());
URI uri = URI.createURI(urlString);
Previous Topic:Re: unknown protocol: pathmap
Next Topic:Stereotype attribute with unsettable value
Goto Forum:
  


Current Time: Wed Sep 28 10:15:57 GMT 2022

Powered by FUDForum. Page generated in 0.02019 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top