org.eclipse.emf.ecore.xmi.IllegalValueException [message #473435] |
Wed, 27 June 2007 14:40 |
Andrew Jackson Messages: 24 Registered: July 2009 |
Junior Member |
|
|
Hi,
I get this exception caught and printed when i load a uml componnt model:
org.eclipse.emf.ecore.xmi.IllegalValueException: Value 'null' is not
legal.
( file:///Users/andrewjackson/workspace/RDL_Project/model/Auct ionSystemArch/ArchCompDiargam.uml,
10, 21)
Below i provide my model, the code i use to load the model and i detail
what i observe when i debug the code.
-------------------
Here is the offending component model (generated using Magic draw):
https://www.cs.tcd.ie/~ajackso/Archive.zip
-------------------
It is loaded with the following code:
protected static void registerPathmaps(URI uri) {
URIConverter.URI_MAP.put(URI.createURI("pathmap://UML_LIBRARIES/"), uri
.appendSegment("libraries").appendSegment(""));
URIConverter.URI_MAP.put(URI.createURI("pathmap://UML_METAMODELS/"),
uri.appendSegment("metamodels").appendSegment(""));
URIConverter.URI_MAP.put(URI.createURI("pathmap://UML_PROFILES/"), uri
.appendSegment("profiles").appendSegment(""));
}
private FileManager() {
registerPathmaps(URI
.createURI(" jar:file:/Users/andrewjackson/Desktop/cartona-eclipse/plugin s/org.eclipse.uml2.uml.resources_2.1.0.v200705171545.jar!/ "));
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put(
UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE);
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put(
"xmi", new XMIResourceFactoryImpl());
resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI,
UMLPackage.eINSTANCE);
}
public org.eclipse.uml2.uml.Package load(URI uri) {
org.eclipse.uml2.uml.Package package_ = null;
try {
Resource resource = resourceSet.getResource(uri, true);
package_ = (org.eclipse.uml2.uml.Package) EcoreUtil
.getObjectByType(resource.getContents(),
UMLPackage.Literals.PACKAGE);
} catch (WrappedException we) { ....}
-------------------
As far as i can see an exception is thrown at line 271 of the
ResourceSetImpl class and is caught resulting in the message show at the
start of this message. This message is the direct result of line 275 of
the ResourceSetImpl class.
Thanks in advance for your help,
Andrew
|
|
|
Re: org.eclipse.emf.ecore.xmi.IllegalValueException [message #473439 is a reply to message #473435] |
Wed, 27 June 2007 19:59 |
james bruck Messages: 1724 Registered: July 2009 |
Senior Member |
|
|
Hi Andrew,
I just tried opening up your model with the UML editor and it opens fine
without error so the model itself seems ok.
You can narrow down the issue by removing the profile applications and
stereotype application from your model and then try opening the model with
your code. Does that work?
- James.
"Andrew Jackson" <Andrew.Jackson@cs.tcd.ie> wrote in message
news:524aebd61670d0149b73e163eb86717d$1@www.eclipse.org...
> Hi,
>
> I get this exception caught and printed when i load a uml componnt model:
> org.eclipse.emf.ecore.xmi.IllegalValueException: Value 'null' is not
> legal.
>
( file:///Users/andrewjackson/workspace/RDL_Project/model/Auct ionSystemArch/A
rchCompDiargam.uml,
> 10, 21)
>
> Below i provide my model, the code i use to load the model and i detail
> what i observe when i debug the code.
>
>
> -------------------
>
> Here is the offending component model (generated using Magic draw):
> https://www.cs.tcd.ie/~ajackso/Archive.zip
>
> -------------------
>
> It is loaded with the following code:
>
> protected static void registerPathmaps(URI uri) {
> URIConverter.URI_MAP.put(URI.createURI("pathmap://UML_LIBRARIES/"), uri
> .appendSegment("libraries").appendSegment(""));
> URIConverter.URI_MAP.put(URI.createURI("pathmap://UML_METAMODELS/"),
> uri.appendSegment("metamodels").appendSegment(""));
> URIConverter.URI_MAP.put(URI.createURI("pathmap://UML_PROFILES/"), uri
> .appendSegment("profiles").appendSegment(""));
> }
>
> private FileManager() {
>
> registerPathmaps(URI
>
..createURI(" jar:file:/Users/andrewjackson/Desktop/cartona-eclipse/plugin s/or
g.eclipse.uml2.uml.resources_2.1.0.v200705171545.jar!/"));
> Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put(
> UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE);
>
> Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put(
> "xmi", new XMIResourceFactoryImpl());
>
> resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI,
> UMLPackage.eINSTANCE);
>
> }
>
> public org.eclipse.uml2.uml.Package load(URI uri) {
>
>
> org.eclipse.uml2.uml.Package package_ = null;
>
> try {
> Resource resource = resourceSet.getResource(uri, true);
>
> package_ = (org.eclipse.uml2.uml.Package) EcoreUtil
> .getObjectByType(resource.getContents(),
> UMLPackage.Literals.PACKAGE);
> } catch (WrappedException we) { ....}
>
> -------------------
> As far as i can see an exception is thrown at line 271 of the
> ResourceSetImpl class and is caught resulting in the message show at the
> start of this message. This message is the direct result of line 275 of
> the ResourceSetImpl class.
>
> Thanks in advance for your help,
> Andrew
>
>
|
|
|
|
Re: org.eclipse.emf.ecore.xmi.IllegalValueException [message #622600 is a reply to message #473435] |
Wed, 27 June 2007 19:59 |
james bruck Messages: 1724 Registered: July 2009 |
Senior Member |
|
|
Hi Andrew,
I just tried opening up your model with the UML editor and it opens fine
without error so the model itself seems ok.
You can narrow down the issue by removing the profile applications and
stereotype application from your model and then try opening the model with
your code. Does that work?
- James.
"Andrew Jackson" <Andrew.Jackson@cs.tcd.ie> wrote in message
news:524aebd61670d0149b73e163eb86717d$1@www.eclipse.org...
> Hi,
>
> I get this exception caught and printed when i load a uml componnt model:
> org.eclipse.emf.ecore.xmi.IllegalValueException: Value 'null' is not
> legal.
>
( file:///Users/andrewjackson/workspace/RDL_Project/model/Auct ionSystemArch/A
rchCompDiargam.uml,
> 10, 21)
>
> Below i provide my model, the code i use to load the model and i detail
> what i observe when i debug the code.
>
>
> -------------------
>
> Here is the offending component model (generated using Magic draw):
> https://www.cs.tcd.ie/~ajackso/Archive.zip
>
> -------------------
>
> It is loaded with the following code:
>
> protected static void registerPathmaps(URI uri) {
> URIConverter.URI_MAP.put(URI.createURI("pathmap://UML_LIBRARIES/"), uri
> .appendSegment("libraries").appendSegment(""));
> URIConverter.URI_MAP.put(URI.createURI("pathmap://UML_METAMODELS/"),
> uri.appendSegment("metamodels").appendSegment(""));
> URIConverter.URI_MAP.put(URI.createURI("pathmap://UML_PROFILES/"), uri
> .appendSegment("profiles").appendSegment(""));
> }
>
> private FileManager() {
>
> registerPathmaps(URI
>
..createURI(" jar:file:/Users/andrewjackson/Desktop/cartona-eclipse/plugin s/or
g.eclipse.uml2.uml.resources_2.1.0.v200705171545.jar!/"));
> Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put(
> UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE);
>
> Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put(
> "xmi", new XMIResourceFactoryImpl());
>
> resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI,
> UMLPackage.eINSTANCE);
>
> }
>
> public org.eclipse.uml2.uml.Package load(URI uri) {
>
>
> org.eclipse.uml2.uml.Package package_ = null;
>
> try {
> Resource resource = resourceSet.getResource(uri, true);
>
> package_ = (org.eclipse.uml2.uml.Package) EcoreUtil
> .getObjectByType(resource.getContents(),
> UMLPackage.Literals.PACKAGE);
> } catch (WrappedException we) { ....}
>
> -------------------
> As far as i can see an exception is thrown at line 271 of the
> ResourceSetImpl class and is caught resulting in the message show at the
> start of this message. This message is the direct result of line 275 of
> the ResourceSetImpl class.
>
> Thanks in advance for your help,
> Andrew
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.01471 seconds