Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Re: Loading a Resource fails
Re: Loading a Resource fails [message #477851] Mon, 20 October 2008 16:09 Go to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------020602040301090903040609
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Timothy,

These are really questions to direct to the UML2 newsgroup because I
just can't answer them from an EMF perspective. I'm not sure there is
any way in the IDE, given just an Ecore model, to create an instance of
UML's GenModel...


Timothy Marc wrote:
> But it is really strange, because obviously, the
> DerivedUnionEObjectList-Type is used... so, why is this Liste-Type
> used, but not the SubsetSuperset-one?
>
> "Timothy Marc" <timothymarc@freenet.de
> <mailto:timothymarc@freenet.de>> schrieb im Newsbeitrag
> news:gdi15h$9re$1@build.eclipse.org...
> Okay, and how can i use it explicitly. I didn't found any tutorial
> for it. Do you know some?
>
> "Ed Merks" <Ed.Merks@gmail.com <mailto:Ed.Merks@gmail.com>>
> schrieb im Newsbeitrag news:gdi10t$5nk$1@build.eclipse.org...
> Timothy,
>
> In order to generate the right things, you really have to be
> using UML's extended GenModel, which you'll only get if you
> specify your model using UML2 and import it. So it's not
> sufficient just to have an Ecore model with annotations just
> like the ones UML produces, you have to be using UML's
> extended GenModel for those annotations to be recognized...
>
>
> Timothy Marc wrote:
>> Ed,
>>
>> i've tried it with a reall simple model. It consists only of
>> the following elements:
>>
>> ModelElement
>> +owner:ModelElement (union)
>> +ownedElement:ModelElement (union)
>>
>> A : ModelElement
>> +theB :B (subsets +ownedElemend) -containment
>>
>> B : ModelElement
>> +theA:A (subsets +owner)
>>
>> and the Editor allows, to construct things like
>>
>> A
>> + B
>>
>> But the access fails with the message, that B is not a legal
>> value.
>>
>> It is wierd, because i thought, that the generator should
>> made use of the UML2-specific SupersetSubsetEList-Type, for
>> the subsetting properties (annotated as subsets), as it made
>> use of the DerivedUnionEList-Type for the EReferences,
>> annotated as Unions. But instead of, it uses the simple
>> Ecore-List-Type.
>>
>> After your last post, i've tried a lot with these annotations
>> ans the code generation for UML2. I'm confused right now,
>> because I'm pretty sure, that, in a former approach, the code
>> generator exactly has used this UML2-specific types. But now,
>> everytime i regenerate this simple model, it uses only the
>> EMF-specific one...
>>
>> I'm a bit frustrated currently, because i didn't get forward
>> with this problem...
>>
>> Timothy
>>
>> "Ed Merks" <Ed.Merks@gmail.com
>> <mailto:Ed.Merks@gmail.com>> schrieb im Newsbeitrag
>> news:gdhrs1$2du$1@build.eclipse.org...
>> Timothy,
>>
>> Comments below.
>>
>> Timothy Marc wrote:
>>> Ed,
>>>
>>> you were right. It was because of an invalid reference. However, this kind
>>> of reference was allowed by the generated editor. Currently, i'm playing a
>>> little bit with the UML2 codegenerator, in particular the
>>> Union/Subset-mechanism.
>>>
>> Hmmm. It should never allow you to construct an instance
>> that isn't sound. In fact, the underlying model simply
>> doesn't allow it, which is why the deserializer is
>> failing. Maybe you just had two objects with the same ID
>> or something else that the validator could notice if you
>> invoked it?
>>> Thx
>>> Timothy
>>> "Timothy Marc" <timothymarc@freenet.de> schrieb im Newsbeitrag
>>> news:gdhhid$rqj$1@build.eclipse.org...
>>>
>>>> Hey all,
>>>>
>>>> i've a problem when i try to load a resource programmatically. I think,
>>>> this is because of a missconfiguration of ResourceFactories, but i didn't
>>>> get it work.
>>>>
>>>> The genmodel settings uses the None as Resource Type. That works fine. But
>>>> when i try to load my model programmatically via the following snippet:
>>>>
>>>> final ResourceSet resourceSet = new ResourceSetImpl();
>>>> final Resource r = resourceSet.getResource(uri,true);
>>>> final TestingModel model = (TestingModel)r.getContents().get(0);
>>>>
>>>> it fails with the following exception:
>>>>
>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException:
>>>> org.eclipse.emf.ecore.xmi.IllegalValueException: Value
>>>> 'testing.impl.PackageImpl@1325aef (id: null, description: null, name:
>>>> pack)' is not legal.
>>>> (file:/D:/workspaces/esaWorkspace/testing.victoria/My.testin g, -1, -1)
>>>> at
>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:316)
>>>> at
>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:275)
>>>> at
>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:398)
>>>> at unit.UMLismTesting.test(UMLismTesting.java:28)
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>>> at java.lang.reflect.Method.invoke(Unknown Source)
>>>> at
>>>> org.junit.internal.runners.TestMethodRunner.executeMethodBod y(TestMethodRunner.java:99)
>>>> at
>>>> org.junit.internal.runners.TestMethodRunner.runUnprotected(T estMethodRunner.java:81)
>>>> at
>>>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAfterRunner.java:34)
>>>> at
>>>> org.junit.internal.runners.TestMethodRunner.runMethod(TestMe thodRunner.java:75)
>>>> at
>>>> org.junit.internal.runners.TestMethodRunner.run(TestMethodRu nner.java:45)
>>>> at
>>>> org.junit.internal.runners.TestClassMethodsRunner.invokeTest Method(TestClassMethodsRunner.java:66)
>>>> at
>>>> org.junit.internal.runners.TestClassMethodsRunner.run(TestCl assMethodsRunner.java:35)
>>>> at
>>>> org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunner.java:42)
>>>> at
>>>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAfterRunner.java:34)
>>>> at org.junit.internal.runners.TestClassRunner.run(TestClassRunn er.java:52)
>>>> at
>>>> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.r un(JUnit4TestReference.java:38)
>>>> at
>>>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
>>>> at
>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)
>>>> at
>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
>>>> at
>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
>>>> at
>>>> org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunne r.main(RemotePluginTestRunner.java:58)
>>>> at
>>>> org.eclipse.pde.internal.junit.runtime.CoreTestApplication.r un(CoreTestApplication.java:24)
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>>> at java.lang.reflect.Method.invoke(Unknown Source)
>>>> at
>>>> org.eclipse.equinox.internal.app.EclipseAppContainer.callMet hod(EclipseAppContainer.java:572)
>>>> at
>>>> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:171)
>>>> at
>>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
>>>> at
>>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
>>>> at
>>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
>>>> at
>>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>>> at java.lang.reflect.Method.invoke(Unknown Source)
>>>> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
>>>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
>>>> at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
>>>> at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
>>>> Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value
>>>> 'testing.impl.PackageImpl@1325aef (id: null, description: null, name:
>>>> pack)' is not legal.
>>>> (file:/D:/workspaces/esaWorkspace/testing.victoria/My.testin g, -1, -1)
>>>> at
>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2535)
>>>> at
>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHandler.java:1098)
>>>> at
>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:1179)
>>>> at
>>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(Unknown
>>>> Source)
>>>> at
>>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
>>>> Source)
>>>> at
>>>> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
>>>> Source)
>>>> at
>>>> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
>>>> Source)
>>>> at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
>>>> Source)
>>>> at
>>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
>>>> Source)
>>>> at
>>>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
>>>> Source)
>>>> at javax.xml.parsers.SAXParser.parse(Unknown Source)
>>>> at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:179)
>>>> at
>>>> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
>>>> at
>>>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1354)
>>>> at
>>>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1155)
>>>> at
>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:256)
>>>> at
>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:271)
>>>> ... 41 more
>>>> Caused by: java.lang.UnsupportedOperationException
>>>> at
>>>> org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(DerivedEObjectEList.java:278)
>>>> at java.util.AbstractSequentialList.add(Unknown Source)
>>>> at
>>>> org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObjectEList.java:660)
>>>> at
>>>> org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:1179)
>>>> at
>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2530)
>>>> ... 57 more
>>>>
>>>>
>>>> Can anyone help me? I think this is just a configuration issue, isnt' it?
>>>>
>>>> Thx
>>>> Timothy
>>>>
>>>>
>>>
>>>
>>>
>>

--------------020602040301090903040609
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Timothy,<br>
<br>
These are really questions to direct to the UML2 newsgroup because I
just can't answer them from an EMF perspective.&nbsp; I'm not sure there is
any way in the IDE, given just an Ecore model, to create an instance of
UML's GenModel...<br>
<br>
<br>
Timothy Marc wrote:
<blockquote cite="mid:gdi1dj$b0v$1@build.eclipse.org" type="cite">
<title></title>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<meta content="MSHTML 6.00.2900.5659" name="GENERATOR">
<div><font face="Arial" size="2">But it is really strange, because
obviously, the DerivedUnionEObjectList-Type is used... so, why is this
Liste-Type used, but not the SubsetSuperset-one?</font></div>
<blockquote dir="ltr"
style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;">
<div>"Timothy Marc" &lt;<a moz-do-not-send="true"
href="mailto:timothymarc@freenet.de">timothymarc@freenet.de</a>&gt;
schrieb im Newsbeitrag <a moz-do-not-send="true"
href="news:gdi15h$9re$1@build.eclipse.org">news:gdi15h$9re$1@build.eclipse.org</a>...</div>
<div><font face="Arial" size="2">Okay, and how can i use it
explicitly. I didn't found any tutorial for it. Do you know some?</font></div>
<blockquote dir="ltr"
style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;">
<div>"Ed Merks" &lt;<a moz-do-not-send="true"
href="mailto:Ed.Merks@gmail.com">Ed.Merks@gmail.com</a>&gt; schrieb im
Newsbeitrag <a moz-do-not-send="true"
href="news:gdi10t$5nk$1@build.eclipse.org">news:gdi10t$5nk$1@build.eclipse.org</a>...</div>
Timothy,<br>
<br>
In order to generate the right things, you really have to be using
UML's extended GenModel, which you'll only get if you specify your
model using UML2 and import it.&nbsp;&nbsp; So it's not sufficient just to have
an Ecore model with annotations just like the ones UML produces, you
have to be using UML's extended GenModel for those annotations to be
recognized...<br>
<br>
<br>
Timothy Marc wrote:
<blockquote cite="mid:gdi0f1$vn8$1@build.eclipse.org" type="cite">
<meta content="MSHTML 6.00.2900.5659" name="GENERATOR">
<style></style>
<div><font face="Arial" size="2">Ed,</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">i've tried it with a reall
simple model. It consists only of the following elements:</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">ModelElement</font></div>
<div><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; +owner:ModelElement (union)</font></div>
<div><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; +ownedElement:ModelElement
(union)</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">A : ModelElement</font></div>
<div><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; +theB :B (subsets
+ownedElemend) -containment</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">B : ModelElement</font></div>
<div><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; +theA:A (subsets +owner)</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">and the Editor allows, to
construct things like </font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; A</font></div>
<div><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;+ B</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">But the access fails with the
message, that B is not a legal value.</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">It is wierd, because i
thought, that the generator should made use of the UML2-specific
SupersetSubsetEList-Type, for the subsetting properties (annotated as
subsets), as it made use of the DerivedUnionEList-Type for the
EReferences, annotated as Unions. But instead of, it uses the simple
Ecore-List-Type.</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">After your last post, i've
tried a lot with these annotations ans the code generation for UML2.
I'm confused right now, because I'm pretty sure, that, in a former
approach, the code generator exactly has used this UML2-specific types.
But now, everytime i regenerate this simple model, it uses only the
EMF-specific one...</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">I'm a bit frustrated
currently, because i didn't get forward with this problem...</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">Timothy</font></div>
<blockquote dir="ltr"
style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;">
<div>"Ed Merks" &lt;<a href="mailto:Ed.Merks@gmail.com"
moz-do-not-send="true">Ed.Merks@gmail.com</a>&gt; schrieb im
Newsbeitrag <a href="news:gdhrs1$2du$1@build.eclipse.org"
moz-do-not-send="true">news:gdhrs1$2du$1@build.eclipse.org</a>...</div>
Timothy,<br>
<br>
Comments below.<br>
<br>
Timothy Marc wrote:
<blockquote cite="mid:gdhr0p$v5v$1@build.eclipse.org"
type="cite">
<pre wrap="">Ed,

you were right. It was because of an invalid reference. However, this kind
of reference was allowed by the generated editor. Currently, i'm playing a
little bit with the UML2 codegenerator, in particular the
Union/Subset-mechanism.
</pre>
</blockquote>
Hmmm.&nbsp; It should never allow you to construct an instance that isn't
sound.&nbsp;&nbsp; In fact, the underlying model simply doesn't allow it, which
is why the deserializer is failing.&nbsp; Maybe you just had two objects
with the same ID or something else that the validator could notice if
you invoked it?<br>
<blockquote cite="mid:gdhr0p$v5v$1@build.eclipse.org"
type="cite">
<pre wrap="">Thx
Timothy
"Timothy Marc" <a class="moz-txt-link-rfc2396E"
href="mailto:timothymarc@freenet.de" moz-do-not-send="true">&lt;timothymarc@freenet.de&gt;</a> schrieb im Newsbeitrag
<a class="moz-txt-link-freetext"
href="news:gdhhid$rqj$1@build.eclipse.org" moz-do-not-send="true">news:gdhhid$rqj$1@build.eclipse.org</a>...
</pre>
<blockquote type="cite">
<pre wrap="">Hey all,

i've a problem when i try to load a resource programmatically. I think,
this is because of a missconfiguration of ResourceFactories, but i didn't
get it work.

The genmodel settings uses the None as Resource Type. That works fine. But
when i try to load my model programmatically via the following snippet:

final ResourceSet resourceSet = new ResourceSetImpl();
final Resource r = resourceSet.getResource(uri,true);
final TestingModel model = (TestingModel)r.getContents().get(0);

it fails with the following exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException:
org.eclipse.emf.ecore.xmi.IllegalValueException: Value
'testing.impl.PackageImpl@1325aef (id: null, description: null, name:
pack)' is not legal.
(<a class="moz-txt-link-freetext"
href=" file:/D:/workspaces/esaWorkspace/testing.victoria/My.testing "
moz-do-not-send="true"> file:/D:/workspaces/esaWorkspace/testing.victoria/My.testing </a>, -1, -1)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:316)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:275)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:398)
at unit.UMLismTesting.test(UMLismTesting.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.junit.internal.runners.TestMethodRunner.executeMethodBod y(TestMethodRunner.java:99)
at
org.junit.internal.runners.TestMethodRunner.runUnprotected(T estMethodRunner.java:81)
at
org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAfterRunner.java:34)
at
org.junit.internal.runners.TestMethodRunner.runMethod(TestMe thodRunner.java:75)
at
org.junit.internal.runners.TestMethodRunner.run(TestMethodRu nner.java:45)
at
org.junit.internal.runners.TestClassMethodsRunner.invokeTest Method(TestClassMethodsRunner.java:66)
at
org.junit.internal.runners.TestClassMethodsRunner.run(TestCl assMethodsRunner.java:35)
at
org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunner.java:42)
at
org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestClassRunner.run(TestClassRunn er.java:52)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.r un(JUnit4TestReference.java:38)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
at
org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunne r.main(RemotePluginTestRunner.java:58)
at
org.eclipse.pde.internal.junit.runtime.CoreTestApplication.r un(CoreTestApplication.java:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.eclipse.equinox.internal.app.EclipseAppContainer.callMet hod(EclipseAppContainer.java:572)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:171)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value
'testing.impl.PackageImpl@1325aef (id: null, description: null, name:
pack)' is not legal.
(<a class="moz-txt-link-freetext"
href=" file:/D:/workspaces/esaWorkspace/testing.victoria/My.testing "
moz-do-not-send="true"> file:/D:/workspaces/esaWorkspace/testing.victoria/My.testing </a>, -1, -1)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2535)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHandler.java:1098)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:1179)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:179)
at
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1354)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1155)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:256)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:271)
.... 41 more
Caused by: java.lang.UnsupportedOperationException
at
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(DerivedEObjectEList.java:278)
at java.util.AbstractSequentialList.add(Unknown Source)
at
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObjectEList.java:660)
at
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:1179)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2530)
.... 57 more


Can anyone help me? I think this is just a configuration issue, isnt' it?

Thx
Timothy

</pre>
</blockquote>
<pre wrap=""><!---->

</pre>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</body>
</html>

