| An Error running the zipfile for UML2 Profile [message #628041] |
Wed, 11 November 2009 03:11  |
Eclipse User |
|
|
|
I downloaded the zip file for "Introduction to UML2 Profile" and when I run it I get the following error:
...
Loading model...
file:/D:/projects/cs660/com.ibm.uml2.articles/resources/Exte ndedPO2.uml
Applying profile...
Exception in thread "main" java.lang.NullPointerException
at profile.handlers.IntroductionToUML2Profiles.applyProfile(Int roductionToUML2Profiles.java:90)
at profile.handlers.IntroductionToUML2Profiles.main(Introductio nToUML2Profiles.java:263)
It seems that the reference to ExtendedPO2.uml is null. But the file ExtendedPO2.uml is in the dir "D:/projects/cs660/com.ibm.uml2.articles/resources". Is there any wrong with me to set up the program arguments? Thanks.
Will
|
|
|
|
|
|
|
| Re: An Error running the zipfile for UML2 Profile [message #628097 is a reply to message #628096] |
Thu, 26 November 2009 04:11  |
Eclipse User |
|
|
|
Williams wrote on Thu, 26 November 2009 03:37
> Could you please tell me how to check using a correct resource set and whether the factories and uri mapping are in place? I did include resource in the argument of the program as follows:
> " jar:file:C:\eclipse\eclipse\plugins\org.eclipse.uml2.uml.res ources_2.2.0.v200805131030.jar!/ "
Ok, I try to answer, but I'm a newbie here, and also I never tried the zip file you mentioned. You are using the load method from the tutorial article, which uses a statically initialized resource set (RESOURCE_SET). Check if this resource set is initialized in a way that there is a mapping for ExtendedPO2.uml, like this:
Map<URI, URI> uriMap = RESOURCE_SET.getURIConverter().getURIMap();
uriMap.put(URI.createURI(UMLResource.LIBRARIES_PATHMAP),
uri.appendSegment("libraries").appendSegment(""));
uriMap.put(URI.createURI(UMLResource.METAMODELS_PATHMAP),
uri.appendSegment("metamodels").appendSegment(""));
uriMap.put(URI.createURI(UMLResource.PROFILES_PATHMAP),
uri.appendSegment("profiles").appendSegment(""));
uriMap.put(URI.createURI().appendSegment(
"ExtendedPO2").appendFileExtension(UMLResource.FILE_EXTENSION));
This is what I meant with checking the resource set and the uri mappings. I'm not sure if the factories need to be checked too, maybe not.
Can an expert check for a correct answer? :)
Thomas
|
|
|
Powered by
FUDForum. Page generated in 0.04803 seconds