Home » Modeling » EMF » [EMF][CDO] Problems with referencing EStructuralFeatures inside CDO Models
[EMF][CDO] Problems with referencing EStructuralFeatures inside CDO Models [message #662109] |
Tue, 29 March 2011 11:25 |
techteam Messages: 55 Registered: September 2010 |
Member |
|
|
Hi,
I have defined 2 Models, where Model A is my normal "Data"-Model and a
Model B, which is my "Support"-Model. Both are defined with the normal
Ecore editors and generated as Ecore model (CDO Native).
Inside my "Support"-Model I have non-containment references to
EAttributes, which are EAttributes from my "Data"-Model inside the
model instance.
While trying to import a Resource of my "Support"-Model instance into
the CDO Server, I get the following error message:
URI of the resource
(platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore) does not
match the nsURI (http://www.eclipse.org/emf/2002/Ecore) of the top-level
package;
this can be fixed by calling Resource.setURI(URI) after loading the
packages,
or by configuring a URI mapping from nsURI's to location URI's before
loading the packages,
and then loading them with their nsURI's
java.lang.IllegalStateException: URI of the resource
(platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore) does not
match the nsURI (http://www.eclipse.org/emf/2002/Ecore) of the top-level
package;
this can be fixed by calling Resource.setURI(URI) after loading the
packages,
or by configuring a URI mapping from nsURI's to location URI's before
loading the packages,
and then loading them with their nsURI's
at
org.eclipse.emf.cdo.common.model.CDOModelUtil.checkCrossReso urceURIs(CDOModelUtil.java:525)
at
org.eclipse.emf.cdo.common.model.CDOModelUtil.writePackage(C DOModelUtil.java:452)
at
org.eclipse.emf.cdo.internal.common.model.CDOPackageUnitImpl .write(CDOPackageUnitImpl.java:281)
at
org.eclipse.emf.cdo.internal.common.protocol.CDODataOutputIm pl.writeCDOPackageUnit(CDODataOutputImpl.java:81)
at
org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactio nRequest.requestingCommit(CommitTransactionRequest.java:141)
at
org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactio nRequest.requesting(CommitTransactionRequest.java:112)
at
org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientRequest WithMonitoring.requesting(CDOClientRequestWithMonitoring.jav a:92)
at org.eclipse.net4j.signal.RequestWithMonitoring.reque .....
....
....
I found inside the Ecore file of my "Support"-Model the following
definition:
<eClassifiers xsi:type="ecore:EClass" name="SupportAttributeDefinition">
<eOperations name="getLabel" eType="ecore:EDataType
platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//E String ">
<eParameters name="resultType" eType="#//ResultType"/>
</eOperations>
<eStructuralFeatures xsi:type="ecore:EAttribute"
name="englishLabel" eType="ecore:EDataType
platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//E String "/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="germanLabel"
eType="ecore:EDataType
platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//E String "/>
<eStructuralFeatures xsi:type="ecore:EReference"
name="refAttribute" lowerBound="1"
eType="ecore:EClass
platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//E Attribute "/>
</eClassifiers>
I try a rebuild of my model and import the runtime version of the Ecore
model instead of the development version.
Now I get the following error:
The object "org.eclipse.emf.ecore.impl.EAttributeImpl@847c91
(eProxyURI:
http://datamodel.de/2010/mcore#//eqk/Eqk/interest)(org.eclipse.emf.ecore.impl.EAttributeImpl)"
is not contained in a resource
org.eclipse.emf.cdo.util.DanglingReferenceException: The object
"org.eclipse.emf.ecore.impl.EAttributeImpl@847c91 (eProxyURI:
http://datamodel.de/2010/mcore#//eqk/Eqk/interest)(org.eclipse.emf.ecore.impl.EAttributeImpl)"
is not contained in a resource
at
org.eclipse.emf.internal.cdo.view.AbstractCDOView.provideCDO ID(AbstractCDOView.java:861)
at
org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. provideCDOID(CDOTransactionImpl.java:2016)
at
org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.writ eValues(BaseCDORevision.java:644)
at
org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.writ e(BaseCDORevision.java:181)
at
org.eclipse.emf.cdo.internal.common.protocol.CDODataOutputIm pl.writeCDORevision(CDODataOutputImpl.java:285)
at
org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactio nRequest.requesting...
....
....
Both models I have registered over the Register Filesystem Packages.
What have I to do, tha I can save the EAttributes inside a CDO repository?
Thanks in advance
Heiko
|
|
|
Re: [EMF][CDO] Problems with referencing EStructuralFeatures inside CDO Models [message #662251 is a reply to message #662109] |
Tue, 29 March 2011 21:13 |
|
Hi Heiko,
I'll be back from California next week. In case nobody else has looked at your issue until then I'll step up.
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Am 29.03.2011 04:25, schrieb Heiko:
> Hi,
>
> I have defined 2 Models, where Model A is my normal "Data"-Model and a Model B, which is my "Support"-Model. Both are defined with the normal Ecore editors and generated as Ecore model (CDO Native).
>
> Inside my "Support"-Model I have non-containment references to EAttributes, which are EAttributes from my "Data"-Model inside the model instance.
>
> While trying to import a Resource of my "Support"-Model instance into the CDO Server, I get the following error message:
>
> URI of the resource (platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore) does not match the nsURI (http://www.eclipse.org/emf/2002/Ecore) of the top-level package;
> this can be fixed by calling Resource.setURI(URI) after loading the packages,
> or by configuring a URI mapping from nsURI's to location URI's before loading the packages,
> and then loading them with their nsURI's
> java.lang.IllegalStateException: URI of the resource (platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore) does not match the nsURI (http://www.eclipse.org/emf/2002/Ecore) of the top-level package;
> this can be fixed by calling Resource.setURI(URI) after loading the packages,
> or by configuring a URI mapping from nsURI's to location URI's before loading the packages,
> and then loading them with their nsURI's
> at org.eclipse.emf.cdo.common.model.CDOModelUtil.checkCrossReso urceURIs(CDOModelUtil.java:525)
> at org.eclipse.emf.cdo.common.model.CDOModelUtil.writePackage(C DOModelUtil.java:452)
> at org.eclipse.emf.cdo.internal.common.model.CDOPackageUnitImpl .write(CDOPackageUnitImpl.java:281)
> at org.eclipse.emf.cdo.internal.common.protocol.CDODataOutputIm pl.writeCDOPackageUnit(CDODataOutputImpl.java:81)
> at org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactio nRequest.requestingCommit(CommitTransactionRequest.java:141)
> at org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactio nRequest.requesting(CommitTransactionRequest.java:112)
> at org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientRequest WithMonitoring.requesting(CDOClientRequestWithMonitoring.jav a:92)
> at org.eclipse.net4j.signal.RequestWithMonitoring.reque .....
> ...
> ...
>
>
> I found inside the Ecore file of my "Support"-Model the following definition:
>
> <eClassifiers xsi:type="ecore:EClass" name="SupportAttributeDefinition">
> <eOperations name="getLabel" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//E String ">
> <eParameters name="resultType" eType="#//ResultType"/>
> </eOperations>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="englishLabel" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//E String "/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="germanLabel" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//E String "/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="refAttribute" lowerBound="1"
> eType="ecore:EClass platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//E Attribute "/>
> </eClassifiers>
>
>
> I try a rebuild of my model and import the runtime version of the Ecore model instead of the development version.
>
>
> Now I get the following error:
>
> The object "org.eclipse.emf.ecore.impl.EAttributeImpl@847c91 (eProxyURI: http://datamodel.de/2010/mcore#//eqk/Eqk/interest)(org.eclipse.emf.ecore.impl.EAttributeImpl)" is not contained in a resource
> org.eclipse.emf.cdo.util.DanglingReferenceException: The object "org.eclipse.emf.ecore.impl.EAttributeImpl@847c91 (eProxyURI: http://datamodel.de/2010/mcore#//eqk/Eqk/interest)(org.eclipse.emf.ecore.impl.EAttributeImpl)" is not contained in a resource
> at org.eclipse.emf.internal.cdo.view.AbstractCDOView.provideCDO ID(AbstractCDOView.java:861)
> at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. provideCDOID(CDOTransactionImpl.java:2016)
> at org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.writ eValues(BaseCDORevision.java:644)
> at org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.writ e(BaseCDORevision.java:181)
> at org.eclipse.emf.cdo.internal.common.protocol.CDODataOutputIm pl.writeCDORevision(CDODataOutputImpl.java:285)
> at org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactio nRequest.requesting...
> ...
> ...
>
> Both models I have registered over the Register Filesystem Packages.
>
> What have I to do, tha I can save the EAttributes inside a CDO repository?
>
>
>
> Thanks in advance
>
> Heiko
>
>
>
>
>
>
>
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Re: [EMF][CDO] Problems with referencing EStructuralFeatures inside CDO Models [message #662255 is a reply to message #662251] |
Tue, 29 March 2011 21:32 |
Heiko Ahlig Messages: 62 Registered: July 2009 |
Member |
|
|
Hi Eike
thanks for your answer, I'll waiting for you. ;)
Have fun there!
Greetings
Heiko
Am 29.03.2011 23:13, schrieb Eike Stepper:
> Hi Heiko,
>
> I'll be back from California next week. In case nobody else has looked
> at your issue until then I'll step up.
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>
> Am 29.03.2011 04:25, schrieb Heiko:
>> Hi,
>>
>> I have defined 2 Models, where Model A is my normal "Data"-Model and a
>> Model B, which is my "Support"-Model. Both are defined with the normal
>> Ecore editors and generated as Ecore model (CDO Native).
>>
>> Inside my "Support"-Model I have non-containment references to
>> EAttributes, which are EAttributes from my "Data"-Model inside the
>> model instance.
>>
>> While trying to import a Resource of my "Support"-Model instance into
>> the CDO Server, I get the following error message:
>>
>> URI of the resource
>> (platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore) does not
>> match the nsURI (http://www.eclipse.org/emf/2002/Ecore) of the
>> top-level package;
>> this can be fixed by calling Resource.setURI(URI) after loading the
>> packages,
>> or by configuring a URI mapping from nsURI's to location URI's before
>> loading the packages,
>> and then loading them with their nsURI's
>> java.lang.IllegalStateException: URI of the resource
>> (platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore) does not
>> match the nsURI (http://www.eclipse.org/emf/2002/Ecore) of the
>> top-level package;
>> this can be fixed by calling Resource.setURI(URI) after loading the
>> packages,
>> or by configuring a URI mapping from nsURI's to location URI's before
>> loading the packages,
>> and then loading them with their nsURI's
>> at
>> org.eclipse.emf.cdo.common.model.CDOModelUtil.checkCrossReso urceURIs(CDOModelUtil.java:525)
>>
>> at
>> org.eclipse.emf.cdo.common.model.CDOModelUtil.writePackage(C DOModelUtil.java:452)
>>
>> at
>> org.eclipse.emf.cdo.internal.common.model.CDOPackageUnitImpl .write(CDOPackageUnitImpl.java:281)
>>
>> at
>> org.eclipse.emf.cdo.internal.common.protocol.CDODataOutputIm pl.writeCDOPackageUnit(CDODataOutputImpl.java:81)
>>
>> at
>> org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactio nRequest.requestingCommit(CommitTransactionRequest.java:141)
>>
>> at
>> org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactio nRequest.requesting(CommitTransactionRequest.java:112)
>>
>> at
>> org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientRequest WithMonitoring.requesting(CDOClientRequestWithMonitoring.jav a:92)
>>
>> at org.eclipse.net4j.signal.RequestWithMonitoring.reque .....
>> ...
>> ...
>>
>>
>> I found inside the Ecore file of my "Support"-Model the following
>> definition:
>>
>> <eClassifiers xsi:type="ecore:EClass" name="SupportAttributeDefinition">
>> <eOperations name="getLabel" eType="ecore:EDataType
>> platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//E String ">
>> <eParameters name="resultType" eType="#//ResultType"/>
>> </eOperations>
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="englishLabel"
>> eType="ecore:EDataType
>> platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//E String "/>
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="germanLabel"
>> eType="ecore:EDataType
>> platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//E String "/>
>> <eStructuralFeatures xsi:type="ecore:EReference" name="refAttribute"
>> lowerBound="1"
>> eType="ecore:EClass
>> platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//E Attribute "/>
>> </eClassifiers>
>>
>>
>> I try a rebuild of my model and import the runtime version of the
>> Ecore model instead of the development version.
>>
>>
>> Now I get the following error:
>>
>> The object "org.eclipse.emf.ecore.impl.EAttributeImpl@847c91
>> (eProxyURI:
>> http://datamodel.de/2010/mcore#//eqk/Eqk/interest)(org.eclipse.emf.ecore.impl.EAttributeImpl)"
>> is not contained in a resource
>> org.eclipse.emf.cdo.util.DanglingReferenceException: The object
>> "org.eclipse.emf.ecore.impl.EAttributeImpl@847c91 (eProxyURI:
>> http://datamodel.de/2010/mcore#//eqk/Eqk/interest)(org.eclipse.emf.ecore.impl.EAttributeImpl)"
>> is not contained in a resource
>> at
>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.provideCDO ID(AbstractCDOView.java:861)
>>
>> at
>> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. provideCDOID(CDOTransactionImpl.java:2016)
>>
>> at
>> org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.writ eValues(BaseCDORevision.java:644)
>>
>> at
>> org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.writ e(BaseCDORevision.java:181)
>>
>> at
>> org.eclipse.emf.cdo.internal.common.protocol.CDODataOutputIm pl.writeCDORevision(CDODataOutputImpl.java:285)
>>
>> at
>> org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactio nRequest.requesting...
>>
>> ...
>> ...
>>
>> Both models I have registered over the Register Filesystem Packages.
>>
>> What have I to do, tha I can save the EAttributes inside a CDO
>> repository?
>>
>>
>>
>> Thanks in advance
>>
>> Heiko
>>
>>
>>
>>
>>
>>
>>
|
|
|
Re: [EMF][CDO] Problems with referencing EStructuralFeatures inside CDO Models [message #664505 is a reply to message #662255] |
Sun, 10 April 2011 08:16 |
|
Hi Heiko,
It seems that our test case org.eclipse.emf.cdo.tests.MetaTest.testMetaReference2() is similar to what you want to achieve.
Please try the following:
1. Register your EPackage with the CDOSession's package registry
2. Create an instance of any of the concrete classes of your EPackage (needed to force the package to be committed)
3. Attach this instance to a resource in the context of a CDOTransaction
4. Commit this transaction (your package should now be mapped in the backend)
5. Use any EModelElement of your package as a reference target
Can you confirm that this works?
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Am 29.03.2011 23:32, schrieb Heiko Ahlig:
> Hi Eike
> thanks for your answer, I'll waiting for you. ;)
>
> Have fun there!
>
> Greetings
> Heiko
>
> Am 29.03.2011 23:13, schrieb Eike Stepper:
>> Hi Heiko,
>>
>> I'll be back from California next week. In case nobody else has looked
>> at your issue until then I'll step up.
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>
>> Am 29.03.2011 04:25, schrieb Heiko:
>>> Hi,
>>>
>>> I have defined 2 Models, where Model A is my normal "Data"-Model and a
>>> Model B, which is my "Support"-Model. Both are defined with the normal
>>> Ecore editors and generated as Ecore model (CDO Native).
>>>
>>> Inside my "Support"-Model I have non-containment references to
>>> EAttributes, which are EAttributes from my "Data"-Model inside the
>>> model instance.
>>>
>>> While trying to import a Resource of my "Support"-Model instance into
>>> the CDO Server, I get the following error message:
>>>
>>> URI of the resource
>>> (platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore) does not
>>> match the nsURI (http://www.eclipse.org/emf/2002/Ecore) of the
>>> top-level package;
>>> this can be fixed by calling Resource.setURI(URI) after loading the
>>> packages,
>>> or by configuring a URI mapping from nsURI's to location URI's before
>>> loading the packages,
>>> and then loading them with their nsURI's
>>> java.lang.IllegalStateException: URI of the resource
>>> (platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore) does not
>>> match the nsURI (http://www.eclipse.org/emf/2002/Ecore) of the
>>> top-level package;
>>> this can be fixed by calling Resource.setURI(URI) after loading the
>>> packages,
>>> or by configuring a URI mapping from nsURI's to location URI's before
>>> loading the packages,
>>> and then loading them with their nsURI's
>>> at
>>> org.eclipse.emf.cdo.common.model.CDOModelUtil.checkCrossReso urceURIs(CDOModelUtil.java:525)
>>>
>>> at
>>> org.eclipse.emf.cdo.common.model.CDOModelUtil.writePackage(C DOModelUtil.java:452)
>>>
>>> at
>>> org.eclipse.emf.cdo.internal.common.model.CDOPackageUnitImpl .write(CDOPackageUnitImpl.java:281)
>>>
>>> at
>>> org.eclipse.emf.cdo.internal.common.protocol.CDODataOutputIm pl.writeCDOPackageUnit(CDODataOutputImpl.java:81)
>>>
>>> at
>>> org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactio nRequest.requestingCommit(CommitTransactionRequest.java:141)
>>>
>>> at
>>> org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactio nRequest.requesting(CommitTransactionRequest.java:112)
>>>
>>> at
>>> org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientRequest WithMonitoring.requesting(CDOClientRequestWithMonitoring.jav a:92)
>>>
>>> at org.eclipse.net4j.signal.RequestWithMonitoring.reque .....
>>> ...
>>> ...
>>>
>>>
>>> I found inside the Ecore file of my "Support"-Model the following
>>> definition:
>>>
>>> <eClassifiers xsi:type="ecore:EClass" name="SupportAttributeDefinition">
>>> <eOperations name="getLabel" eType="ecore:EDataType
>>> platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//E String ">
>>> <eParameters name="resultType" eType="#//ResultType"/>
>>> </eOperations>
>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="englishLabel"
>>> eType="ecore:EDataType
>>> platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//E String "/>
>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="germanLabel"
>>> eType="ecore:EDataType
>>> platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//E String "/>
>>> <eStructuralFeatures xsi:type="ecore:EReference" name="refAttribute"
>>> lowerBound="1"
>>> eType="ecore:EClass
>>> platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//E Attribute "/>
>>> </eClassifiers>
>>>
>>>
>>> I try a rebuild of my model and import the runtime version of the
>>> Ecore model instead of the development version.
>>>
>>>
>>> Now I get the following error:
>>>
>>> The object "org.eclipse.emf.ecore.impl.EAttributeImpl@847c91
>>> (eProxyURI:
>>> http://datamodel.de/2010/mcore#//eqk/Eqk/interest)(org.eclipse.emf.ecore.impl.EAttributeImpl)"
>>> is not contained in a resource
>>> org.eclipse.emf.cdo.util.DanglingReferenceException: The object
>>> "org.eclipse.emf.ecore.impl.EAttributeImpl@847c91 (eProxyURI:
>>> http://datamodel.de/2010/mcore#//eqk/Eqk/interest)(org.eclipse.emf.ecore.impl.EAttributeImpl)"
>>> is not contained in a resource
>>> at
>>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.provideCDO ID(AbstractCDOView.java:861)
>>>
>>> at
>>> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. provideCDOID(CDOTransactionImpl.java:2016)
>>>
>>> at
>>> org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.writ eValues(BaseCDORevision.java:644)
>>>
>>> at
>>> org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.writ e(BaseCDORevision.java:181)
>>>
>>> at
>>> org.eclipse.emf.cdo.internal.common.protocol.CDODataOutputIm pl.writeCDORevision(CDODataOutputImpl.java:285)
>>>
>>> at
>>> org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactio nRequest.requesting...
>>>
>>> ...
>>> ...
>>>
>>> Both models I have registered over the Register Filesystem Packages.
>>>
>>> What have I to do, tha I can save the EAttributes inside a CDO
>>> repository?
>>>
>>>
>>>
>>> Thanks in advance
>>>
>>> Heiko
>>>
>>>
>>>
>>>
>>>
>>>
>>>
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Re: [EMF][CDO] Problems with referencing EStructuralFeatures inside CDO Models [message #665700 is a reply to message #664505] |
Fri, 15 April 2011 14:05 |
techteam Messages: 55 Registered: September 2010 |
Member |
|
|
Hi Eike,
thanks for your tip - it works very well.
Greetings
Heiko
Am 10.04.2011 10:16, schrieb Eike Stepper:
> Hi Heiko,
>
> It seems that our test case
> org.eclipse.emf.cdo.tests.MetaTest.testMetaReference2() is similar to
> what you want to achieve.
>
> Please try the following:
>
> 1. Register your EPackage with the CDOSession's package registry
> 2. Create an instance of any of the concrete classes of your EPackage
> (needed to force the package to be committed)
> 3. Attach this instance to a resource in the context of a CDOTransaction
> 4. Commit this transaction (your package should now be mapped in the
> backend)
> 5. Use any EModelElement of your package as a reference target
>
> Can you confirm that this works?
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>
> Am 29.03.2011 23:32, schrieb Heiko Ahlig:
>> Hi Eike
>> thanks for your answer, I'll waiting for you. ;)
>>
>> Have fun there!
>>
>> Greetings
>> Heiko
>>
>> Am 29.03.2011 23:13, schrieb Eike Stepper:
>>> Hi Heiko,
>>>
>>> I'll be back from California next week. In case nobody else has looked
>>> at your issue until then I'll step up.
>>>
>>> Cheers
>>> /Eike
>>>
>>> ----
>>> http://www.esc-net.de
>>> http://thegordian.blogspot.com
>>> http://twitter.com/eikestepper
>>>
>>>
>>>
>>> Am 29.03.2011 04:25, schrieb Heiko:
>>>> Hi,
>>>>
>>>> I have defined 2 Models, where Model A is my normal "Data"-Model and a
>>>> Model B, which is my "Support"-Model. Both are defined with the normal
>>>> Ecore editors and generated as Ecore model (CDO Native).
>>>>
>>>> Inside my "Support"-Model I have non-containment references to
>>>> EAttributes, which are EAttributes from my "Data"-Model inside the
>>>> model instance.
>>>>
>>>> While trying to import a Resource of my "Support"-Model instance into
>>>> the CDO Server, I get the following error message:
>>>>
>>>> URI of the resource
>>>> (platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore) does not
>>>> match the nsURI (http://www.eclipse.org/emf/2002/Ecore) of the
>>>> top-level package;
>>>> this can be fixed by calling Resource.setURI(URI) after loading the
>>>> packages,
>>>> or by configuring a URI mapping from nsURI's to location URI's before
>>>> loading the packages,
>>>> and then loading them with their nsURI's
>>>> java.lang.IllegalStateException: URI of the resource
>>>> (platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore) does not
>>>> match the nsURI (http://www.eclipse.org/emf/2002/Ecore) of the
>>>> top-level package;
>>>> this can be fixed by calling Resource.setURI(URI) after loading the
>>>> packages,
>>>> or by configuring a URI mapping from nsURI's to location URI's before
>>>> loading the packages,
>>>> and then loading them with their nsURI's
>>>> at
>>>> org.eclipse.emf.cdo.common.model.CDOModelUtil.checkCrossReso urceURIs(CDOModelUtil.java:525)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.common.model.CDOModelUtil.writePackage(C DOModelUtil.java:452)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.internal.common.model.CDOPackageUnitImpl .write(CDOPackageUnitImpl.java:281)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.internal.common.protocol.CDODataOutputIm pl.writeCDOPackageUnit(CDODataOutputImpl.java:81)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactio nRequest.requestingCommit(CommitTransactionRequest.java:141)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactio nRequest.requesting(CommitTransactionRequest.java:112)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientRequest WithMonitoring.requesting(CDOClientRequestWithMonitoring.jav a:92)
>>>>
>>>>
>>>> at org.eclipse.net4j.signal.RequestWithMonitoring.reque .....
>>>> ...
>>>> ...
>>>>
>>>>
>>>> I found inside the Ecore file of my "Support"-Model the following
>>>> definition:
>>>>
>>>> <eClassifiers xsi:type="ecore:EClass"
>>>> name="SupportAttributeDefinition">
>>>> <eOperations name="getLabel" eType="ecore:EDataType
>>>> platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//E String ">
>>>> <eParameters name="resultType" eType="#//ResultType"/>
>>>> </eOperations>
>>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="englishLabel"
>>>> eType="ecore:EDataType
>>>> platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//E String "/>
>>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="germanLabel"
>>>> eType="ecore:EDataType
>>>> platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//E String "/>
>>>> <eStructuralFeatures xsi:type="ecore:EReference" name="refAttribute"
>>>> lowerBound="1"
>>>> eType="ecore:EClass
>>>> platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//E Attribute "/>
>>>>
>>>> </eClassifiers>
>>>>
>>>>
>>>> I try a rebuild of my model and import the runtime version of the
>>>> Ecore model instead of the development version.
>>>>
>>>>
>>>> Now I get the following error:
>>>>
>>>> The object "org.eclipse.emf.ecore.impl.EAttributeImpl@847c91
>>>> (eProxyURI:
>>>> http://datamodel.de/2010/mcore#//eqk/Eqk/interest)(org.eclipse.emf.ecore.impl.EAttributeImpl)"
>>>>
>>>> is not contained in a resource
>>>> org.eclipse.emf.cdo.util.DanglingReferenceException: The object
>>>> "org.eclipse.emf.ecore.impl.EAttributeImpl@847c91 (eProxyURI:
>>>> http://datamodel.de/2010/mcore#//eqk/Eqk/interest)(org.eclipse.emf.ecore.impl.EAttributeImpl)"
>>>>
>>>> is not contained in a resource
>>>> at
>>>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.provideCDO ID(AbstractCDOView.java:861)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. provideCDOID(CDOTransactionImpl.java:2016)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.writ eValues(BaseCDORevision.java:644)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.writ e(BaseCDORevision.java:181)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.internal.common.protocol.CDODataOutputIm pl.writeCDORevision(CDODataOutputImpl.java:285)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactio nRequest.requesting...
>>>>
>>>>
>>>> ...
>>>> ...
>>>>
>>>> Both models I have registered over the Register Filesystem Packages.
>>>>
>>>> What have I to do, tha I can save the EAttributes inside a CDO
>>>> repository?
>>>>
>>>>
>>>>
>>>> Thanks in advance
>>>>
>>>> Heiko
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
|
|
|
Re: [EMF][CDO] Problems with referencing EStructuralFeatures inside CDO Models [message #665703 is a reply to message #665700] |
Fri, 15 April 2011 14:18 |
|
Am 15.04.2011 16:05, schrieb Heiko:
> Hi Eike,
> thanks for your tip - it works very well.
Good to hear that it works. I'm sorry that we can currently not offer a simlper way, one that does not require the dummy object.
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
>
> Greetings
> Heiko
>
> Am 10.04.2011 10:16, schrieb Eike Stepper:
>> Hi Heiko,
>>
>> It seems that our test case
>> org.eclipse.emf.cdo.tests.MetaTest.testMetaReference2() is similar to
>> what you want to achieve.
>>
>> Please try the following:
>>
>> 1. Register your EPackage with the CDOSession's package registry
>> 2. Create an instance of any of the concrete classes of your EPackage
>> (needed to force the package to be committed)
>> 3. Attach this instance to a resource in the context of a CDOTransaction
>> 4. Commit this transaction (your package should now be mapped in the
>> backend)
>> 5. Use any EModelElement of your package as a reference target
>>
>> Can you confirm that this works?
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>
>> Am 29.03.2011 23:32, schrieb Heiko Ahlig:
>>> Hi Eike
>>> thanks for your answer, I'll waiting for you. ;)
>>>
>>> Have fun there!
>>>
>>> Greetings
>>> Heiko
>>>
>>> Am 29.03.2011 23:13, schrieb Eike Stepper:
>>>> Hi Heiko,
>>>>
>>>> I'll be back from California next week. In case nobody else has looked
>>>> at your issue until then I'll step up.
>>>>
>>>> Cheers
>>>> /Eike
>>>>
>>>> ----
>>>> http://www.esc-net.de
>>>> http://thegordian.blogspot.com
>>>> http://twitter.com/eikestepper
>>>>
>>>>
>>>>
>>>> Am 29.03.2011 04:25, schrieb Heiko:
>>>>> Hi,
>>>>>
>>>>> I have defined 2 Models, where Model A is my normal "Data"-Model and a
>>>>> Model B, which is my "Support"-Model. Both are defined with the normal
>>>>> Ecore editors and generated as Ecore model (CDO Native).
>>>>>
>>>>> Inside my "Support"-Model I have non-containment references to
>>>>> EAttributes, which are EAttributes from my "Data"-Model inside the
>>>>> model instance.
>>>>>
>>>>> While trying to import a Resource of my "Support"-Model instance into
>>>>> the CDO Server, I get the following error message:
>>>>>
>>>>> URI of the resource
>>>>> (platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore) does not
>>>>> match the nsURI (http://www.eclipse.org/emf/2002/Ecore) of the
>>>>> top-level package;
>>>>> this can be fixed by calling Resource.setURI(URI) after loading the
>>>>> packages,
>>>>> or by configuring a URI mapping from nsURI's to location URI's before
>>>>> loading the packages,
>>>>> and then loading them with their nsURI's
>>>>> java.lang.IllegalStateException: URI of the resource
>>>>> (platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore) does not
>>>>> match the nsURI (http://www.eclipse.org/emf/2002/Ecore) of the
>>>>> top-level package;
>>>>> this can be fixed by calling Resource.setURI(URI) after loading the
>>>>> packages,
>>>>> or by configuring a URI mapping from nsURI's to location URI's before
>>>>> loading the packages,
>>>>> and then loading them with their nsURI's
>>>>> at
>>>>> org.eclipse.emf.cdo.common.model.CDOModelUtil.checkCrossReso urceURIs(CDOModelUtil.java:525)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.common.model.CDOModelUtil.writePackage(C DOModelUtil.java:452)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.common.model.CDOPackageUnitImpl .write(CDOPackageUnitImpl.java:281)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.common.protocol.CDODataOutputIm pl.writeCDOPackageUnit(CDODataOutputImpl.java:81)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactio nRequest.requestingCommit(CommitTransactionRequest.java:141)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactio nRequest.requesting(CommitTransactionRequest.java:112)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientRequest WithMonitoring.requesting(CDOClientRequestWithMonitoring.jav a:92)
>>>>>
>>>>>
>>>>> at org.eclipse.net4j.signal.RequestWithMonitoring.reque .....
>>>>> ...
>>>>> ...
>>>>>
>>>>>
>>>>> I found inside the Ecore file of my "Support"-Model the following
>>>>> definition:
>>>>>
>>>>> <eClassifiers xsi:type="ecore:EClass"
>>>>> name="SupportAttributeDefinition">
>>>>> <eOperations name="getLabel" eType="ecore:EDataType
>>>>> platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//E String ">
>>>>> <eParameters name="resultType" eType="#//ResultType"/>
>>>>> </eOperations>
>>>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="englishLabel"
>>>>> eType="ecore:EDataType
>>>>> platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//E String "/>
>>>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="germanLabel"
>>>>> eType="ecore:EDataType
>>>>> platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//E String "/>
>>>>> <eStructuralFeatures xsi:type="ecore:EReference" name="refAttribute"
>>>>> lowerBound="1"
>>>>> eType="ecore:EClass
>>>>> platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//E Attribute "/>
>>>>>
>>>>> </eClassifiers>
>>>>>
>>>>>
>>>>> I try a rebuild of my model and import the runtime version of the
>>>>> Ecore model instead of the development version.
>>>>>
>>>>>
>>>>> Now I get the following error:
>>>>>
>>>>> The object "org.eclipse.emf.ecore.impl.EAttributeImpl@847c91
>>>>> (eProxyURI:
>>>>> http://datamodel.de/2010/mcore#//eqk/Eqk/interest)(org.eclipse.emf.ecore.impl.EAttributeImpl)"
>>>>>
>>>>> is not contained in a resource
>>>>> org.eclipse.emf.cdo.util.DanglingReferenceException: The object
>>>>> "org.eclipse.emf.ecore.impl.EAttributeImpl@847c91 (eProxyURI:
>>>>> http://datamodel.de/2010/mcore#//eqk/Eqk/interest)(org.eclipse.emf.ecore.impl.EAttributeImpl)"
>>>>>
>>>>> is not contained in a resource
>>>>> at
>>>>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.provideCDO ID(AbstractCDOView.java:861)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. provideCDOID(CDOTransactionImpl.java:2016)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.writ eValues(BaseCDORevision.java:644)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.writ e(BaseCDORevision.java:181)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.common.protocol.CDODataOutputIm pl.writeCDORevision(CDODataOutputImpl.java:285)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactio nRequest.requesting...
>>>>>
>>>>>
>>>>> ...
>>>>> ...
>>>>>
>>>>> Both models I have registered over the Register Filesystem Packages.
>>>>>
>>>>> What have I to do, tha I can save the EAttributes inside a CDO
>>>>> repository?
>>>>>
>>>>>
>>>>>
>>>>> Thanks in advance
>>>>>
>>>>> Heiko
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Goto Forum:
Current Time: Fri Apr 19 19:40:17 GMT 2024
Powered by FUDForum. Page generated in 0.03689 seconds
|