--------------020602040301090903040609--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Loading a Resource fails [message #477877 is a reply to message #477851] Thu, 23 October 2008 17:07 Go to previous messageGo to next message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.

------=_NextPart_000_00D1_01C93510.40C8A550
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I would not expect to see a subset/superset list used in this case, =
because the only subsets are subsets of derived unions which, by =
definition, are derived and read-only, which means they are computed on =
the fly. The subset/superset lists are only used for subset and superset =
properties which aren't read-only, i.e., where modifiying one list =
requires dynamically updating the other list. In the case of derived =
unions, a new list is returned each time you ask for the value of that =
feature, and it essentially provides a view onto the subset lists =
(which, as in this case, may just be "normal" EMF lists...).

Kenn=20
"Ed Merks" <Ed.Merks@gmail.com> wrote in message =
news:gdiagl$m5s$3@build.eclipse.org...
Timothy,

These are really questions to direct to the UML2 newsgroup because I =
just can't answer them from an EMF perspective. I'm not sure there is =
any way in the IDE, given just an Ecore model, to create an instance of =
UML's GenModel...


Timothy Marc wrote:=20
But it is really strange, because obviously, the =
DerivedUnionEObjectList-Type is used... so, why is this Liste-Type used, =
but not the SubsetSuperset-one?
"Timothy Marc" <timothymarc@freenet.de> schrieb im Newsbeitrag =
news:gdi15h$9re$1@build.eclipse.org...
Okay, and how can i use it explicitly. I didn't found any tutorial =
for it. Do you know some?
"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag =
news:gdi10t$5nk$1@build.eclipse.org...
Timothy,

In order to generate the right things, you really have to be =
using UML's extended GenModel, which you'll only get if you specify your =
model using UML2 and import it. So it's not sufficient just to have an =
Ecore model with annotations just like the ones UML produces, you have =
to be using UML's extended GenModel for those annotations to be =
recognized...


Timothy Marc wrote:=20
Ed,

i've tried it with a reall simple model. It consists only of =
the following elements:

ModelElement
+owner:ModelElement (union)
+ownedElement:ModelElement (union)

A : ModelElement
+theB :B (subsets +ownedElemend) -containment

B : ModelElement
+theA:A (subsets +owner)

and the Editor allows, to construct things like=20

A
+ B

But the access fails with the message, that B is not a legal =
value.

It is wierd, because i thought, that the generator should made =
use of the UML2-specific SupersetSubsetEList-Type, for the subsetting =
properties (annotated as subsets), as it made use of the =
DerivedUnionEList-Type for the EReferences, annotated as Unions. But =
instead of, it uses the simple Ecore-List-Type.

After your last post, i've tried a lot with these annotations =
ans the code generation for UML2. I'm confused right now, because I'm =
pretty sure, that, in a former approach, the code generator exactly has =
used this UML2-specific types. But now, everytime i regenerate this =
simple model, it uses only the EMF-specific one...

I'm a bit frustrated currently, because i didn't get forward =
with this problem...

Timothy
"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag =
news:gdhrs1$2du$1@build.eclipse.org...
Timothy,

Comments below.

Timothy Marc wrote:=20
Ed,

you were right. It was because of an invalid reference. However, this =
kind=20
of reference was allowed by the generated editor. Currently, i'm playing =
a=20
little bit with the UML2 codegenerator, in particular the=20
Union/Subset-mechanism.
Hmmm. It should never allow you to construct an instance that isn't =
sound. In fact, the underlying model simply doesn't allow it, which is =
why the deserializer is failing. Maybe you just had two objects with =
the same ID or something else that the validator could notice if you =
invoked it?

Thx
Timothy
"Timothy Marc" <timothymarc@freenet.de> schrieb im Newsbeitrag=20
news:gdhhid$rqj$1@build.eclipse.org...
Hey all,

i've a problem when i try to load a resource programmatically. I think,=20
this is because of a missconfiguration of ResourceFactories, but i =
didn't=20
get it work.

The genmodel settings uses the None as Resource Type. That works fine. =
But=20
when i try to load my model programmatically via the following snippet:

final ResourceSet resourceSet =3D new ResourceSetImpl();
final Resource r =3D resourceSet.getResource(uri,true);
final TestingModel model =3D (TestingModel)r.getContents().get(0);

it fails with the following exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedExc=
eption:=20
org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'testing.impl.PackageImpl@1325aef (id: null, description: null, name:=20
pack)' is not legal.=20
(file:/D:/workspaces/esaWorkspace/testing.victoria/My.testin g, -1, -1)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadExcep=
tion(ResourceSetImpl.java:316)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:275)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceS=
etImpl.java:398)
at unit.UMLismTesting.test(UMLismTesting.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at=20
org.junit.internal.runners.TestMethodRunner.executeMethodBod y(TestMethodR=
unner.java:99)
at=20
org.junit.internal.runners.TestMethodRunner.runUnprotected(T estMethodRunn=
er.java:81)
at=20
org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAft=
erRunner.java:34)
at=20
org.junit.internal.runners.TestMethodRunner.runMethod(TestMe thodRunner.ja=
va:75)
at=20
org.junit.internal.runners.TestMethodRunner.run(TestMethodRu nner.java:45)=

at=20
org.junit.internal.runners.TestClassMethodsRunner.invokeTest Method(TestCl=
assMethodsRunner.java:66)
at=20
org.junit.internal.runners.TestClassMethodsRunner.run(TestCl assMethodsRun=
ner.java:35)
at=20
org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunn=
er.java:42)
at=20
org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAft=
erRunner.java:34)
at =
org.junit.internal.runners.TestClassRunner.run(TestClassRunn er.java:52)
at=20
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.r un(JUnit4Test=
Reference.java:38)
at=20
org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.jav=
a:38)
at=20
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTes=
tRunner.java:460)
at=20
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTes=
tRunner.java:673)
at=20
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunn=
er.java:386)
at=20
org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunne r.main(Remote=
PluginTestRunner.java:58)
at=20
org.eclipse.pde.internal.junit.runtime.CoreTestApplication.r un(CoreTestAp=
plication.java:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at=20
org.eclipse.equinox.internal.app.EclipseAppContainer.callMet hod(EclipseAp=
pContainer.java:572)
at=20
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.ja=
va:171)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplicati=
on(EclipseAppLauncher.java:106)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Eclips=
eAppLauncher.java:76)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:3=
63)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:1=
76)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'testing.impl.PackageImpl@1325aef (id: null, description: null, name:=20
pack)' is not legal.=20
(file:/D:/workspaces/esaWorkspace/testing.victoria/My.testin g, -1, -1)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2535)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHand=
ler.java:1098)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:117=
9)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(=
Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source)
at=20
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:179)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
354)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
155)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSe=
tImpl.java:256)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:271)
.... 41 more
Caused by: java.lang.UnsupportedOperationException
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(=
DerivedEObjectEList.java:278)
at java.util.AbstractSequentialList.add(Unknown Source)
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObject=
EList.java:660)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:=
1179)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2530)
.... 57 more


Can anyone help me? I think this is just a configuration issue, isnt' =
it?

Thx
Timothy

=20


------=_NextPart_000_00D1_01C93510.40C8A550
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-1>
<META content=3D"MSHTML 6.00.6000.16705" name=3DGENERATOR></HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I would not expect to see a =
subset/superset list=20
used in this case, because the only subsets are subsets of derived =
unions which,=20
by definition, are derived and read-only, which means they are computed =
on the=20
fly. The subset/superset lists are only used for subset and superset=20
properties&nbsp;which aren't read-only, i.e., where modifiying one list =
requires=20
dynamically updating the other list. In the case of derived unions, a =
new=20
list&nbsp;is returned each time you ask for the value of that feature, =
and=20
it&nbsp;essentially provides a view onto the subset lists (which, as in =
this=20
case, may just be "normal" EMF lists...).</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Kenn</FONT>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A=20
href=3D"mailto:Ed.Merks@gmail.com">Ed.Merks@gmail.com</A>&gt; wrote in =
message=20
<A=20
=
href=3D"news:gdiagl$m5s$3@build.eclipse.org">news:gdiagl$m5s$3@build.ecli=
pse.org</A>...</DIV>Timothy,<BR><BR>These=20
are really questions to direct to the UML2 newsgroup because I just =
can't=20
answer them from an EMF perspective.&nbsp; I'm not sure there is any =
way in=20
the IDE, given just an Ecore model, to create an instance of UML's=20
GenModel...<BR><BR><BR>Timothy Marc wrote:=20
<BLOCKQUOTE cite=3Dmid:gdi1dj$b0v$1@build.eclipse.org type=3D"cite">
<META content=3D"MSHTML 6.00.2900.5659" name=3DGENERATOR>
<DIV><FONT face=3DArial size=3D2>But it is really strange, because =
obviously,=20
the DerivedUnionEObjectList-Type is used... so, why is this =
Liste-Type used,=20
but not the SubsetSuperset-one?</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Timothy Marc" &lt;<A href=3D"mailto:timothymarc@freenet.de"=20
moz-do-not-send=3D"true">timothymarc@freenet.de</A>&gt; schrieb im =

Newsbeitrag <A href=3D"news:gdi15h$9re$1@build.eclipse.org"=20
=
moz-do-not-send=3D"true">news:gdi15h$9re$1@build.eclipse.org</A>...</DIV>=

<DIV><FONT face=3DArial size=3D2>Okay, and how can i use it =
explicitly. I=20
didn't found any tutorial for it. Do you know some?</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A href=3D"mailto:Ed.Merks@gmail.com"=20
moz-do-not-send=3D"true">Ed.Merks@gmail.com</A>&gt; schrieb im =
Newsbeitrag=20
<A href=3D"news:gdi10t$5nk$1@build.eclipse.org"=20
=
moz-do-not-send=3D"true">news:gdi10t$5nk$1@build.eclipse.org</A>...</DIV>=
Timothy,<BR><BR>In=20
order to generate the right things, you really have to be using =
UML's=20
extended GenModel, which you'll only get if you specify your =
model using=20
UML2 and import it.&nbsp;&nbsp; So it's not sufficient just to =
have an=20
Ecore model with annotations just like the ones UML produces, =
you have=20
to be using UML's extended GenModel for those annotations to be=20
recognized...<BR><BR><BR>Timothy Marc wrote:=20
<BLOCKQUOTE cite=3Dmid:gdi0f1$vn8$1@build.eclipse.org =
type=3D"cite">
<META content=3D"MSHTML 6.00.2900.5659" name=3DGENERATOR>
<STYLE></STYLE>

<DIV><FONT face=3DArial size=3D2>Ed,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>i've tried it with a reall =
simple model.=20
It consists only of the following elements:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>ModelElement</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
+owner:ModelElement=20
(union)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;=20
+ownedElement:ModelElement (union)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>A : ModelElement</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; +theB :B =
(subsets=20
+ownedElemend) -containment</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>B : ModelElement</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; +theA:A =
(subsets=20
+owner)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>and the Editor allows, to =
construct=20
things like </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
A</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;+ =
B</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>But the access fails with the =
message,=20
that B is not a legal value.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>It is wierd, because i =
thought, that the=20
generator should made use of the UML2-specific=20
SupersetSubsetEList-Type, for the subsetting properties =
(annotated as=20
subsets), as it made use of the DerivedUnionEList-Type for the =

EReferences, annotated as Unions. But instead of, it uses the =
simple=20
Ecore-List-Type.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>After your last post, i've =
tried a lot=20
with these annotations ans the code generation for UML2. I'm =
confused=20
right now, because I'm pretty sure, that, in a former =
approach, the=20
code generator exactly has used this UML2-specific types. But =
now,=20
everytime i regenerate this simple model, it uses only the=20
EMF-specific one...</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I'm a bit frustrated =
currently, because i=20
didn't get forward with this problem...</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Timothy</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: =
5px; BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A href=3D"mailto:Ed.Merks@gmail.com"=20
moz-do-not-send=3D"true">Ed.Merks@gmail.com</A>&gt; schrieb =
im=20
Newsbeitrag <A href=3D"news:gdhrs1$2du$1@build.eclipse.org"=20
=
moz-do-not-send=3D"true">news:gdhrs1$2du$1@build.eclipse.org</A>...</DIV>=
Timothy,<BR><BR>Comments=20
below.<BR><BR>Timothy Marc wrote:=20
<BLOCKQUOTE cite=3Dmid:gdhr0p$v5v$1@build.eclipse.org =
type=3D"cite"><PRE wrap=3D"">Ed,

you were right. It was because of an invalid reference. However, this =
kind=20
of reference was allowed by the generated editor. Currently, i'm playing =
a=20
little bit with the UML2 codegenerator, in particular the=20
Union/Subset-mechanism.
</PRE></BLOCKQUOTE>Hmmm.&nbsp; It should never allow you to=20
construct an instance that isn't sound.&nbsp;&nbsp; In fact, =
the=20
underlying model simply doesn't allow it, which is why the=20
deserializer is failing.&nbsp; Maybe you just had two =
objects with=20
the same ID or something else that the validator could =
notice if you=20
invoked it?<BR>
<BLOCKQUOTE cite=3Dmid:gdhr0p$v5v$1@build.eclipse.org =
type=3D"cite"><PRE wrap=3D"">Thx
Timothy
"Timothy Marc" <A class=3Dmoz-txt-link-rfc2396E =
href=3D"mailto:timothymarc@freenet.de" =
moz-do-not-send=3D"true">&lt;timothymarc@freenet.de&gt;</A> schrieb im =
Newsbeitrag=20
<A class=3Dmoz-txt-link-freetext =
href=3D"news:gdhhid$rqj$1@build.eclipse.org" =
moz-do-not-send=3D"true">news:gdhhid$rqj$1@build.eclipse.org</A>...
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Hey all,

i've a problem when i try to load a resource programmatically. I think,=20
this is because of a missconfiguration of ResourceFactories, but i =
didn't=20
get it work.

The genmodel settings uses the None as Resource Type. That works fine. =
But=20
when i try to load my model programmatically via the following snippet:

final ResourceSet resourceSet =3D new ResourceSetImpl();
final Resource r =3D resourceSet.getResource(uri,true);
final TestingModel model =3D (TestingModel)r.getContents().get(0);

it fails with the following exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedExc=
eption:=20
org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'testing.impl.PackageImpl@1325aef (id: null, description: null, name:=20
pack)' is not legal.=20
(<A class=3Dmoz-txt-link-freetext =
href=3D" file:/D:/workspaces/esaWorkspace/testing.victoria/My.testing " =
moz-do-not-send=3D"true">file:/D:/workspaces/esaWorkspace/testing.victori=
a/My.testing</A>, -1, -1)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadExcep=
tion(ResourceSetImpl.java:316)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:275)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceS=
etImpl.java:398)
at unit.UMLismTesting.test(UMLismTesting.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at=20
org.junit.internal.runners.TestMethodRunner.executeMethodBod y(TestMethodR=
unner.java:99)
at=20
org.junit.internal.runners.TestMethodRunner.runUnprotected(T estMethodRunn=
er.java:81)
at=20
org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAft=
erRunner.java:34)
at=20
org.junit.internal.runners.TestMethodRunner.runMethod(TestMe thodRunner.ja=
va:75)
at=20
org.junit.internal.runners.TestMethodRunner.run(TestMethodRu nner.java:45)=

at=20
org.junit.internal.runners.TestClassMethodsRunner.invokeTest Method(TestCl=
assMethodsRunner.java:66)
at=20
org.junit.internal.runners.TestClassMethodsRunner.run(TestCl assMethodsRun=
ner.java:35)
at=20
org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunn=
er.java:42)
at=20
org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAft=
erRunner.java:34)
at =
org.junit.internal.runners.TestClassRunner.run(TestClassRunn er.java:52)
at=20
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.r un(JUnit4Test=
Reference.java:38)
at=20
org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.jav=
a:38)
at=20
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTes=
tRunner.java:460)
at=20
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTes=
tRunner.java:673)
at=20
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunn=
er.java:386)
at=20
org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunne r.main(Remote=
PluginTestRunner.java:58)
at=20
org.eclipse.pde.internal.junit.runtime.CoreTestApplication.r un(CoreTestAp=
plication.java:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at=20
org.eclipse.equinox.internal.app.EclipseAppContainer.callMet hod(EclipseAp=
pContainer.java:572)
at=20
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.ja=
va:171)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplicati=
on(EclipseAppLauncher.java:106)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Eclips=
eAppLauncher.java:76)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:3=
63)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:1=
76)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'testing.impl.PackageImpl@1325aef (id: null, description: null, name:=20
pack)' is not legal.=20
(<A class=3Dmoz-txt-link-freetext =
href=3D" file:/D:/workspaces/esaWorkspace/testing.victoria/My.testing " =
moz-do-not-send=3D"true">file:/D:/workspaces/esaWorkspace/testing.victori=
a/My.testing</A>, -1, -1)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2535)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHand=
ler.java:1098)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:117=
9)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(=
Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source)
at=20
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:179)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
354)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
155)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSe=
tImpl.java:256)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:271)
.... 41 more
Caused by: java.lang.UnsupportedOperationException
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(=
DerivedEObjectEList.java:278)
at java.util.AbstractSequentialList.add(Unknown Source)
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObject=
EList.java:660)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:=
1179)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2530)
.... 57 more


Can anyone help me? I think this is just a configuration issue, isnt' =
it?

Thx
Timothy

</PRE></BLOCKQUOTE><PRE wrap=3D""><!---->

