Re: unknown protocol: pathmap [message #476935] |
Thu, 14 February 2008 11:09  |
Eclipse User |
|
|
|
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
>
|
|
|
|
Registering pathmaps without hardcoded paths [message #476937 is a reply to message #476936] |
Fri, 15 February 2008 05:19  |
Eclipse User |
|
|
|
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 13:55  |
Eclipse User |
|
|
|
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 05:19  |
Eclipse User |
|
|
|
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);
|
|
|
Powered by
FUDForum. Page generated in 0.02842 seconds