Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » org.eclipse.emf.ecore.xmi.IllegalValueException
org.eclipse.emf.ecore.xmi.IllegalValueException [message #473435] Wed, 27 June 2007 14:40 Go to next message
Andrew Jackson is currently offline Andrew JacksonFriend
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 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
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 #473444 is a reply to message #473439] Thu, 28 June 2007 08:38 Go to previous message
Andrew Jackson is currently offline Andrew JacksonFriend
Messages: 24
Registered: July 2009
Junior Member
That worked! Thanks for your help.
Re: org.eclipse.emf.ecore.xmi.IllegalValueException [message #622600 is a reply to message #473435] Wed, 27 June 2007 19:59 Go to previous message
james bruck is currently offline james bruckFriend
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 #622657 is a reply to message #473439] Thu, 28 June 2007 08:38 Go to previous message
Andrew Jackson is currently offline Andrew JacksonFriend
Messages: 24
Registered: July 2009
Junior Member
That worked! Thanks for your help.
Previous Topic:TriggerListener for changing values of Element properties from Stereotype
Next Topic:Validation Problem
Goto Forum:
  


Current Time: Tue Apr 16 19:18:11 GMT 2024

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

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

Back to the top