=
</PRE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE ></BLOCKQUOTE></=
BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_00D1_01C93510.40C8A550--
Re: Loading a Resource fails [message #477879 is a reply to message #477877] Fri, 24 October 2008 10:17 Go to previous messageGo to next message
Timothy Marc is currently offline Timothy MarcFriend
Messages: 547
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.

------=_NextPart_000_01E9_01C935D2.88193F10
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Dear Kenn,

thanks, that was a good explanation concerning the list types. You =
helped me a lot with this...

Thx
Timothy
"Kenn Hussey" <Kenn.Hussey@embarcadero.com> schrieb im Newsbeitrag =
news:gdqavr$mgk$1@build.eclipse.org...
I would not expect to see a subset/superset list used in this case, =
because the only subsets are subsets of derived unions which, by =
definition, are derived and read-only, which means they are computed on =
the fly. The subset/superset lists are only used for subset and superset =
properties which aren't read-only, i.e., where modifiying one list =
requires dynamically updating the other list. In the case of derived =
unions, a new list is returned each time you ask for the value of that =
feature, and it essentially provides a view onto the subset lists =
(which, as in this case, may just be "normal" EMF lists...).

Kenn=20
"Ed Merks" <Ed.Merks@gmail.com> wrote in message =
news:gdiagl$m5s$3@build.eclipse.org...
Timothy,

These are really questions to direct to the UML2 newsgroup because I =
just can't answer them from an EMF perspective. I'm not sure there is =
any way in the IDE, given just an Ecore model, to create an instance of =
UML's GenModel...


Timothy Marc wrote:=20
But it is really strange, because obviously, the =
DerivedUnionEObjectList-Type is used... so, why is this Liste-Type used, =
but not the SubsetSuperset-one?
"Timothy Marc" <timothymarc@freenet.de> schrieb im Newsbeitrag =
news:gdi15h$9re$1@build.eclipse.org...
Okay, and how can i use it explicitly. I didn't found any =
tutorial for it. Do you know some?
"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag =
news:gdi10t$5nk$1@build.eclipse.org...
Timothy,

In order to generate the right things, you really have to be =
using UML's extended GenModel, which you'll only get if you specify your =
model using UML2 and import it. So it's not sufficient just to have an =
Ecore model with annotations just like the ones UML produces, you have =
to be using UML's extended GenModel for those annotations to be =
recognized...


Timothy Marc wrote:=20
Ed,

i've tried it with a reall simple model. It consists only of =
the following elements:

ModelElement
+owner:ModelElement (union)
+ownedElement:ModelElement (union)

A : ModelElement
+theB :B (subsets +ownedElemend) -containment

B : ModelElement
+theA:A (subsets +owner)

and the Editor allows, to construct things like=20

A
+ B

But the access fails with the message, that B is not a legal =
value.

It is wierd, because i thought, that the generator should =
made use of the UML2-specific SupersetSubsetEList-Type, for the =
subsetting properties (annotated as subsets), as it made use of the =
DerivedUnionEList-Type for the EReferences, annotated as Unions. But =
instead of, it uses the simple Ecore-List-Type.

After your last post, i've tried a lot with these =
annotations ans the code generation for UML2. I'm confused right now, =
because I'm pretty sure, that, in a former approach, the code generator =
exactly has used this UML2-specific types. But now, everytime i =
regenerate this simple model, it uses only the EMF-specific one...

I'm a bit frustrated currently, because i didn't get forward =
with this problem...

Timothy
"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag =
news:gdhrs1$2du$1@build.eclipse.org...
Timothy,

Comments below.

Timothy Marc wrote:=20
Ed,

you were right. It was because of an invalid reference. However, this =
kind=20
of reference was allowed by the generated editor. Currently, i'm playing =
a=20
little bit with the UML2 codegenerator, in particular the=20
Union/Subset-mechanism.
Hmmm. It should never allow you to construct an instance that isn't =
sound. In fact, the underlying model simply doesn't allow it, which is =
why the deserializer is failing. Maybe you just had two objects with =
the same ID or something else that the validator could notice if you =
invoked it?

Thx
Timothy
"Timothy Marc" <timothymarc@freenet.de> schrieb im Newsbeitrag=20
news:gdhhid$rqj$1@build.eclipse.org...
Hey all,

i've a problem when i try to load a resource programmatically. I think,=20
this is because of a missconfiguration of ResourceFactories, but i =
didn't=20
get it work.

The genmodel settings uses the None as Resource Type. That works fine. =
But=20
when i try to load my model programmatically via the following snippet:

final ResourceSet resourceSet =3D new ResourceSetImpl();
final Resource r =3D resourceSet.getResource(uri,true);
final TestingModel model =3D (TestingModel)r.getContents().get(0);

it fails with the following exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedExc=
eption:=20
org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'testing.impl.PackageImpl@1325aef (id: null, description: null, name:=20
pack)' is not legal.=20
(file:/D:/workspaces/esaWorkspace/testing.victoria/My.testin g, -1, -1)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadExcep=
tion(ResourceSetImpl.java:316)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:275)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceS=
etImpl.java:398)
at unit.UMLismTesting.test(UMLismTesting.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at=20
org.junit.internal.runners.TestMethodRunner.executeMethodBod y(TestMethodR=
unner.java:99)
at=20
org.junit.internal.runners.TestMethodRunner.runUnprotected(T estMethodRunn=
er.java:81)
at=20
org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAft=
erRunner.java:34)
at=20
org.junit.internal.runners.TestMethodRunner.runMethod(TestMe thodRunner.ja=
va:75)
at=20
org.junit.internal.runners.TestMethodRunner.run(TestMethodRu nner.java:45)=

at=20
org.junit.internal.runners.TestClassMethodsRunner.invokeTest Method(TestCl=
assMethodsRunner.java:66)
at=20
org.junit.internal.runners.TestClassMethodsRunner.run(TestCl assMethodsRun=
ner.java:35)
at=20
org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunn=
er.java:42)
at=20
org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAft=
erRunner.java:34)
at =
org.junit.internal.runners.TestClassRunner.run(TestClassRunn er.java:52)
at=20
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.r un(JUnit4Test=
Reference.java:38)
at=20
org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.jav=
a:38)
at=20
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTes=
tRunner.java:460)
at=20
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTes=
tRunner.java:673)
at=20
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunn=
er.java:386)
at=20
org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunne r.main(Remote=
PluginTestRunner.java:58)
at=20
org.eclipse.pde.internal.junit.runtime.CoreTestApplication.r un(CoreTestAp=
plication.java:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at=20
org.eclipse.equinox.internal.app.EclipseAppContainer.callMet hod(EclipseAp=
pContainer.java:572)
at=20
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.ja=
va:171)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplicati=
on(EclipseAppLauncher.java:106)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Eclips=
eAppLauncher.java:76)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:3=
63)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:1=
76)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'testing.impl.PackageImpl@1325aef (id: null, description: null, name:=20
pack)' is not legal.=20
(file:/D:/workspaces/esaWorkspace/testing.victoria/My.testin g, -1, -1)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2535)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHand=
ler.java:1098)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:117=
9)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(=
Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source)
at=20
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:179)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
354)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
155)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSe=
tImpl.java:256)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:271)
.... 41 more
Caused by: java.lang.UnsupportedOperationException
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(=
DerivedEObjectEList.java:278)
at java.util.AbstractSequentialList.add(Unknown Source)
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObject=
EList.java:660)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:=
1179)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2530)
.... 57 more


Can anyone help me? I think this is just a configuration issue, isnt' =
it?

Thx
Timothy

=20


------=_NextPart_000_01E9_01C935D2.88193F10
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-1>
<META content=3D"MSHTML 6.00.2900.5659" name=3DGENERATOR></HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Dear Kenn,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>thanks, that was a good explanation =
concerning the=20
list types. You helped me a lot with this...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thx</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Timothy</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Kenn Hussey" &lt;<A=20
=
href=3D"mailto:Kenn.Hussey@embarcadero.com">Kenn.Hussey@embarcadero.com</=
A>&gt;=20
schrieb im Newsbeitrag <A=20
=
href=3D"news:gdqavr$mgk$1@build.eclipse.org">news:gdqavr$mgk$1@build.ecli=
pse.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>I would not expect to see a =
subset/superset list=20
used in this case, because the only subsets are subsets of derived =
unions=20
which, by definition, are derived and read-only, which means they are =
computed=20
on the fly. The subset/superset lists are only used for subset and =
superset=20
properties&nbsp;which aren't read-only, i.e., where modifiying one =
list=20
requires dynamically updating the other list. In the case of derived =
unions, a=20
new list&nbsp;is returned each time you ask for the value of that =
feature, and=20
it&nbsp;essentially provides a view onto the subset lists (which, as =
in this=20
case, may just be "normal" EMF lists...).</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Kenn</FONT>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A=20
href=3D"mailto:Ed.Merks@gmail.com">Ed.Merks@gmail.com</A>&gt; wrote =
in message=20
<A=20
=
href=3D"news:gdiagl$m5s$3@build.eclipse.org">news:gdiagl$m5s$3@build.ecli=
pse.org</A>...</DIV>Timothy,<BR><BR>These=20
are really questions to direct to the UML2 newsgroup because I just =
can't=20
answer them from an EMF perspective.&nbsp; I'm not sure there is any =
way in=20
the IDE, given just an Ecore model, to create an instance of UML's=20
GenModel...<BR><BR><BR>Timothy Marc wrote:=20
<BLOCKQUOTE cite=3Dmid:gdi1dj$b0v$1@build.eclipse.org type=3D"cite">
<META content=3D"MSHTML 6.00.2900.5659" name=3DGENERATOR>
<DIV><FONT face=3DArial size=3D2>But it is really strange, because =
obviously,=20
the DerivedUnionEObjectList-Type is used... so, why is this =
Liste-Type=20
used, but not the SubsetSuperset-one?</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Timothy Marc" &lt;<A =
href=3D"mailto:timothymarc@freenet.de"=20
moz-do-not-send=3D"true">timothymarc@freenet.de</A>&gt; schrieb =
im=20
Newsbeitrag <A href=3D"news:gdi15h$9re$1@build.eclipse.org"=20
=
moz-do-not-send=3D"true">news:gdi15h$9re$1@build.eclipse.org</A>...</DIV>=

<DIV><FONT face=3DArial size=3D2>Okay, and how can i use it =
explicitly. I=20
didn't found any tutorial for it. Do you know some?</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: =
5px; BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A href=3D"mailto:Ed.Merks@gmail.com"=20
moz-do-not-send=3D"true">Ed.Merks@gmail.com</A>&gt; schrieb im =

Newsbeitrag <A href=3D"news:gdi10t$5nk$1@build.eclipse.org"=20
=
moz-do-not-send=3D"true">news:gdi10t$5nk$1@build.eclipse.org</A>...</DIV>=
Timothy,<BR><BR>In=20
order to generate the right things, you really have to be =
using UML's=20
extended GenModel, which you'll only get if you specify your =
model=20
using UML2 and import it.&nbsp;&nbsp; So it's not sufficient =
just to=20
have an Ecore model with annotations just like the ones UML =
produces,=20
you have to be using UML's extended GenModel for those =
annotations to=20
be recognized...<BR><BR><BR>Timothy Marc wrote:=20
<BLOCKQUOTE cite=3Dmid:gdi0f1$vn8$1@build.eclipse.org =
type=3D"cite">
<META content=3D"MSHTML 6.00.2900.5659" name=3DGENERATOR>
<STYLE></STYLE>

<DIV><FONT face=3DArial size=3D2>Ed,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>i've tried it with a reall =
simple=20
model. It consists only of the following =
elements:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>ModelElement</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
+owner:ModelElement=20
(union)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;=20
+ownedElement:ModelElement (union)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>A : =
ModelElement</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; +theB :B =
(subsets=20
+ownedElemend) -containment</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>B : =
ModelElement</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; +theA:A =
(subsets=20
+owner)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>and the Editor allows, to =
construct=20
things like </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
A</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;+=20
B</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>But the access fails with =
the message,=20
that B is not a legal value.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>It is wierd, because i =
thought, that=20
the generator should made use of the UML2-specific=20
SupersetSubsetEList-Type, for the subsetting properties =
(annotated=20
as subsets), as it made use of the DerivedUnionEList-Type =
for the=20
EReferences, annotated as Unions. But instead of, it uses =
the simple=20
Ecore-List-Type.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>After your last post, i've =
tried a lot=20
with these annotations ans the code generation for UML2. I'm =

confused right now, because I'm pretty sure, that, in a =
former=20
approach, the code generator exactly has used this =
UML2-specific=20
types. But now, everytime i regenerate this simple model, it =
uses=20
only the EMF-specific one...</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I'm a bit frustrated =
currently, because=20
i didn't get forward with this problem...</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Timothy</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: =
5px; BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A href=3D"mailto:Ed.Merks@gmail.com"=20
moz-do-not-send=3D"true">Ed.Merks@gmail.com</A>&gt; =
schrieb im=20
Newsbeitrag <A =
href=3D"news:gdhrs1$2du$1@build.eclipse.org"=20
=
moz-do-not-send=3D"true">news:gdhrs1$2du$1@build.eclipse.org</A>...</DIV>=
Timothy,<BR><BR>Comments=20
below.<BR><BR>Timothy Marc wrote:=20
<BLOCKQUOTE cite=3Dmid:gdhr0p$v5v$1@build.eclipse.org =
type=3D"cite"><PRE wrap=3D"">Ed,

you were right. It was because of an invalid reference. However, this =
kind=20
of reference was allowed by the generated editor. Currently, i'm playing =
a=20
little bit with the UML2 codegenerator, in particular the=20
Union/Subset-mechanism.
</PRE></BLOCKQUOTE>Hmmm.&nbsp; It should never allow you to=20
construct an instance that isn't sound.&nbsp;&nbsp; In =
fact, the=20
underlying model simply doesn't allow it, which is why the =

deserializer is failing.&nbsp; Maybe you just had two =
objects with=20
the same ID or something else that the validator could =
notice if=20
you invoked it?<BR>
<BLOCKQUOTE cite=3Dmid:gdhr0p$v5v$1@build.eclipse.org =
type=3D"cite"><PRE wrap=3D"">Thx
Timothy
"Timothy Marc" <A class=3Dmoz-txt-link-rfc2396E =
href=3D"mailto:timothymarc@freenet.de" =
moz-do-not-send=3D"true">&lt;timothymarc@freenet.de&gt;</A> schrieb im =
Newsbeitrag=20
<A class=3Dmoz-txt-link-freetext =
href=3D"news:gdhhid$rqj$1@build.eclipse.org" =
moz-do-not-send=3D"true">news:gdhhid$rqj$1@build.eclipse.org</A>...
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Hey all,

i've a problem when i try to load a resource programmatically. I think,=20
this is because of a missconfiguration of ResourceFactories, but i =
didn't=20
get it work.

The genmodel settings uses the None as Resource Type. That works fine. =
But=20
when i try to load my model programmatically via the following snippet:

final ResourceSet resourceSet =3D new ResourceSetImpl();
final Resource r =3D resourceSet.getResource(uri,true);
final TestingModel model =3D (TestingModel)r.getContents().get(0);

it fails with the following exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedExc=
eption:=20
org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'testing.impl.PackageImpl@1325aef (id: null, description: null, name:=20
pack)' is not legal.=20
(<A class=3Dmoz-txt-link-freetext =
href=3D" file:/D:/workspaces/esaWorkspace/testing.victoria/My.testing " =
moz-do-not-send=3D"true">file:/D:/workspaces/esaWorkspace/testing.victori=
a/My.testing</A>, -1, -1)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadExcep=
tion(ResourceSetImpl.java:316)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:275)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceS=
etImpl.java:398)
at unit.UMLismTesting.test(UMLismTesting.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at=20
org.junit.internal.runners.TestMethodRunner.executeMethodBod y(TestMethodR=
unner.java:99)
at=20
org.junit.internal.runners.TestMethodRunner.runUnprotected(T estMethodRunn=
er.java:81)
at=20
org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAft=
erRunner.java:34)
at=20
org.junit.internal.runners.TestMethodRunner.runMethod(TestMe thodRunner.ja=
va:75)
at=20
org.junit.internal.runners.TestMethodRunner.run(TestMethodRu nner.java:45)=

at=20
org.junit.internal.runners.TestClassMethodsRunner.invokeTest Method(TestCl=
assMethodsRunner.java:66)
at=20
org.junit.internal.runners.TestClassMethodsRunner.run(TestCl assMethodsRun=
ner.java:35)
at=20
org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunn=
er.java:42)
at=20
org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAft=
erRunner.java:34)
at =
org.junit.internal.runners.TestClassRunner.run(TestClassRunn er.java:52)
at=20
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.r un(JUnit4Test=
Reference.java:38)
at=20
org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.jav=
a:38)
at=20
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTes=
tRunner.java:460)
at=20
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTes=
tRunner.java:673)
at=20
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunn=
er.java:386)
at=20
org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunne r.main(Remote=
PluginTestRunner.java:58)
at=20
org.eclipse.pde.internal.junit.runtime.CoreTestApplication.r un(CoreTestAp=
plication.java:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at=20
org.eclipse.equinox.internal.app.EclipseAppContainer.callMet hod(EclipseAp=
pContainer.java:572)
at=20
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.ja=
va:171)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplicati=
on(EclipseAppLauncher.java:106)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Eclips=
eAppLauncher.java:76)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:3=
63)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:1=
76)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'testing.impl.PackageImpl@1325aef (id: null, description: null, name:=20
pack)' is not legal.=20
(<A class=3Dmoz-txt-link-freetext =
href=3D" file:/D:/workspaces/esaWorkspace/testing.victoria/My.testing " =
moz-do-not-send=3D"true">file:/D:/workspaces/esaWorkspace/testing.victori=
a/My.testing</A>, -1, -1)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2535)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHand=
ler.java:1098)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:117=
9)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(=
Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source)
at=20
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:179)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
354)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
155)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSe=
tImpl.java:256)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:271)
.... 41 more
Caused by: java.lang.UnsupportedOperationException
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(=
DerivedEObjectEList.java:278)
at java.util.AbstractSequentialList.add(Unknown Source)
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObject=
EList.java:660)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:=
1179)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2530)
.... 57 more


Can anyone help me? I think this is just a configuration issue, isnt' =
it?

Thx
Timothy

</PRE></BLOCKQUOTE><PRE wrap=3D""><!---->

=
</PRE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE ></BLOCKQUOTE></=
BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_01E9_01C935D2.88193F10--
Re: Loading a Resource fails [message #478145 is a reply to message #477879] Wed, 28 January 2009 17:24 Go to previous messageGo to next message
Hossam Karim is currently offline Hossam KarimFriend
Messages: 26
Registered: July 2009
Junior Member
This is a multi-part message in MIME format.
--------------070806030006080000070504
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi everyone,
I am having a similar problem although the subsetted properties are
derived union. I am attaching the source UML model and the generated
ecore and genmodel. I am able to use the editor to save but when loading
the saved model I am getting the attached exception. I am using Eclipse
3.5M4.


Timothy Marc wrote:
> Dear Kenn,
>
> thanks, that was a good explanation concerning the list types. You
> helped me a lot with this...
>
> Thx
> Timothy
>
> "Kenn Hussey" <Kenn.Hussey@embarcadero.com
> <mailto:Kenn.Hussey@embarcadero.com>> schrieb im Newsbeitrag
> news:gdqavr$mgk$1@build.eclipse.org...
> I would not expect to see a subset/superset list used in this case,
> because the only subsets are subsets of derived unions which, by
> definition, are derived and read-only, which means they are computed
> on the fly. The subset/superset lists are only used for subset and
> superset properties which aren't read-only, i.e., where modifiying
> one list requires dynamically updating the other list. In the case
> of derived unions, a new list is returned each time you ask for the
> value of that feature, and it essentially provides a view onto the
> subset lists (which, as in this case, may just be "normal" EMF
> lists...).
>
> Kenn
>
> "Ed Merks" <Ed.Merks@gmail.com <mailto:Ed.Merks@gmail.com>>
> wrote in message news:gdiagl$m5s$3@build.eclipse.org...
> Timothy,
>
> These are really questions to direct to the UML2 newsgroup
> because I just can't answer them from an EMF perspective. I'm
> not sure there is any way in the IDE, given just an Ecore model,
> to create an instance of UML's GenModel...
>
>
> Timothy Marc wrote:
>> But it is really strange, because obviously, the
>> DerivedUnionEObjectList-Type is used... so, why is this
>> Liste-Type used, but not the SubsetSuperset-one?
>>
>> "Timothy Marc" <timothymarc@freenet.de
>> <mailto:timothymarc@freenet.de>> schrieb im Newsbeitrag
>> news:gdi15h$9re$1@build.eclipse.org...
>> Okay, and how can i use it explicitly. I didn't found any
>> tutorial for it. Do you know some?
>>
>> "Ed Merks" <Ed.Merks@gmail.com
>> <mailto:Ed.Merks@gmail.com>> schrieb im Newsbeitrag
>> news:gdi10t$5nk$1@build.eclipse.org...
>> Timothy,
>>
>> In order to generate the right things, you really have
>> to be using UML's extended GenModel, which you'll only
>> get if you specify your model using UML2 and import
>> it. So it's not sufficient just to have an Ecore
>> model with annotations just like the ones UML
>> produces, you have to be using UML's extended GenModel
>> for those annotations to be recognized...
>>
>>
>> Timothy Marc wrote:
>>> Ed,
>>>
>>> i've tried it with a reall simple model. It consists
>>> only of the following elements:
>>>
>>> ModelElement
>>> +owner:ModelElement (union)
>>> +ownedElement:ModelElement (union)
>>>
>>> A : ModelElement
>>> +theB :B (subsets +ownedElemend) -containment
>>>
>>> B : ModelElement
>>> +theA:A (subsets +owner)
>>>
>>> and the Editor allows, to construct things like
>>>
>>> A
>>> + B
>>>
>>> But the access fails with the message, that B is not
>>> a legal value.
>>>
>>> It is wierd, because i thought, that the generator
>>> should made use of the UML2-specific
>>> SupersetSubsetEList-Type, for the subsetting
>>> properties (annotated as subsets), as it made use of
>>> the DerivedUnionEList-Type for the EReferences,
>>> annotated as Unions. But instead of, it uses the
>>> simple Ecore-List-Type.
>>>
>>> After your last post, i've tried a lot with these
>>> annotations ans the code generation for UML2. I'm
>>> confused right now, because I'm pretty sure, that, in
>>> a former approach, the code generator exactly has
>>> used this UML2-specific types. But now, everytime i
>>> regenerate this simple model, it uses only the
>>> EMF-specific one...
>>>
>>> I'm a bit frustrated currently, because i didn't get
>>> forward with this problem...
>>>
>>> Timothy
>>>
>>> "Ed Merks" <Ed.Merks@gmail.com
>>> <mailto:Ed.Merks@gmail.com>> schrieb im
>>> Newsbeitrag news:gdhrs1$2du$1@build.eclipse.org...
>>> Timothy,
>>>
>>> Comments below.
>>>
>>> Timothy Marc wrote:
>>>> Ed,
>>>>
>>>> you were right. It was because of an invalid reference. However, this kind
>>>> of reference was allowed by the generated editor. Currently, i'm playing a
>>>> little bit with the UML2 codegenerator, in particular the
>>>> Union/Subset-mechanism.
>>>>
>>> Hmmm. It should never allow you to construct an
>>> instance that isn't sound. In fact, the
>>> underlying model simply doesn't allow it, which
>>> is why the deserializer is failing. Maybe you
>>> just had two objects with the same ID or
>>> something else that the validator could notice if
>>> you invoked it?
>>>> Thx
>>>> Timothy
>>>> "Timothy Marc" <timothymarc@freenet.de> schrieb im Newsbeitrag
>>>> news:gdhhid$rqj$1@build.eclipse.org...
>>>>
>>>>> Hey all,
>>>>>
>>>>> i've a problem when i try to load a resource programmatically. I think,
>>>>> this is because of a missconfiguration of ResourceFactories, but i didn't
>>>>> get it work.
>>>>>
>>>>> The genmodel settings uses the None as Resource Type. That works fine. But
>>>>> when i try to load my model programmatically via the following snippet:
>>>>>
>>>>> final ResourceSet resourceSet = new ResourceSetImpl();
>>>>> final Resource r = resourceSet.getResource(uri,true);
>>>>> final TestingModel model = (TestingModel)r.getContents().get(0);
>>>>>
>>>>> it fails with the following exception:
>>>>>
>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException:
>>>>> org.eclipse.emf.ecore.xmi.IllegalValueException: Value
>>>>> 'testing.impl.PackageImpl@1325aef (id: null, description: null, name:
>>>>> pack)' is not legal.
>>>>> (file:/D:/workspaces/esaWorkspace/testing.victoria/My.testin g, -1, -1)
>>>>> at
>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:316)
>>>>> at
>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:275)
>>>>> at
>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:398)
>>>>> at unit.UMLismTesting.test(UMLismTesting.java:28)
>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>>>> at java.lang.reflect.Method.invoke(Unknown Source)
>>>>> at
>>>>> org.junit.internal.runners.TestMethodRunner.executeMethodBod y(TestMethodRunner.java:99)
>>>>> at
>>>>> org.junit.internal.runners.TestMethodRunner.runUnprotected(T estMethodRunner.java:81)
>>>>> at
>>>>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAfterRunner.java:34)
>>>>> at
>>>>> org.junit.internal.runners.TestMethodRunner.runMethod(TestMe thodRunner.java:75)
>>>>> at
>>>>> org.junit.internal.runners.TestMethodRunner.run(TestMethodRu nner.java:45)
>>>>> at
>>>>> org.junit.internal.runners.TestClassMethodsRunner.invokeTest Method(TestClassMethodsRunner.java:66)
>>>>> at
>>>>> org.junit.internal.runners.TestClassMethodsRunner.run(TestCl assMethodsRunner.java:35)
>>>>> at
>>>>> org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunner.java:42)
>>>>> at
>>>>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAfterRunner.java:34)
>>>>> at org.junit.internal.runners.TestClassRunner.run(TestClassRunn er.java:52)
>>>>> at
>>>>> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.r un(JUnit4TestReference.java:38)
>>>>> at
>>>>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
>>>>> at
>>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)
>>>>> at
>>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
>>>>> at
>>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
>>>>> at
>>>>> org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunne r.main(RemotePluginTestRunner.java:58)
>>>>> at
>>>>> org.eclipse.pde.internal.junit.runtime.CoreTestApplication.r un(CoreTestApplication.java:24)
>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>>>> at java.lang.reflect.Method.invoke(Unknown Source)
>>>>> at
>>>>> org.eclipse.equinox.internal.app.EclipseAppContainer.callMet hod(EclipseAppContainer.java:572)
>>>>> at
>>>>> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:171)
>>>>> at
>>>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
>>>>> at
>>>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
>>>>> at
>>>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
>>>>> at
>>>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>>>> at java.lang.reflect.Method.invoke(Unknown Source)
>>>>> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
>>>>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
>>>>> at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
>>>>> at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
>>>>> Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value
>>>>> 'testing.impl.PackageImpl@1325aef (id: null, description: null, name:
>>>>> pack)' is not legal.
>>>>> (file:/D:/workspaces/esaWorkspace/testing.victoria/My.testin g, -1, -1)
>>>>> at
>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2535)
>>>>> at
>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHandler.java:1098)
>>>>> at
>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:1179)
>>>>> at
>>>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(Unknown
>>>>> Source)
>>>>> at
>>>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
>>>>> Source)
>>>>> at
>>>>> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
>>>>> Source)
>>>>> at
>>>>> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
>>>>> Source)
>>>>> at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
>>>>> Source)
>>>>> at
>>>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
>>>>> Source)
>>>>> at
>>>>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
>>>>> Source)
>>>>> at javax.xml.parsers.SAXParser.parse(Unknown Source)
>>>>> at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:179)
>>>>> at
>>>>> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
>>>>> at
>>>>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1354)
>>>>> at
>>>>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1155)
>>>>> at
>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:256)
>>>>> at
>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:271)
>>>>> ... 41 more
>>>>> Caused by: java.lang.UnsupportedOperationException
>>>>> at
>>>>> org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(DerivedEObjectEList.java:278)
>>>>> at java.util.AbstractSequentialList.add(Unknown Source)
>>>>> at
>>>>> org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObjectEList.java:660)
>>>>> at
>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:1179)
>>>>> at
>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2530)
>>>>> ... 57 more
>>>>>
>>>>>
>>>>> Can anyone help me? I think this is just a configuration issue, isnt' it?
>>>>>
>>>>> Thx
>>>>> Timothy
>>>>>
>>>>>
>>>>
>>>>
>>>>


--------------070806030006080000070504
Content-Type: application/octet-stream;
name="jdsl.zip"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="jdsl.zip"

UEsDBBQAAAAIAIiKPDp1E107rwQAAKEdAAANAAAAamRzbC5nZW5tb2RlbNVZ XW/iOBR9H2n+
Q5R9HtzpSqsVKh1lQuhmFgIiodq3KCQG3HFsZBta9tfvdRJTMoUu0ELbqkIk vh/H9x6fOObq
20NOrSUWknDWsr82LmwLs5RnhE1b9ijqfPnT/nb9+dPVFLOcZ5g2bzDr6S/W Q06aa8dLcPz8
yYI/iMdkEwZb9kypeROh+/v7Bs+nDS6m6J+ebxsTWTe5/72wuLy4+Apm3TCd 4Tz5QphUCUtx
LTpOucA1Z5xSMpe4iIDziY5yiTxtZtKZCex0W+T0El02YCbIzNG2Cpc2EThV XKxaNgLLhpoR
9jPHKmlkkiIp0gpcYTygiylhfrtlPzGtwgVJDuB/FDcESWcuJZipAU3UhIu8 ZSuxANQkn3Oh
sDCRDFQNU380iiI0jFkFIeX5nBJdsC5e6sn+oTua8vlKkOlMdQimmWzZk4RK bF9rH91ZhzGu
EgWdlJbkC5HuUVxTI2QQoH1QXpcwrzIoCaHS+omhqJ7bH3px5NzceO341umO vNC2lgldAIzB
sO96YWijrZ6jwO8HMdgMvGHk7+3WHg26vutEXtzxnGg03NsxHH0PvSjyg5vD k7r9Xs8LoqMx
xn7wlzf0Iydwv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ijw6dRNdO68E
AAChHQAADQAAAAAAAAABACAAAAAAAAAAamRzbC5nZW5tb2RlbFBLAQIUABQA AAAIAHaKPDrG
NdVKUAcAADg+AAAIAAAAAAAAAAEAIAAAANoEAABqZHNsLnVtbFBLAQIUABQA AAAIAISKPDqD
e42M5AMAAHAcAAAKAAAAAAAAAAEAIAAAAFAMAABqZHNsLmVjb3JlUEsBAhQA FAAAAAgAYJY8
OjOpalTVAAAAWgEAAAcAAAAAAAAAAQAgAAAAXBAAAG0xLmpkc2xQSwECFAAU AAAACADbmjw6
14auX98CAADLCgAADQAAAAAAAAABACAAAABWEQAAZXhjZXB0aW9uLnR4dFBL BQYAAAAABQAF
ABkBAABgFAAAAAA=
--------------070806030006080000070504--
Re: [RESOLVED] Loading a Resource fails [message #478147 is a reply to message #478145] Thu, 29 January 2009 21:13 Go to previous message
Hossam Karim is currently offline Hossam KarimFriend
Messages: 26
Registered: July 2009
Junior Member
Just in case someone faced the same problem, marking the superset
properties as transient will solve this problem.

Hossam Karim


On Wed, 28 Jan 2009 19:24:14 +0200, Hossam Karim <hossam.karim@gmail.com>
wrote:

> Hi everyone,
> I am having a similar problem although the subsetted properties are
> derived union. I am attaching the source UML model and the generated
> ecore and genmodel. I am able to use the editor to save but when loading
> the saved model I am getting the attached exception. I am using Eclipse
> 3.5M4.
>
>
> Timothy Marc wrote:
>> Dear Kenn,
>>
>> thanks, that was a good explanation concerning the list types. You
>> helped me a lot with this...
>>
>> Thx
>> Timothy
>>
>> "Kenn Hussey" <Kenn.Hussey@embarcadero.com
>> <mailto:Kenn.Hussey@embarcadero.com>> schrieb im Newsbeitrag
>> news:gdqavr$mgk$1@build.eclipse.org...
>> I would not expect to see a subset/superset list used in this case,
>> because the only subsets are subsets of derived unions which, by
>> definition, are derived and read-only, which means they are computed
>> on the fly. The subset/superset lists are only used for subset and
>> superset properties which aren't read-only, i.e., where modifiying
>> one list requires dynamically updating the other list. In the case
>> of derived unions, a new list is returned each time you ask for the
>> value of that feature, and it essentially provides a view onto the
>> subset lists (which, as in this case, may just be "normal" EMF
>> lists...).
>>
>> Kenn
>>
>> "Ed Merks" <Ed.Merks@gmail.com <mailto:Ed.Merks@gmail.com>>
>> wrote in message news:gdiagl$m5s$3@build.eclipse.org...
>> Timothy,
>>
>> These are really questions to direct to the UML2 newsgroup
>> because I just can't answer them from an EMF perspective. I'm
>> not sure there is any way in the IDE, given just an Ecore model,
>> to create an instance of UML's GenModel...
>>
>>
>> Timothy Marc wrote:
>>> But it is really strange, because obviously, the
>>> DerivedUnionEObjectList-Type is used... so, why is this
>>> Liste-Type used, but not the SubsetSuperset-one?
>>>
>>> "Timothy Marc" <timothymarc@freenet.de
>>> <mailto:timothymarc@freenet.de>> schrieb im Newsbeitrag
>>> news:gdi15h$9re$1@build.eclipse.org...
>>> Okay, and how can i use it explicitly. I didn't found any
>>> tutorial for it. Do you know some?
>>>
>>> "Ed Merks" <Ed.Merks@gmail.com
>>> <mailto:Ed.Merks@gmail.com>> schrieb im Newsbeitrag
>>> news:gdi10t$5nk$1@build.eclipse.org...
>>> Timothy,
>>>
>>> In order to generate the right things, you really have
>>> to be using UML's extended GenModel, which you'll only
>>> get if you specify your model using UML2 and import
>>> it. So it's not sufficient just to have an Ecore
>>> model with annotations just like the ones UML
>>> produces, you have to be using UML's extended GenModel
>>> for those annotations to be recognized...
>>>
>>>
>>> Timothy Marc wrote:
>>>> Ed,
>>>>
>>>> i've tried it with a reall simple model. It consists
>>>> only of the following elements:
>>>>
>>>> ModelElement
>>>> +owner:ModelElement (union)
>>>> +ownedElement:ModelElement (union)
>>>>
>>>> A : ModelElement
>>>> +theB :B (subsets +ownedElemend) -containment
>>>>
>>>> B : ModelElement
>>>> +theA:A (subsets +owner)
>>>>
>>>> and the Editor allows, to construct things like
>>>>
>>>> A
>>>> + B
>>>>
>>>> But the access fails with the message, that B is not
>>>> a legal value.
>>>>
>>>> It is wierd, because i thought, that the generator
>>>> should made use of the UML2-specific
>>>> SupersetSubsetEList-Type, for the subsetting
>>>> properties (annotated as subsets), as it made use of
>>>> the DerivedUnionEList-Type for the EReferences,
>>>> annotated as Unions. But instead of, it uses the
>>>> simple Ecore-List-Type.
>>>>
>>>> After your last post, i've tried a lot with these
>>>> annotations ans the code generation for UML2. I'm
>>>> confused right now, because I'm pretty sure, that, in
>>>> a former approach, the code generator exactly has
>>>> used this UML2-specific types. But now, everytime i
>>>> regenerate this simple model, it uses only the
>>>> EMF-specific one...
>>>>
>>>> I'm a bit frustrated currently, because i didn't get
>>>> forward with this problem...
>>>>
>>>> Timothy
>>>>
>>>> "Ed Merks" <Ed.Merks@gmail.com
>>>> <mailto:Ed.Merks@gmail.com>> schrieb im
>>>> Newsbeitrag news:gdhrs1$2du$1@build.eclipse.org...
>>>> Timothy,
>>>>
>>>> Comments below.
>>>>
>>>> Timothy Marc wrote:
>>>>> Ed,
>>>>>
>>>>> you were right. It was because of an invalid
>>>>> reference. However, this kind
>>>>> of reference was allowed by the generated
>>>>> editor. Currently, i'm playing a
>>>>> little bit with the UML2 codegenerator, in
>>>>> particular the
>>>>> Union/Subset-mechanism.
>>>>>
>>>> Hmmm. It should never allow you to construct an
>>>> instance that isn't sound. In fact, the
>>>> underlying model simply doesn't allow it, which
>>>> is why the deserializer is failing. Maybe you
>>>> just had two objects with the same ID or
>>>> something else that the validator could notice if
>>>> you invoked it?
>>>>> Thx
>>>>> Timothy
>>>>> "Timothy Marc" <timothymarc@freenet.de> schrieb
>>>>> im Newsbeitrag
>>>>> news:gdhhid$rqj$1@build.eclipse.org...
>>>>>
>>>>>> Hey all,
>>>>>>
>>>>>> i've a problem when i try to load a resource
>>>>>> programmatically. I think,
>>>>>> this is because of a missconfiguration of
>>>>>> ResourceFactories, but i didn't
>>>>>> get it work.
>>>>>>
>>>>>> The genmodel settings uses the None as Resource
>>>>>> Type. That works fine. But
>>>>>> when i try to load my model programmatically
>>>>>> via the following snippet:
>>>>>>
>>>>>> final ResourceSet resourceSet = new
>>>>>> ResourceSetImpl();
>>>>>> final Resource r =
>>>>>> resourceSet.getResource(uri,true);
>>>>>> final TestingModel model =
>>>>>> (TestingModel)r.getContents().get(0);
>>>>>>
>>>>>> it fails with the following exception:
>>>>>>
>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException:
>>>>>> org.eclipse.emf.ecore.xmi.IllegalValueException:
>>>>>> Value
>>>>>> 'testing.impl.PackageImpl@1325aef (id: null,
>>>>>> description: null, name:
>>>>>> pack)' is not legal.
>>>>>> (file:/D:/workspaces/esaWorkspace/testing.victoria/My.testin g,
>>>>>> -1, -1)
>>>>>> at
>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:316)
>>>>>> at
>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:275)
>>>>>> at
>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:398)
>>>>>> at
>>>>>> unit.UMLismTesting.test(UMLismTesting.java:28)
>>>>>> at
>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>> at
>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>>>>> at
>>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>>>>> at java.lang.reflect.Method.invoke(Unknown
>>>>>> Source)
>>>>>> at
>>>>>> org.junit.internal.runners.TestMethodRunner.executeMethodBod y(TestMethodRunner.java:99)
>>>>>> at
>>>>>> org.junit.internal.runners.TestMethodRunner.runUnprotected(T estMethodRunner.java:81)
>>>>>> at
>>>>>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAfterRunner.java:34)
>>>>>> at
>>>>>> org.junit.internal.runners.TestMethodRunner.runMethod(TestMe thodRunner.java:75)
>>>>>> at
>>>>>> org.junit.internal.runners.TestMethodRunner.run(TestMethodRu nner.java:45)
>>>>>> at
>>>>>> org.junit.internal.runners.TestClassMethodsRunner.invokeTest Method(TestClassMethodsRunner.java:66)
>>>>>> at
>>>>>> org.junit.internal.runners.TestClassMethodsRunner.run(TestCl assMethodsRunner.java:35)
>>>>>> at
>>>>>> org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunner.java:42)
>>>>>> at
>>>>>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAfterRunner.java:34)
>>>>>> at
>>>>>> org.junit.internal.runners.TestClassRunner.run(TestClassRunn er.java:52)
>>>>>> at
>>>>>> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.r un(JUnit4TestReference.java:38)
>>>>>> at
>>>>>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
>>>>>> at
>>>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)
>>>>>> at
>>>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
>>>>>> at
>>>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
>>>>>> at
>>>>>> org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunne r.main(RemotePluginTestRunner.java:58)
>>>>>> at
>>>>>> org.eclipse.pde.internal.junit.runtime.CoreTestApplication.r un(CoreTestApplication.java:24)
>>>>>> at
>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>> at
>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>>>>> at
>>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>>>>> at java.lang.reflect.Method.invoke(Unknown
>>>>>> Source)
>>>>>> at
>>>>>> org.eclipse.equinox.internal.app.EclipseAppContainer.callMet hod(EclipseAppContainer.java:572)
>>>>>> at
>>>>>> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:171)
>>>>>> at
>>>>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
>>>>>> at
>>>>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
>>>>>> at
>>>>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
>>>>>> at
>>>>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
>>>>>> at
>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>> at
>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>>>>> at
>>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>>>>> at java.lang.reflect.Method.invoke(Unknown
>>>>>> Source)
>>>>>> at
>>>>>> org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
>>>>>> at
>>>>>> org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
>>>>>> at
>>>>>> org.eclipse.equinox.launcher.Main.run(Main.java:1173)
>>>>>> at
>>>>>> org.eclipse.equinox.launcher.Main.main(Main.java:1148)
>>>>>> Caused by:
>>>>>> org.eclipse.emf.ecore.xmi.IllegalValueException: Value
>>>>>> 'testing.impl.PackageImpl@1325aef (id: null,
>>>>>> description: null, name:
>>>>>> pack)' is not legal.
>>>>>> (file:/D:/workspaces/esaWorkspace/testing.victoria/My.testin g,
>>>>>> -1, -1)
>>>>>> at
>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2535)
>>>>>> at
>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHandler.java:1098)
>>>>>> at
>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:1179)
>>>>>> at
>>>>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(Unknown
>>>>>> Source)
>>>>>> at
>>>>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
>>>>>> Source)
>>>>>> at
>>>>>> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
>>>>>> Source)
>>>>>> at
>>>>>> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
>>>>>> Source)
>>>>>> at
>>>>>> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
>>>>>> Source)
>>>>>> at
>>>>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
>>>>>> Source)
>>>>>> at
>>>>>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
>>>>>> Source)
>>>>>> at javax.xml.parsers.SAXParser.parse(Unknown
>>>>>> Source)
>>>>>> at
>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:179)
>>>>>> at
>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
>>>>>> at
>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1354)
>>>>>> at
>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1155)
>>>>>> at
>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:256)
>>>>>> at
>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:271)
>>>>>> ... 41 more
>>>>>> Caused by:
>>>>>> java.lang.UnsupportedOperationException
>>>>>> at
>>>>>> org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(DerivedEObjectEList.java:278)
>>>>>> at java.util.AbstractSequentialList.add(Unknown
>>>>>> Source)
>>>>>> at
>>>>>> org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObjectEList.java:660)
>>>>>> at
>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:1179)
>>>>>> at
>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2530)
>>>>>> ... 57 more
>>>>>>
>>>>>>
>>>>>> Can anyone help me? I think this is just a
>>>>>> configuration issue, isnt' it?
>>>>>>
>>>>>> Thx
>>>>>> Timothy
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>
Re: Loading a Resource fails [message #627077 is a reply to message #477851] Thu, 23 October 2008 17:07 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.

------=_NextPart_000_00D1_01C93510.40C8A550
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I would not expect to see a subset/superset list used in this case, =
because the only subsets are subsets of derived unions which, by =
definition, are derived and read-only, which means they are computed on =
the fly. The subset/superset lists are only used for subset and superset =
properties which aren't read-only, i.e., where modifiying one list =
requires dynamically updating the other list. In the case of derived =
unions, a new list is returned each time you ask for the value of that =
feature, and it essentially provides a view onto the subset lists =
(which, as in this case, may just be "normal" EMF lists...).

Kenn=20
"Ed Merks" <Ed.Merks@gmail.com> wrote in message =
news:gdiagl$m5s$3@build.eclipse.org...
Timothy,

These are really questions to direct to the UML2 newsgroup because I =
just can't answer them from an EMF perspective. I'm not sure there is =
any way in the IDE, given just an Ecore model, to create an instance of =
UML's GenModel...


Timothy Marc wrote:=20
But it is really strange, because obviously, the =
DerivedUnionEObjectList-Type is used... so, why is this Liste-Type used, =
but not the SubsetSuperset-one?
"Timothy Marc" <timothymarc@freenet.de> schrieb im Newsbeitrag =
news:gdi15h$9re$1@build.eclipse.org...
Okay, and how can i use it explicitly. I didn't found any tutorial =
for it. Do you know some?
"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag =
news:gdi10t$5nk$1@build.eclipse.org...
Timothy,

In order to generate the right things, you really have to be =
using UML's extended GenModel, which you'll only get if you specify your =
model using UML2 and import it. So it's not sufficient just to have an =
Ecore model with annotations just like the ones UML produces, you have =
to be using UML's extended GenModel for those annotations to be =
recognized...


Timothy Marc wrote:=20
Ed,

i've tried it with a reall simple model. It consists only of =
the following elements:

ModelElement
+owner:ModelElement (union)
+ownedElement:ModelElement (union)

A : ModelElement
+theB :B (subsets +ownedElemend) -containment

B : ModelElement
+theA:A (subsets +owner)

and the Editor allows, to construct things like=20

A
+ B

But the access fails with the message, that B is not a legal =
value.

It is wierd, because i thought, that the generator should made =
use of the UML2-specific SupersetSubsetEList-Type, for the subsetting =
properties (annotated as subsets), as it made use of the =
DerivedUnionEList-Type for the EReferences, annotated as Unions. But =
instead of, it uses the simple Ecore-List-Type.

After your last post, i've tried a lot with these annotations =
ans the code generation for UML2. I'm confused right now, because I'm =
pretty sure, that, in a former approach, the code generator exactly has =
used this UML2-specific types. But now, everytime i regenerate this =
simple model, it uses only the EMF-specific one...

I'm a bit frustrated currently, because i didn't get forward =
with this problem...

Timothy
"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag =
news:gdhrs1$2du$1@build.eclipse.org...
Timothy,

Comments below.

Timothy Marc wrote:=20
Ed,

you were right. It was because of an invalid reference. However, this =
kind=20
of reference was allowed by the generated editor. Currently, i'm playing =
a=20
little bit with the UML2 codegenerator, in particular the=20
Union/Subset-mechanism.
Hmmm. It should never allow you to construct an instance that isn't =
sound. In fact, the underlying model simply doesn't allow it, which is =
why the deserializer is failing. Maybe you just had two objects with =
the same ID or something else that the validator could notice if you =
invoked it?

Thx
Timothy
"Timothy Marc" <timothymarc@freenet.de> schrieb im Newsbeitrag=20
news:gdhhid$rqj$1@build.eclipse.org...
Hey all,

i've a problem when i try to load a resource programmatically. I think,=20
this is because of a missconfiguration of ResourceFactories, but i =
didn't=20
get it work.

The genmodel settings uses the None as Resource Type. That works fine. =
But=20
when i try to load my model programmatically via the following snippet:

final ResourceSet resourceSet =3D new ResourceSetImpl();
final Resource r =3D resourceSet.getResource(uri,true);
final TestingModel model =3D (TestingModel)r.getContents().get(0);

it fails with the following exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedExc=
eption:=20
org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'testing.impl.PackageImpl@1325aef (id: null, description: null, name:=20
pack)' is not legal.=20
(file:/D:/workspaces/esaWorkspace/testing.victoria/My.testin g, -1, -1)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadExcep=
tion(ResourceSetImpl.java:316)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:275)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceS=
etImpl.java:398)
at unit.UMLismTesting.test(UMLismTesting.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at=20
org.junit.internal.runners.TestMethodRunner.executeMethodBod y(TestMethodR=
unner.java:99)
at=20
org.junit.internal.runners.TestMethodRunner.runUnprotected(T estMethodRunn=
er.java:81)
at=20
org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAft=
erRunner.java:34)
at=20
org.junit.internal.runners.TestMethodRunner.runMethod(TestMe thodRunner.ja=
va:75)
at=20
org.junit.internal.runners.TestMethodRunner.run(TestMethodRu nner.java:45)=

at=20
org.junit.internal.runners.TestClassMethodsRunner.invokeTest Method(TestCl=
assMethodsRunner.java:66)
at=20
org.junit.internal.runners.TestClassMethodsRunner.run(TestCl assMethodsRun=
ner.java:35)
at=20
org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunn=
er.java:42)
at=20
org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAft=
erRunner.java:34)
at =
org.junit.internal.runners.TestClassRunner.run(TestClassRunn er.java:52)
at=20
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.r un(JUnit4Test=
Reference.java:38)
at=20
org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.jav=
a:38)
at=20
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTes=
tRunner.java:460)
at=20
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTes=
tRunner.java:673)
at=20
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunn=
er.java:386)
at=20
org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunne r.main(Remote=
PluginTestRunner.java:58)
at=20
org.eclipse.pde.internal.junit.runtime.CoreTestApplication.r un(CoreTestAp=
plication.java:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at=20
org.eclipse.equinox.internal.app.EclipseAppContainer.callMet hod(EclipseAp=
pContainer.java:572)
at=20
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.ja=
va:171)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplicati=
on(EclipseAppLauncher.java:106)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Eclips=
eAppLauncher.java:76)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:3=
63)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:1=
76)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'testing.impl.PackageImpl@1325aef (id: null, description: null, name:=20
pack)' is not legal.=20
(file:/D:/workspaces/esaWorkspace/testing.victoria/My.testin g, -1, -1)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2535)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHand=
ler.java:1098)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:117=
9)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(=
Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source)
at=20
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:179)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
354)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
155)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSe=
tImpl.java:256)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:271)
.... 41 more
Caused by: java.lang.UnsupportedOperationException
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(=
DerivedEObjectEList.java:278)
at java.util.AbstractSequentialList.add(Unknown Source)
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObject=
EList.java:660)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:=
1179)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2530)
.... 57 more


Can anyone help me? I think this is just a configuration issue, isnt' =
it?

Thx
Timothy

=20


------=_NextPart_000_00D1_01C93510.40C8A550
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-1>
<META content=3D"MSHTML 6.00.6000.16705" name=3DGENERATOR></HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I would not expect to see a =
subset/superset list=20
used in this case, because the only subsets are subsets of derived =
unions which,=20
by definition, are derived and read-only, which means they are computed =
on the=20
fly. The subset/superset lists are only used for subset and superset=20
properties&nbsp;which aren't read-only, i.e., where modifiying one list =
requires=20
dynamically updating the other list. In the case of derived unions, a =
new=20
list&nbsp;is returned each time you ask for the value of that feature, =
and=20
it&nbsp;essentially provides a view onto the subset lists (which, as in =
this=20
case, may just be "normal" EMF lists...).</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Kenn</FONT>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A=20
href=3D"mailto:Ed.Merks@gmail.com">Ed.Merks@gmail.com</A>&gt; wrote in =
message=20
<A=20
=
href=3D"news:gdiagl$m5s$3@build.eclipse.org">news:gdiagl$m5s$3@build.ecli=
pse.org</A>...</DIV>Timothy,<BR><BR>These=20
are really questions to direct to the UML2 newsgroup because I just =
can't=20
answer them from an EMF perspective.&nbsp; I'm not sure there is any =
way in=20
the IDE, given just an Ecore model, to create an instance of UML's=20
GenModel...<BR><BR><BR>Timothy Marc wrote:=20
<BLOCKQUOTE cite=3Dmid:gdi1dj$b0v$1@build.eclipse.org type=3D"cite">
<META content=3D"MSHTML 6.00.2900.5659" name=3DGENERATOR>
<DIV><FONT face=3DArial size=3D2>But it is really strange, because =
obviously,=20
the DerivedUnionEObjectList-Type is used... so, why is this =
Liste-Type used,=20
but not the SubsetSuperset-one?</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Timothy Marc" &lt;<A href=3D"mailto:timothymarc@freenet.de"=20
moz-do-not-send=3D"true">timothymarc@freenet.de</A>&gt; schrieb im =

Newsbeitrag <A href=3D"news:gdi15h$9re$1@build.eclipse.org"=20
=
moz-do-not-send=3D"true">news:gdi15h$9re$1@build.eclipse.org</A>...</DIV>=

<DIV><FONT face=3DArial size=3D2>Okay, and how can i use it =
explicitly. I=20
didn't found any tutorial for it. Do you know some?</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A href=3D"mailto:Ed.Merks@gmail.com"=20
moz-do-not-send=3D"true">Ed.Merks@gmail.com</A>&gt; schrieb im =
Newsbeitrag=20
<A href=3D"news:gdi10t$5nk$1@build.eclipse.org"=20
=
moz-do-not-send=3D"true">news:gdi10t$5nk$1@build.eclipse.org</A>...</DIV>=
Timothy,<BR><BR>In=20
order to generate the right things, you really have to be using =
UML's=20
extended GenModel, which you'll only get if you specify your =
model using=20
UML2 and import it.&nbsp;&nbsp; So it's not sufficient just to =
have an=20
Ecore model with annotations just like the ones UML produces, =
you have=20
to be using UML's extended GenModel for those annotations to be=20
recognized...<BR><BR><BR>Timothy Marc wrote:=20
<BLOCKQUOTE cite=3Dmid:gdi0f1$vn8$1@build.eclipse.org =
type=3D"cite">
<META content=3D"MSHTML 6.00.2900.5659" name=3DGENERATOR>
<STYLE></STYLE>

<DIV><FONT face=3DArial size=3D2>Ed,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>i've tried it with a reall =
simple model.=20
It consists only of the following elements:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>ModelElement</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
+owner:ModelElement=20
(union)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;=20
+ownedElement:ModelElement (union)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>A : ModelElement</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; +theB :B =
(subsets=20
+ownedElemend) -containment</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>B : ModelElement</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; +theA:A =
(subsets=20
+owner)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>and the Editor allows, to =
construct=20
things like </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
A</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;+ =
B</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>But the access fails with the =
message,=20
that B is not a legal value.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>It is wierd, because i =
thought, that the=20
generator should made use of the UML2-specific=20
SupersetSubsetEList-Type, for the subsetting properties =
(annotated as=20
subsets), as it made use of the DerivedUnionEList-Type for the =

EReferences, annotated as Unions. But instead of, it uses the =
simple=20
Ecore-List-Type.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>After your last post, i've =
tried a lot=20
with these annotations ans the code generation for UML2. I'm =
confused=20
right now, because I'm pretty sure, that, in a former =
approach, the=20
code generator exactly has used this UML2-specific types. But =
now,=20
everytime i regenerate this simple model, it uses only the=20
EMF-specific one...</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I'm a bit frustrated =
currently, because i=20
didn't get forward with this problem...</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Timothy</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: =
5px; BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A href=3D"mailto:Ed.Merks@gmail.com"=20
moz-do-not-send=3D"true">Ed.Merks@gmail.com</A>&gt; schrieb =
im=20
Newsbeitrag <A href=3D"news:gdhrs1$2du$1@build.eclipse.org"=20
=
moz-do-not-send=3D"true">news:gdhrs1$2du$1@build.eclipse.org</A>...</DIV>=
Timothy,<BR><BR>Comments=20
below.<BR><BR>Timothy Marc wrote:=20
<BLOCKQUOTE cite=3Dmid:gdhr0p$v5v$1@build.eclipse.org =
type=3D"cite"><PRE wrap=3D"">Ed,

you were right. It was because of an invalid reference. However, this =
kind=20
of reference was allowed by the generated editor. Currently, i'm playing =
a=20
little bit with the UML2 codegenerator, in particular the=20
Union/Subset-mechanism.
</PRE></BLOCKQUOTE>Hmmm.&nbsp; It should never allow you to=20
construct an instance that isn't sound.&nbsp;&nbsp; In fact, =
the=20
underlying model simply doesn't allow it, which is why the=20
deserializer is failing.&nbsp; Maybe you just had two =
objects with=20
the same ID or something else that the validator could =
notice if you=20
invoked it?<BR>
<BLOCKQUOTE cite=3Dmid:gdhr0p$v5v$1@build.eclipse.org =
type=3D"cite"><PRE wrap=3D"">Thx
Timothy
"Timothy Marc" <A class=3Dmoz-txt-link-rfc2396E =
href=3D"mailto:timothymarc@freenet.de" =
moz-do-not-send=3D"true">&lt;timothymarc@freenet.de&gt;</A> schrieb im =
Newsbeitrag=20
<A class=3Dmoz-txt-link-freetext =
href=3D"news:gdhhid$rqj$1@build.eclipse.org" =
moz-do-not-send=3D"true">news:gdhhid$rqj$1@build.eclipse.org</A>...
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Hey all,

i've a problem when i try to load a resource programmatically. I think,=20
this is because of a missconfiguration of ResourceFactories, but i =
didn't=20
get it work.

The genmodel settings uses the None as Resource Type. That works fine. =
But=20
when i try to load my model programmatically via the following snippet:

final ResourceSet resourceSet =3D new ResourceSetImpl();
final Resource r =3D resourceSet.getResource(uri,true);
final TestingModel model =3D (TestingModel)r.getContents().get(0);

it fails with the following exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedExc=
eption:=20
org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'testing.impl.PackageImpl@1325aef (id: null, description: null, name:=20
pack)' is not legal.=20
(<A class=3Dmoz-txt-link-freetext =
href=3D" file:/D:/workspaces/esaWorkspace/testing.victoria/My.testing " =
moz-do-not-send=3D"true">file:/D:/workspaces/esaWorkspace/testing.victori=
a/My.testing</A>, -1, -1)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadExcep=
tion(ResourceSetImpl.java:316)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:275)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceS=
etImpl.java:398)
at unit.UMLismTesting.test(UMLismTesting.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at=20
org.junit.internal.runners.TestMethodRunner.executeMethodBod y(TestMethodR=
unner.java:99)
at=20
org.junit.internal.runners.TestMethodRunner.runUnprotected(T estMethodRunn=
er.java:81)
at=20
org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAft=
erRunner.java:34)
at=20
org.junit.internal.runners.TestMethodRunner.runMethod(TestMe thodRunner.ja=
va:75)
at=20
org.junit.internal.runners.TestMethodRunner.run(TestMethodRu nner.java:45)=

at=20
org.junit.internal.runners.TestClassMethodsRunner.invokeTest Method(TestCl=
assMethodsRunner.java:66)
at=20
org.junit.internal.runners.TestClassMethodsRunner.run(TestCl assMethodsRun=
ner.java:35)
at=20
org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunn=
er.java:42)
at=20
org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAft=
erRunner.java:34)
at =
org.junit.internal.runners.TestClassRunner.run(TestClassRunn er.java:52)
at=20
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.r un(JUnit4Test=
Reference.java:38)
at=20
org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.jav=
a:38)
at=20
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTes=
tRunner.java:460)
at=20
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTes=
tRunner.java:673)
at=20
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunn=
er.java:386)
at=20
org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunne r.main(Remote=
PluginTestRunner.java:58)
at=20
org.eclipse.pde.internal.junit.runtime.CoreTestApplication.r un(CoreTestAp=
plication.java:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at=20
org.eclipse.equinox.internal.app.EclipseAppContainer.callMet hod(EclipseAp=
pContainer.java:572)
at=20
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.ja=
va:171)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplicati=
on(EclipseAppLauncher.java:106)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Eclips=
eAppLauncher.java:76)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:3=
63)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:1=
76)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'testing.impl.PackageImpl@1325aef (id: null, description: null, name:=20
pack)' is not legal.=20
(<A class=3Dmoz-txt-link-freetext =
href=3D" file:/D:/workspaces/esaWorkspace/testing.victoria/My.testing " =
moz-do-not-send=3D"true">file:/D:/workspaces/esaWorkspace/testing.victori=
a/My.testing</A>, -1, -1)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2535)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHand=
ler.java:1098)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:117=
9)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(=
Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source)
at=20
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:179)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
354)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
155)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSe=
tImpl.java:256)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:271)
.... 41 more
Caused by: java.lang.UnsupportedOperationException
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(=
DerivedEObjectEList.java:278)
at java.util.AbstractSequentialList.add(Unknown Source)
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObject=
EList.java:660)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:=
1179)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2530)
.... 57 more


Can anyone help me? I think this is just a configuration issue, isnt' =
it?

Thx
Timothy

</PRE></BLOCKQUOTE><PRE wrap=3D""><!---->

=
</PRE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE ></BLOCKQUOTE></=
BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_00D1_01C93510.40C8A550--
Re: Loading a Resource fails [message #627079 is a reply to message #477877] Fri, 24 October 2008 10:17 Go to previous message
Timothy Marc is currently offline Timothy MarcFriend
Messages: 547
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.

------=_NextPart_000_01E9_01C935D2.88193F10
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Dear Kenn,

thanks, that was a good explanation concerning the list types. You =
helped me a lot with this...

Thx
Timothy
"Kenn Hussey" <Kenn.Hussey@embarcadero.com> schrieb im Newsbeitrag =
news:gdqavr$mgk$1@build.eclipse.org...
I would not expect to see a subset/superset list used in this case, =
because the only subsets are subsets of derived unions which, by =
definition, are derived and read-only, which means they are computed on =
the fly. The subset/superset lists are only used for subset and superset =
properties which aren't read-only, i.e., where modifiying one list =
requires dynamically updating the other list. In the case of derived =
unions, a new list is returned each time you ask for the value of that =
feature, and it essentially provides a view onto the subset lists =
(which, as in this case, may just be "normal" EMF lists...).

Kenn=20
"Ed Merks" <Ed.Merks@gmail.com> wrote in message =
news:gdiagl$m5s$3@build.eclipse.org...
Timothy,

These are really questions to direct to the UML2 newsgroup because I =
just can't answer them from an EMF perspective. I'm not sure there is =
any way in the IDE, given just an Ecore model, to create an instance of =
UML's GenModel...


Timothy Marc wrote:=20
But it is really strange, because obviously, the =
DerivedUnionEObjectList-Type is used... so, why is this Liste-Type used, =
but not the SubsetSuperset-one?
"Timothy Marc" <timothymarc@freenet.de> schrieb im Newsbeitrag =
news:gdi15h$9re$1@build.eclipse.org...
Okay, and how can i use it explicitly. I didn't found any =
tutorial for it. Do you know some?
"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag =
news:gdi10t$5nk$1@build.eclipse.org...
Timothy,

In order to generate the right things, you really have to be =
using UML's extended GenModel, which you'll only get if you specify your =
model using UML2 and import it. So it's not sufficient just to have an =
Ecore model with annotations just like the ones UML produces, you have =
to be using UML's extended GenModel for those annotations to be =
recognized...


Timothy Marc wrote:=20
Ed,

i've tried it with a reall simple model. It consists only of =
the following elements:

ModelElement
+owner:ModelElement (union)
+ownedElement:ModelElement (union)

A : ModelElement
+theB :B (subsets +ownedElemend) -containment

B : ModelElement
+theA:A (subsets +owner)

and the Editor allows, to construct things like=20

A
+ B

But the access fails with the message, that B is not a legal =
value.

It is wierd, because i thought, that the generator should =
made use of the UML2-specific SupersetSubsetEList-Type, for the =
subsetting properties (annotated as subsets), as it made use of the =
DerivedUnionEList-Type for the EReferences, annotated as Unions. But =
instead of, it uses the simple Ecore-List-Type.

After your last post, i've tried a lot with these =
annotations ans the code generation for UML2. I'm confused right now, =
because I'm pretty sure, that, in a former approach, the code generator =
exactly has used this UML2-specific types. But now, everytime i =
regenerate this simple model, it uses only the EMF-specific one...

I'm a bit frustrated currently, because i didn't get forward =
with this problem...

Timothy
"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag =
news:gdhrs1$2du$1@build.eclipse.org...
Timothy,

Comments below.

Timothy Marc wrote:=20
Ed,

you were right. It was because of an invalid reference. However, this =
kind=20
of reference was allowed by the generated editor. Currently, i'm playing =
a=20
little bit with the UML2 codegenerator, in particular the=20
Union/Subset-mechanism.
Hmmm. It should never allow you to construct an instance that isn't =
sound. In fact, the underlying model simply doesn't allow it, which is =
why the deserializer is failing. Maybe you just had two objects with =
the same ID or something else that the validator could notice if you =
invoked it?

Thx
Timothy
"Timothy Marc" <timothymarc@freenet.de> schrieb im Newsbeitrag=20
news:gdhhid$rqj$1@build.eclipse.org...
Hey all,

i've a problem when i try to load a resource programmatically. I think,=20
this is because of a missconfiguration of ResourceFactories, but i =
didn't=20
get it work.

The genmodel settings uses the None as Resource Type. That works fine. =
But=20
when i try to load my model programmatically via the following snippet:

final ResourceSet resourceSet =3D new ResourceSetImpl();
final Resource r =3D resourceSet.getResource(uri,true);
final TestingModel model =3D (TestingModel)r.getContents().get(0);

it fails with the following exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedExc=
eption:=20
org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'testing.impl.PackageImpl@1325aef (id: null, description: null, name:=20
pack)' is not legal.=20
(file:/D:/workspaces/esaWorkspace/testing.victoria/My.testin g, -1, -1)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadExcep=
tion(ResourceSetImpl.java:316)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:275)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceS=
etImpl.java:398)
at unit.UMLismTesting.test(UMLismTesting.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at=20
org.junit.internal.runners.TestMethodRunner.executeMethodBod y(TestMethodR=
unner.java:99)
at=20
org.junit.internal.runners.TestMethodRunner.runUnprotected(T estMethodRunn=
er.java:81)
at=20
org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAft=
erRunner.java:34)
at=20
org.junit.internal.runners.TestMethodRunner.runMethod(TestMe thodRunner.ja=
va:75)
at=20
org.junit.internal.runners.TestMethodRunner.run(TestMethodRu nner.java:45)=

at=20
org.junit.internal.runners.TestClassMethodsRunner.invokeTest Method(TestCl=
assMethodsRunner.java:66)
at=20
org.junit.internal.runners.TestClassMethodsRunner.run(TestCl assMethodsRun=
ner.java:35)
at=20
org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunn=
er.java:42)
at=20
org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAft=
erRunner.java:34)
at =
org.junit.internal.runners.TestClassRunner.run(TestClassRunn er.java:52)
at=20
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.r un(JUnit4Test=
Reference.java:38)
at=20
org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.jav=
a:38)
at=20
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTes=
tRunner.java:460)
at=20
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTes=
tRunner.java:673)
at=20
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunn=
er.java:386)
at=20
org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunne r.main(Remote=
PluginTestRunner.java:58)
at=20
org.eclipse.pde.internal.junit.runtime.CoreTestApplication.r un(CoreTestAp=
plication.java:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at=20
org.eclipse.equinox.internal.app.EclipseAppContainer.callMet hod(EclipseAp=
pContainer.java:572)
at=20
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.ja=
va:171)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplicati=
on(EclipseAppLauncher.java:106)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Eclips=
eAppLauncher.java:76)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:3=
63)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:1=
76)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'testing.impl.PackageImpl@1325aef (id: null, description: null, name:=20
pack)' is not legal.=20
(file:/D:/workspaces/esaWorkspace/testing.victoria/My.testin g, -1, -1)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2535)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHand=
ler.java:1098)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:117=
9)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(=
Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source)
at=20
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:179)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
354)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
155)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSe=
tImpl.java:256)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:271)
.... 41 more
Caused by: java.lang.UnsupportedOperationException
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(=
DerivedEObjectEList.java:278)
at java.util.AbstractSequentialList.add(Unknown Source)
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObject=
EList.java:660)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:=
1179)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2530)
.... 57 more


Can anyone help me? I think this is just a configuration issue, isnt' =
it?

Thx
Timothy

=20


------=_NextPart_000_01E9_01C935D2.88193F10
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-1>
<META content=3D"MSHTML 6.00.2900.5659" name=3DGENERATOR></HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Dear Kenn,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>thanks, that was a good explanation =
concerning the=20
list types. You helped me a lot with this...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thx</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Timothy</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Kenn Hussey" &lt;<A=20
=
href=3D"mailto:Kenn.Hussey@embarcadero.com">Kenn.Hussey@embarcadero.com</=
A>&gt;=20
schrieb im Newsbeitrag <A=20
=
href=3D"news:gdqavr$mgk$1@build.eclipse.org">news:gdqavr$mgk$1@build.ecli=
pse.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>I would not expect to see a =
subset/superset list=20
used in this case, because the only subsets are subsets of derived =
unions=20
which, by definition, are derived and read-only, which means they are =
computed=20
on the fly. The subset/superset lists are only used for subset and =
superset=20
properties&nbsp;which aren't read-only, i.e., where modifiying one =
list=20
requires dynamically updating the other list. In the case of derived =
unions, a=20
new list&nbsp;is returned each time you ask for the value of that =
feature, and=20
it&nbsp;essentially provides a view onto the subset lists (which, as =
in this=20
case, may just be "normal" EMF lists...).</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Kenn</FONT>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A=20
href=3D"mailto:Ed.Merks@gmail.com">Ed.Merks@gmail.com</A>&gt; wrote =
in message=20
<A=20
=
href=3D"news:gdiagl$m5s$3@build.eclipse.org">news:gdiagl$m5s$3@build.ecli=
pse.org</A>...</DIV>Timothy,<BR><BR>These=20
are really questions to direct to the UML2 newsgroup because I just =
can't=20
answer them from an EMF perspective.&nbsp; I'm not sure there is any =
way in=20
the IDE, given just an Ecore model, to create an instance of UML's=20
GenModel...<BR><BR><BR>Timothy Marc wrote:=20
<BLOCKQUOTE cite=3Dmid:gdi1dj$b0v$1@build.eclipse.org type=3D"cite">
<META content=3D"MSHTML 6.00.2900.5659" name=3DGENERATOR>
<DIV><FONT face=3DArial size=3D2>But it is really strange, because =
obviously,=20
the DerivedUnionEObjectList-Type is used... so, why is this =
Liste-Type=20
used, but not the SubsetSuperset-one?</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Timothy Marc" &lt;<A =
href=3D"mailto:timothymarc@freenet.de"=20
moz-do-not-send=3D"true">timothymarc@freenet.de</A>&gt; schrieb =
im=20
Newsbeitrag <A href=3D"news:gdi15h$9re$1@build.eclipse.org"=20
=
moz-do-not-send=3D"true">news:gdi15h$9re$1@build.eclipse.org</A>...</DIV>=

<DIV><FONT face=3DArial size=3D2>Okay, and how can i use it =
explicitly. I=20
didn't found any tutorial for it. Do you know some?</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: =
5px; BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A href=3D"mailto:Ed.Merks@gmail.com"=20
moz-do-not-send=3D"true">Ed.Merks@gmail.com</A>&gt; schrieb im =

Newsbeitrag <A href=3D"news:gdi10t$5nk$1@build.eclipse.org"=20
=
moz-do-not-send=3D"true">news:gdi10t$5nk$1@build.eclipse.org</A>...</DIV>=
Timothy,<BR><BR>In=20
order to generate the right things, you really have to be =
using UML's=20
extended GenModel, which you'll only get if you specify your =
model=20
using UML2 and import it.&nbsp;&nbsp; So it's not sufficient =
just to=20
have an Ecore model with annotations just like the ones UML =
produces,=20
you have to be using UML's extended GenModel for those =
annotations to=20
be recognized...<BR><BR><BR>Timothy Marc wrote:=20
<BLOCKQUOTE cite=3Dmid:gdi0f1$vn8$1@build.eclipse.org =
type=3D"cite">
<META content=3D"MSHTML 6.00.2900.5659" name=3DGENERATOR>
<STYLE></STYLE>

<DIV><FONT face=3DArial size=3D2>Ed,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>i've tried it with a reall =
simple=20
model. It consists only of the following =
elements:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>ModelElement</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
+owner:ModelElement=20
(union)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;=20
+ownedElement:ModelElement (union)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>A : =
ModelElement</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; +theB :B =
(subsets=20
+ownedElemend) -containment</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>B : =
ModelElement</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; +theA:A =
(subsets=20
+owner)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>and the Editor allows, to =
construct=20
things like </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
A</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;+=20
B</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>But the access fails with =
the message,=20
that B is not a legal value.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>It is wierd, because i =
thought, that=20
the generator should made use of the UML2-specific=20
SupersetSubsetEList-Type, for the subsetting properties =
(annotated=20
as subsets), as it made use of the DerivedUnionEList-Type =
for the=20
EReferences, annotated as Unions. But instead of, it uses =
the simple=20
Ecore-List-Type.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>After your last post, i've =
tried a lot=20
with these annotations ans the code generation for UML2. I'm =

confused right now, because I'm pretty sure, that, in a =
former=20
approach, the code generator exactly has used this =
UML2-specific=20
types. But now, everytime i regenerate this simple model, it =
uses=20
only the EMF-specific one...</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I'm a bit frustrated =
currently, because=20
i didn't get forward with this problem...</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Timothy</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: =
5px; BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A href=3D"mailto:Ed.Merks@gmail.com"=20
moz-do-not-send=3D"true">Ed.Merks@gmail.com</A>&gt; =
schrieb im=20
Newsbeitrag <A =
href=3D"news:gdhrs1$2du$1@build.eclipse.org"=20
=
moz-do-not-send=3D"true">news:gdhrs1$2du$1@build.eclipse.org</A>...</DIV>=
Timothy,<BR><BR>Comments=20
below.<BR><BR>Timothy Marc wrote:=20
<BLOCKQUOTE cite=3Dmid:gdhr0p$v5v$1@build.eclipse.org =
type=3D"cite"><PRE wrap=3D"">Ed,

you were right. It was because of an invalid reference. However, this =
kind=20
of reference was allowed by the generated editor. Currently, i'm playing =
a=20
little bit with the UML2 codegenerator, in particular the=20
Union/Subset-mechanism.
</PRE></BLOCKQUOTE>Hmmm.&nbsp; It should never allow you to=20
construct an instance that isn't sound.&nbsp;&nbsp; In =
fact, the=20
underlying model simply doesn't allow it, which is why the =

deserializer is failing.&nbsp; Maybe you just had two =
objects with=20
the same ID or something else that the validator could =
notice if=20
you invoked it?<BR>
<BLOCKQUOTE cite=3Dmid:gdhr0p$v5v$1@build.eclipse.org =
type=3D"cite"><PRE wrap=3D"">Thx
Timothy
"Timothy Marc" <A class=3Dmoz-txt-link-rfc2396E =
href=3D"mailto:timothymarc@freenet.de" =
moz-do-not-send=3D"true">&lt;timothymarc@freenet.de&gt;</A> schrieb im =
Newsbeitrag=20
<A class=3Dmoz-txt-link-freetext =
href=3D"news:gdhhid$rqj$1@build.eclipse.org" =
moz-do-not-send=3D"true">news:gdhhid$rqj$1@build.eclipse.org</A>...
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Hey all,

i've a problem when i try to load a resource programmatically. I think,=20
this is because of a missconfiguration of ResourceFactories, but i =
didn't=20
get it work.

The genmodel settings uses the None as Resource Type. That works fine. =
But=20
when i try to load my model programmatically via the following snippet:

final ResourceSet resourceSet =3D new ResourceSetImpl();
final Resource r =3D resourceSet.getResource(uri,true);
final TestingModel model =3D (TestingModel)r.getContents().get(0);

it fails with the following exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedExc=
eption:=20
org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'testing.impl.PackageImpl@1325aef (id: null, description: null, name:=20
pack)' is not legal.=20
(<A class=3Dmoz-txt-link-freetext =
href=3D" file:/D:/workspaces/esaWorkspace/testing.victoria/My.testing " =
moz-do-not-send=3D"true">file:/D:/workspaces/esaWorkspace/testing.victori=
a/My.testing</A>, -1, -1)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadExcep=
tion(ResourceSetImpl.java:316)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:275)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceS=
etImpl.java:398)
at unit.UMLismTesting.test(UMLismTesting.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at=20
org.junit.internal.runners.TestMethodRunner.executeMethodBod y(TestMethodR=
unner.java:99)
at=20
org.junit.internal.runners.TestMethodRunner.runUnprotected(T estMethodRunn=
er.java:81)
at=20
org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAft=
erRunner.java:34)
at=20
org.junit.internal.runners.TestMethodRunner.runMethod(TestMe thodRunner.ja=
va:75)
at=20
org.junit.internal.runners.TestMethodRunner.run(TestMethodRu nner.java:45)=

at=20
org.junit.internal.runners.TestClassMethodsRunner.invokeTest Method(TestCl=
assMethodsRunner.java:66)
at=20
org.junit.internal.runners.TestClassMethodsRunner.run(TestCl assMethodsRun=
ner.java:35)
at=20
org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunn=
er.java:42)
at=20
org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAft=
erRunner.java:34)
at =
org.junit.internal.runners.TestClassRunner.run(TestClassRunn er.java:52)
at=20
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.r un(JUnit4Test=
Reference.java:38)
at=20
org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.jav=
a:38)
at=20
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTes=
tRunner.java:460)
at=20
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTes=
tRunner.java:673)
at=20
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunn=
er.java:386)
at=20
org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunne r.main(Remote=
PluginTestRunner.java:58)
at=20
org.eclipse.pde.internal.junit.runtime.CoreTestApplication.r un(CoreTestAp=
plication.java:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at=20
org.eclipse.equinox.internal.app.EclipseAppContainer.callMet hod(EclipseAp=
pContainer.java:572)
at=20
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.ja=
va:171)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplicati=
on(EclipseAppLauncher.java:106)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Eclips=
eAppLauncher.java:76)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:3=
63)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:1=
76)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'testing.impl.PackageImpl@1325aef (id: null, description: null, name:=20
pack)' is not legal.=20
(<A class=3Dmoz-txt-link-freetext =
href=3D" file:/D:/workspaces/esaWorkspace/testing.victoria/My.testing " =
moz-do-not-send=3D"true">file:/D:/workspaces/esaWorkspace/testing.victori=
a/My.testing</A>, -1, -1)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2535)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHand=
ler.java:1098)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:117=
9)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(=
Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source)
at=20
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:179)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
354)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
155)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSe=
tImpl.java:256)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:271)
.... 41 more
Caused by: java.lang.UnsupportedOperationException
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(=
DerivedEObjectEList.java:278)
at java.util.AbstractSequentialList.add(Unknown Source)
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObject=
EList.java:660)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:=
1179)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2530)
.... 57 more


Can anyone help me? I think this is just a configuration issue, isnt' =
it?

Thx
Timothy

</PRE></BLOCKQUOTE><PRE wrap=3D""><!---->

=
</PRE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE ></BLOCKQUOTE></=
BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_01E9_01C935D2.88193F10--
Re: Loading a Resource fails [message #627350 is a reply to message #477879] Wed, 28 January 2009 17:24 Go to previous message
Hossam Karim is currently offline Hossam KarimFriend
Messages: 26
Registered: July 2009
Junior Member
This is a multi-part message in MIME format.
--------------070806030006080000070504
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi everyone,
I am having a similar problem although the subsetted properties are
derived union. I am attaching the source UML model and the generated
ecore and genmodel. I am able to use the editor to save but when loading
the saved model I am getting the attached exception. I am using Eclipse
3.5M4.


Timothy Marc wrote:
> Dear Kenn,
>
> thanks, that was a good explanation concerning the list types. You
> helped me a lot with this...
>
> Thx
> Timothy
>
> "Kenn Hussey" <Kenn.Hussey@embarcadero.com
> <mailto:Kenn.Hussey@embarcadero.com>> schrieb im Newsbeitrag
> news:gdqavr$mgk$1@build.eclipse.org...
> I would not expect to see a subset/superset list used in this case,
> because the only subsets are subsets of derived unions which, by
> definition, are derived and read-only, which means they are computed
> on the fly. The subset/superset lists are only used for subset and
> superset properties which aren't read-only, i.e., where modifiying
> one list requires dynamically updating the other list. In the case
> of derived unions, a new list is returned each time you ask for the
> value of that feature, and it essentially provides a view onto the
> subset lists (which, as in this case, may just be "normal" EMF
> lists...).
>
> Kenn
>
> "Ed Merks" <Ed.Merks@gmail.com <mailto:Ed.Merks@gmail.com>>
> wrote in message news:gdiagl$m5s$3@build.eclipse.org...
> Timothy,
>
> These are really questions to direct to the UML2 newsgroup
> because I just can't answer them from an EMF perspective. I'm
> not sure there is any way in the IDE, given just an Ecore model,
> to create an instance of UML's GenModel...
>
>
> Timothy Marc wrote:
>> But it is really strange, because obviously, the
>> DerivedUnionEObjectList-Type is used... so, why is this
>> Liste-Type used, but not the SubsetSuperset-one?
>>
>> "Timothy Marc" <timothymarc@freenet.de
>> <mailto:timothymarc@freenet.de>> schrieb im Newsbeitrag
>> news:gdi15h$9re$1@build.eclipse.org...
>> Okay, and how can i use it explicitly. I didn't found any
>> tutorial for it. Do you know some?
>>
>> "Ed Merks" <Ed.Merks@gmail.com
>> <mailto:Ed.Merks@gmail.com>> schrieb im Newsbeitrag
>> news:gdi10t$5nk$1@build.eclipse.org...
>> Timothy,
>>
>> In order to generate the right things, you really have
>> to be using UML's extended GenModel, which you'll only
>> get if you specify your model using UML2 and import
>> it. So it's not sufficient just to have an Ecore
>> model with annotations just like the ones UML
>> produces, you have to be using UML's extended GenModel
>> for those annotations to be recognized...
>>
>>
>> Timothy Marc wrote:
>>> Ed,
>>>
>>> i've tried it with a reall simple model. It consists
>>> only of the following elements:
>>>
>>> ModelElement
>>> +owner:ModelElement (union)
>>> +ownedElement:ModelElement (union)
>>>
>>> A : ModelElement
>>> +theB :B (subsets +ownedElemend) -containment
>>>
>>> B : ModelElement
>>> +theA:A (subsets +owner)
>>>
>>> and the Editor allows, to construct things like
>>>
>>> A
>>> + B
>>>
>>> But the access fails with the message, that B is not
>>> a legal value.
>>>
>>> It is wierd, because i thought, that the generator
>>> should made use of the UML2-specific
>>> SupersetSubsetEList-Type, for the subsetting
>>> properties (annotated as subsets), as it made use of
>>> the DerivedUnionEList-Type for the EReferences,
>>> annotated as Unions. But instead of, it uses the
>>> simple Ecore-List-Type.
>>>
>>> After your last post, i've tried a lot with these
>>> annotations ans the code generation for UML2. I'm
>>> confused right now, because I'm pretty sure, that, in
>>> a former approach, the code generator exactly has
>>> used this UML2-specific types. But now, everytime i
>>> regenerate this simple model, it uses only the
>>> EMF-specific one...
>>>
>>> I'm a bit frustrated currently, because i didn't get
>>> forward with this problem...
>>>
>>> Timothy
>>>
>>> "Ed Merks" <Ed.Merks@gmail.com
>>> <mailto:Ed.Merks@gmail.com>> schrieb im
>>> Newsbeitrag news:gdhrs1$2du$1@build.eclipse.org...
>>> Timothy,
>>>
>>> Comments below.
>>>
>>> Timothy Marc wrote:
>>>> Ed,
>>>>
>>>> you were right. It was because of an invalid reference. However, this kind
>>>> of reference was allowed by the generated editor. Currently, i'm playing a
>>>> little bit with the UML2 codegenerator, in particular the
>>>> Union/Subset-mechanism.
>>>>
>>> Hmmm. It should never allow you to construct an
>>> instance that isn't sound. In fact, the
>>> underlying model simply doesn't allow it, which
>>> is why the deserializer is failing. Maybe you
>>> just had two objects with the same ID or
>>> something else that the validator could notice if
>>> you invoked it?
>>>> Thx
>>>> Timothy
>>>> "Timothy Marc" <timothymarc@freenet.de> schrieb im Newsbeitrag
>>>> news:gdhhid$rqj$1@build.eclipse.org...
>>>>
>>>>> Hey all,
>>>>>
>>>>> i've a problem when i try to load a resource programmatically. I think,
>>>>> this is because of a missconfiguration of ResourceFactories, but i didn't
>>>>> get it work.
>>>>>
>>>>> The genmodel settings uses the None as Resource Type. That works fine. But
>>>>> when i try to load my model programmatically via the following snippet:
>>>>>
>>>>> final ResourceSet resourceSet = new ResourceSetImpl();
>>>>> final Resource r = resourceSet.getResource(uri,true);
>>>>> final TestingModel model = (TestingModel)r.getContents().get(0);
>>>>>
>>>>> it fails with the following exception:
>>>>>
>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException:
>>>>> org.eclipse.emf.ecore.xmi.IllegalValueException: Value
>>>>> 'testing.impl.PackageImpl@1325aef (id: null, description: null, name:
>>>>> pack)' is not legal.
>>>>> (file:/D:/workspaces/esaWorkspace/testing.victoria/My.testin g, -1, -1)
>>>>> at
>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:316)
>>>>> at
>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:275)
>>>>> at
>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:398)
>>>>> at unit.UMLismTesting.test(UMLismTesting.java:28)
>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>>>> at java.lang.reflect.Method.invoke(Unknown Source)
>>>>> at
>>>>> org.junit.internal.runners.TestMethodRunner.executeMethodBod y(TestMethodRunner.java:99)
>>>>> at
>>>>> org.junit.internal.runners.TestMethodRunner.runUnprotected(T estMethodRunner.java:81)
>>>>> at
>>>>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAfterRunner.java:34)
>>>>> at
>>>>> org.junit.internal.runners.TestMethodRunner.runMethod(TestMe thodRunner.java:75)
>>>>> at
>>>>> org.junit.internal.runners.TestMethodRunner.run(TestMethodRu nner.java:45)
>>>>> at
>>>>> org.junit.internal.runners.TestClassMethodsRunner.invokeTest Method(TestClassMethodsRunner.java:66)
>>>>> at
>>>>> org.junit.internal.runners.TestClassMethodsRunner.run(TestCl assMethodsRunner.java:35)
>>>>> at
>>>>> org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunner.java:42)
>>>>> at
>>>>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAfterRunner.java:34)
>>>>> at org.junit.internal.runners.TestClassRunner.run(TestClassRunn er.java:52)
>>>>> at
>>>>> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.r un(JUnit4TestReference.java:38)
>>>>> at
>>>>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
>>>>> at
>>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)
>>>>> at
>>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
>>>>> at
>>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
>>>>> at
>>>>> org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunne r.main(RemotePluginTestRunner.java:58)
>>>>> at
>>>>> org.eclipse.pde.internal.junit.runtime.CoreTestApplication.r un(CoreTestApplication.java:24)
>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>>>> at java.lang.reflect.Method.invoke(Unknown Source)
>>>>> at
>>>>> org.eclipse.equinox.internal.app.EclipseAppContainer.callMet hod(EclipseAppContainer.java:572)
>>>>> at
>>>>> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:171)
>>>>> at
>>>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
>>>>> at
>>>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
>>>>> at
>>>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
>>>>> at
>>>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>>>> at java.lang.reflect.Method.invoke(Unknown Source)
>>>>> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
>>>>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
>>>>> at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
>>>>> at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
>>>>> Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value
>>>>> 'testing.impl.PackageImpl@1325aef (id: null, description: null, name:
>>>>> pack)' is not legal.
>>>>> (file:/D:/workspaces/esaWorkspace/testing.victoria/My.testin g, -1, -1)
>>>>> at
>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2535)
>>>>> at
>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHandler.java:1098)
>>>>> at
>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:1179)
>>>>> at
>>>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(Unknown
>>>>> Source)
>>>>> at
>>>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
>>>>> Source)
>>>>> at
>>>>> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
>>>>> Source)
>>>>> at
>>>>> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
>>>>> Source)
>>>>> at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
>>>>> Source)
>>>>> at
>>>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
>>>>> Source)
>>>>> at
>>>>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
>>>>> Source)
>>>>> at javax.xml.parsers.SAXParser.parse(Unknown Source)
>>>>> at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:179)
>>>>> at
>>>>> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
>>>>> at
>>>>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1354)
>>>>> at
>>>>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1155)
>>>>> at
>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:256)
>>>>> at
>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:271)
>>>>> ... 41 more
>>>>> Caused by: java.lang.UnsupportedOperationException
>>>>> at
>>>>> org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(DerivedEObjectEList.java:278)
>>>>> at java.util.AbstractSequentialList.add(Unknown Source)
>>>>> at
>>>>> org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObjectEList.java:660)
>>>>> at
>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:1179)
>>>>> at
>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2530)
>>>>> ... 57 more
>>>>>
>>>>>
>>>>> Can anyone help me? I think this is just a configuration issue, isnt' it?
>>>>>
>>>>> Thx
>>>>> Timothy
>>>>>
>>>>>
>>>>
>>>>
>>>>


--------------070806030006080000070504
Content-Type: application/octet-stream;
name="jdsl.zip"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="jdsl.zip"

UEsDBBQAAAAIAIiKPDp1E107rwQAAKEdAAANAAAAamRzbC5nZW5tb2RlbNVZ XW/iOBR9H2n+
Q5R9HtzpSqsVKh1lQuhmFgIiodq3KCQG3HFsZBta9tfvdRJTMoUu0ELbqkIk vh/H9x6fOObq
20NOrSUWknDWsr82LmwLs5RnhE1b9ijqfPnT/nb9+dPVFLOcZ5g2bzDr6S/W Q06aa8dLcPz8
yYI/iMdkEwZb9kypeROh+/v7Bs+nDS6m6J+ebxsTWTe5/72wuLy4+Apm3TCd 4Tz5QphUCUtx
LTpOucA1Z5xSMpe4iIDziY5yiTxtZtKZCex0W+T0El02YCbIzNG2Cpc2EThV XKxaNgLLhpoR
9jPHKmlkkiIp0gpcYTygiylhfrtlPzGtwgVJDuB/FDcESWcu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c26YVSxURlZW0ZTBTGWU5H7drMINragevr74hca6cm3A y9N7PsFxz7p1
pfIwbj0xDMNXiPf4bJigwtxCnrQxFBx1z7CDd6I9Pn5m7jkaWWzbvhbumGYT XvrU35lRhnFd
DtolD6nA49mLrYbLhBHUJYy90KMOUbm4Z2a+fuPVYaOw+wp1bNB1efZ7jptM 8KV2VApucyEo
mmyX8Z9PKgOtzg16aciSJXhCmlSMgYwXjrMlKBidk39QSwECFAAUAAAACACI ijw6dRNdO68E
AAChHQAADQAAAAAAAAABACAAAAAAAAAAamRzbC5nZW5tb2RlbFBLAQIUABQA AAAIAHaKPDrG
NdVKUAcAADg+AAAIAAAAAAAAAAEAIAAAANoEAABqZHNsLnVtbFBLAQIUABQA AAAIAISKPDqD
e42M5AMAAHAcAAAKAAAAAAAAAAEAIAAAAFAMAABqZHNsLmVjb3JlUEsBAhQA FAAAAAgAYJY8
OjOpalTVAAAAWgEAAAcAAAAAAAAAAQAgAAAAXBAAAG0xLmpkc2xQSwECFAAU AAAACADbmjw6
14auX98CAADLCgAADQAAAAAAAAABACAAAABWEQAAZXhjZXB0aW9uLnR4dFBL BQYAAAAABQAF
ABkBAABgFAAAAAA=
--------------070806030006080000070504--
Re: [RESOLVED] Loading a Resource fails [message #627352 is a reply to message #478145] Thu, 29 January 2009 21:13 Go to previous message
Hossam Karim is currently offline Hossam KarimFriend
Messages: 26
Registered: July 2009
Junior Member
Just in case someone faced the same problem, marking the superset
properties as transient will solve this problem.

Hossam Karim


On Wed, 28 Jan 2009 19:24:14 +0200, Hossam Karim <hossam.karim@gmail.com>
wrote:

> Hi everyone,
> I am having a similar problem although the subsetted properties are
> derived union. I am attaching the source UML model and the generated
> ecore and genmodel. I am able to use the editor to save but when loading
> the saved model I am getting the attached exception. I am using Eclipse
> 3.5M4.
>
>
> Timothy Marc wrote:
>> Dear Kenn,
>>
>> thanks, that was a good explanation concerning the list types. You
>> helped me a lot with this...
>>
>> Thx
>> Timothy
>>
>> "Kenn Hussey" <Kenn.Hussey@embarcadero.com
>> <mailto:Kenn.Hussey@embarcadero.com>> schrieb im Newsbeitrag
>> news:gdqavr$mgk$1@build.eclipse.org...
>> I would not expect to see a subset/superset list used in this case,
>> because the only subsets are subsets of derived unions which, by
>> definition, are derived and read-only, which means they are computed
>> on the fly. The subset/superset lists are only used for subset and
>> superset properties which aren't read-only, i.e., where modifiying
>> one list requires dynamically updating the other list. In the case
>> of derived unions, a new list is returned each time you ask for the
>> value of that feature, and it essentially provides a view onto the
>> subset lists (which, as in this case, may just be "normal" EMF
>> lists...).
>>
>> Kenn
>>
>> "Ed Merks" <Ed.Merks@gmail.com <mailto:Ed.Merks@gmail.com>>
>> wrote in message news:gdiagl$m5s$3@build.eclipse.org...
>> Timothy,
>>
>> These are really questions to direct to the UML2 newsgroup
>> because I just can't answer them from an EMF perspective. I'm
>> not sure there is any way in the IDE, given just an Ecore model,
>> to create an instance of UML's GenModel...
>>
>>
>> Timothy Marc wrote:
>>> But it is really strange, because obviously, the
>>> DerivedUnionEObjectList-Type is used... so, why is this
>>> Liste-Type used, but not the SubsetSuperset-one?
>>>
>>> "Timothy Marc" <timothymarc@freenet.de
>>> <mailto:timothymarc@freenet.de>> schrieb im Newsbeitrag
>>> news:gdi15h$9re$1@build.eclipse.org...
>>> Okay, and how can i use it explicitly. I didn't found any
>>> tutorial for it. Do you know some?
>>>
>>> "Ed Merks" <Ed.Merks@gmail.com
>>> <mailto:Ed.Merks@gmail.com>> schrieb im Newsbeitrag
>>> news:gdi10t$5nk$1@build.eclipse.org...
>>> Timothy,
>>>
>>> In order to generate the right things, you really have
>>> to be using UML's extended GenModel, which you'll only
>>> get if you specify your model using UML2 and import
>>> it. So it's not sufficient just to have an Ecore
>>> model with annotations just like the ones UML
>>> produces, you have to be using UML's extended GenModel
>>> for those annotations to be recognized...
>>>
>>>
>>> Timothy Marc wrote:
>>>> Ed,
>>>>
>>>> i've tried it with a reall simple model. It consists
>>>> only of the following elements:
>>>>
>>>> ModelElement
>>>> +owner:ModelElement (union)
>>>> +ownedElement:ModelElement (union)
>>>>
>>>> A : ModelElement
>>>> +theB :B (subsets +ownedElemend) -containment
>>>>
>>>> B : ModelElement
>>>> +theA:A (subsets +owner)
>>>>
>>>> and the Editor allows, to construct things like
>>>>
>>>> A
>>>> + B
>>>>
>>>> But the access fails with the message, that B is not
>>>> a legal value.
>>>>
>>>> It is wierd, because i thought, that the generator
>>>> should made use of the UML2-specific
>>>> SupersetSubsetEList-Type, for the subsetting
>>>> properties (annotated as subsets), as it made use of
>>>> the DerivedUnionEList-Type for the EReferences,
>>>> annotated as Unions. But instead of, it uses the
>>>> simple Ecore-List-Type.
>>>>
>>>> After your last post, i've tried a lot with these
>>>> annotations ans the code generation for UML2. I'm
>>>> confused right now, because I'm pretty sure, that, in
>>>> a former approach, the code generator exactly has
>>>> used this UML2-specific types. But now, everytime i
>>>> regenerate this simple model, it uses only the
>>>> EMF-specific one...
>>>>
>>>> I'm a bit frustrated currently, because i didn't get
>>>> forward with this problem...
>>>>
>>>> Timothy
>>>>
>>>> "Ed Merks" <Ed.Merks@gmail.com
>>>> <mailto:Ed.Merks@gmail.com>> schrieb im
>>>> Newsbeitrag news:gdhrs1$2du$1@build.eclipse.org...
>>>> Timothy,
>>>>
>>>> Comments below.
>>>>
>>>> Timothy Marc wrote:
>>>>> Ed,
>>>>>
>>>>> you were right. It was because of an invalid
>>>>> reference. However, this kind
>>>>> of reference was allowed by the generated
>>>>> editor. Currently, i'm playing a
>>>>> little bit with the UML2 codegenerator, in
>>>>> particular the
>>>>> Union/Subset-mechanism.
>>>>>
>>>> Hmmm. It should never allow you to construct an
>>>> instance that isn't sound. In fact, the
>>>> underlying model simply doesn't allow it, which
>>>> is why the deserializer is failing. Maybe you
>>>> just had two objects with the same ID or
>>>> something else that the validator could notice if
>>>> you invoked it?
>>>>> Thx
>>>>> Timothy
>>>>> "Timothy Marc" <timothymarc@freenet.de> schrieb
>>>>> im Newsbeitrag
>>>>> news:gdhhid$rqj$1@build.eclipse.org...
>>>>>
>>>>>> Hey all,
>>>>>>
>>>>>> i've a problem when i try to load a resource
>>>>>> programmatically. I think,
>>>>>> this is because of a missconfiguration of
>>>>>> ResourceFactories, but i didn't
>>>>>> get it work.
>>>>>>
>>>>>> The genmodel settings uses the None as Resource
>>>>>> Type. That works fine. But
>>>>>> when i try to load my model programmatically
>>>>>> via the following snippet:
>>>>>>
>>>>>> final ResourceSet resourceSet = new
>>>>>> ResourceSetImpl();
>>>>>> final Resource r =
>>>>>> resourceSet.getResource(uri,true);
>>>>>> final TestingModel model =
>>>>>> (TestingModel)r.getContents().get(0);
>>>>>>
>>>>>> it fails with the following exception:
>>>>>>
>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException:
>>>>>> org.eclipse.emf.ecore.xmi.IllegalValueException:
>>>>>> Value
>>>>>> 'testing.impl.PackageImpl@1325aef (id: null,
>>>>>> description: null, name:
>>>>>> pack)' is not legal.
>>>>>> (file:/D:/workspaces/esaWorkspace/testing.victoria/My.testin g,
>>>>>> -1, -1)
>>>>>> at
>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:316)
>>>>>> at
>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:275)
>>>>>> at
>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:398)
>>>>>> at
>>>>>> unit.UMLismTesting.test(UMLismTesting.java:28)
>>>>>> at
>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>> at
>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>>>>> at
>>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>>>>> at java.lang.reflect.Method.invoke(Unknown
>>>>>> Source)
>>>>>> at
>>>>>> org.junit.internal.runners.TestMethodRunner.executeMethodBod y(TestMethodRunner.java:99)
>>>>>> at
>>>>>> org.junit.internal.runners.TestMethodRunner.runUnprotected(T estMethodRunner.java:81)
>>>>>> at
>>>>>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAfterRunner.java:34)
>>>>>> at
>>>>>> org.junit.internal.runners.TestMethodRunner.runMethod(TestMe thodRunner.java:75)
>>>>>> at
>>>>>> org.junit.internal.runners.TestMethodRunner.run(TestMethodRu nner.java:45)
>>>>>> at
>>>>>> org.junit.internal.runners.TestClassMethodsRunner.invokeTest Method(TestClassMethodsRunner.java:66)
>>>>>> at
>>>>>> org.junit.internal.runners.TestClassMethodsRunner.run(TestCl assMethodsRunner.java:35)
>>>>>> at
>>>>>> org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunner.java:42)
>>>>>> at
>>>>>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAfterRunner.java:34)
>>>>>> at
>>>>>> org.junit.internal.runners.TestClassRunner.run(TestClassRunn er.java:52)
>>>>>> at
>>>>>> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.r un(JUnit4TestReference.java:38)
>>>>>> at
>>>>>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
>>>>>> at
>>>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)
>>>>>> at
>>>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
>>>>>> at
>>>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
>>>>>> at
>>>>>> org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunne r.main(RemotePluginTestRunner.java:58)
>>>>>> at
>>>>>> org.eclipse.pde.internal.junit.runtime.CoreTestApplication.r un(CoreTestApplication.java:24)
>>>>>> at
>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>> at
>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>>>>> at
>>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>>>>> at java.lang.reflect.Method.invoke(Unknown
>>>>>> Source)
>>>>>> at
>>>>>> org.eclipse.equinox.internal.app.EclipseAppContainer.callMet hod(EclipseAppContainer.java:572)
>>>>>> at
>>>>>> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:171)
>>>>>> at
>>>>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
>>>>>> at
>>>>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
>>>>>> at
>>>>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
>>>>>> at
>>>>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
>>>>>> at
>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>> at
>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>>>>> at
>>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>>>>> at java.lang.reflect.Method.invoke(Unknown
>>>>>> Source)
>>>>>> at
>>>>>> org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
>>>>>> at
>>>>>> org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
>>>>>> at
>>>>>> org.eclipse.equinox.launcher.Main.run(Main.java:1173)
>>>>>> at
>>>>>> org.eclipse.equinox.launcher.Main.main(Main.java:1148)
>>>>>> Caused by:
>>>>>> org.eclipse.emf.ecore.xmi.IllegalValueException: Value
>>>>>> 'testing.impl.PackageImpl@1325aef (id: null,
>>>>>> description: null, name:
>>>>>> pack)' is not legal.
>>>>>> (file:/D:/workspaces/esaWorkspace/testing.victoria/My.testin g,
>>>>>> -1, -1)
>>>>>> at
>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2535)
>>>>>> at
>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHandler.java:1098)
>>>>>> at
>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:1179)
>>>>>> at
>>>>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(Unknown
>>>>>> Source)
>>>>>> at
>>>>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
>>>>>> Source)
>>>>>> at
>>>>>> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
>>>>>> Source)
>>>>>> at
>>>>>> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
>>>>>> Source)
>>>>>> at
>>>>>> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
>>>>>> Source)
>>>>>> at
>>>>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
>>>>>> Source)
>>>>>> at
>>>>>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
>>>>>> Source)
>>>>>> at javax.xml.parsers.SAXParser.parse(Unknown
>>>>>> Source)
>>>>>> at
>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:179)
>>>>>> at
>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
>>>>>> at
>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1354)
>>>>>> at
>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1155)
>>>>>> at
>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:256)
>>>>>> at
>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:271)
>>>>>> ... 41 more
>>>>>> Caused by:
>>>>>> java.lang.UnsupportedOperationException
>>>>>> at
>>>>>> org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(DerivedEObjectEList.java:278)
>>>>>> at java.util.AbstractSequentialList.add(Unknown
>>>>>> Source)
>>>>>> at
>>>>>> org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObjectEList.java:660)
>>>>>> at
>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:1179)
>>>>>> at
>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2530)
>>>>>> ... 57 more
>>>>>>
>>>>>>
>>>>>> Can anyone help me? I think this is just a
>>>>>> configuration issue, isnt' it?
>>>>>>
>>>>>> Thx
>>>>>> Timothy
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>
Previous Topic:Submachine state instances and parameters
Next Topic:Redefinition
Goto Forum:
  


Current Time: Fri Mar 29 08:19:48 GMT 2024

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

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

Back to the top