Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMF Facet] Serialization mechanisms / CDO integration
[EMF Facet] Serialization mechanisms / CDO integration [message #778599] Fri, 13 January 2012 13:27 Go to next message
Victor Roldan Betancort is currently offline Victor Roldan BetancortFriend
Messages: 524
Registered: July 2009
Senior Member
Hi there,

I've been taking a look at the EMF Facet API, and created a simple test
to add some new features to the good ol' library model example. My aim
is to test how the EMF Facet framework behaves when dealing with objects
stored in a CDO repository. My test ends up with a
"DanglingRefernceException":

Caused by: org.eclipse.emf.cdo.util.DanglingReferenceException: The
object "org.eclipse.emf.ecore.impl.EAttributeImpl@4f806802 (name:
location) (ordered: true, unique: true, lowerBound: 0, upperBound: 1)
(changeable: true, volatile: false, transient: false,
defaultValueLiteral: null, unsettable: false, derived: false) (iD:
false)(org.eclipse.emf.ecore.impl.EAttributeImpl)" is not contained in a
resource

According to the exception, the EAttribute is not contained in the
resource. Inspecting a bit shows me the new metadata is added as a new
root to the resource passed to the FacetManager. So, just to have an
overall idea on how the new data is stored: is it structured as a
decorator (pointing to the "faceted" model), both having metadata
definition and actual data?

Cheers,
Víctor.
Re: [EMF Facet] Serialization mechanisms / CDO integration [message #779696 is a reply to message #778599] Mon, 16 January 2012 10:45 Go to previous messageGo to next message
Gregoire Dupe is currently offline Gregoire DupeFriend
Messages: 75
Registered: September 2009
Location: France
Member
Hello,

We never tried to use EMF Facet with CDO.

Can you send me a full stack trace? This will help me to understand what is appending.
Please, Can you tell me which version of EMF Facet you are using?

> So, just to have an overall idea on how the new data is stored: is it structured as a decorator (pointing to the "faceted" model), both having metadata definition and actual data?

Yes, you're right. Currently, no documentation about the feature is written. This will be done for the beginning of May.


Regards,
Grégoire

Re: [EMF Facet] Serialization mechanisms / CDO integration [message #779737 is a reply to message #779696] Mon, 16 January 2012 12:38 Go to previous messageGo to next message
Victor Roldan Betancort is currently offline Victor Roldan BetancortFriend
Messages: 524
Registered: July 2009
Senior Member
Gregoire,

comments below,

> We never tried to use EMF Facet with CDO.

thanks for your feedback. I currently have some tests created. If you
want, I can send you so you can reproduce it.

Right now it looks more as an issue in the CDO side than in the EMF
Facet side. I'm going to investigate on the issue a bit.

>> Can you send me a full stack trace? This will help me to understand what
>> is appending.

org.eclipse.net4j.util.transaction.TransactionException:
org.eclipse.emf.cdo.util.CommitException:
org.eclipse.emf.cdo.util.DanglingReferenceException: The object
"org.eclipse.emf.ecore.impl.EAttributeImpl@638e8fbd (name: location)
(ordered: true, unique: true, lowerBound: 0, upperBound: 1) (changeable:
true, volatile: false, transient: false, defaultValueLiteral: null,
unsettable: false, derived: false) (iD:
false)(org.eclipse.emf.ecore.impl.EAttributeImpl)" is not contained in a
resource
at
org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl.save(CDOResourceImpl.java:959)
at
org.eclipse.emf.facet.efacet.core.internal.serialization.SerializationManager.saveStructuralFeatureInstanceModel(SerializationManager.java:230)
at
org.eclipse.emf.facet.efacet.core.internal.FacetManager.saveStructuralFeatureInstanceModel(FacetManager.java:62)
at
com.opencanarias.mset.prototype.facets.FacetTest.testFacet(FacetTest.java:51)
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.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at
org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62)
at
org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:23)
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.callMethodWithException(EclipseAppContainer.java:587)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
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:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Caused by: org.eclipse.emf.cdo.util.CommitException:
org.eclipse.emf.cdo.util.DanglingReferenceException: The object
"org.eclipse.emf.ecore.impl.EAttributeImpl@638e8fbd (name: location)
(ordered: true, unique: true, lowerBound: 0, upperBound: 1) (changeable:
true, volatile: false, transient: false, defaultValueLiteral: null,
unsettable: false, derived: false) (iD:
false)(org.eclipse.emf.ecore.impl.EAttributeImpl)" is not contained in a
resource
at
org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1083)
at
org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl.save(CDOResourceImpl.java:955)
... 48 more
Caused by: org.eclipse.emf.cdo.util.DanglingReferenceException: The
object "org.eclipse.emf.ecore.impl.EAttributeImpl@638e8fbd (name:
location) (ordered: true, unique: true, lowerBound: 0, upperBound: 1)
(changeable: true, volatile: false, transient: false,
defaultValueLiteral: null, unsettable: false, derived: false) (iD:
false)(org.eclipse.emf.ecore.impl.EAttributeImpl)" is not contained in a
resource
at
org.eclipse.emf.internal.cdo.view.AbstractCDOView.provideCDOID(AbstractCDOView.java:899)
at
org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.provideCDOID(CDOTransactionImpl.java:2046)
at
org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.writeValues(BaseCDORevision.java:690)
at
org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.write(BaseCDORevision.java:181)
at
org.eclipse.emf.cdo.internal.common.protocol.CDODataOutputImpl.writeCDORevision(CDODataOutputImpl.java:285)
at
org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactionRequest.requestingCommit(CommitTransactionRequest.java:151)
at
org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactionRequest.requesting(CommitTransactionRequest.java:112)
at
org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientRequestWithMonitoring.requesting(CDOClientRequestWithMonitoring.java:91)
at
org.eclipse.net4j.signal.RequestWithMonitoring.requesting(RequestWithMonitoring.java:163)
at
org.eclipse.net4j.signal.RequestWithConfirmation.doExtendedOutput(RequestWithConfirmation.java:117)
at org.eclipse.net4j.signal.Signal.doOutput(Signal.java:296)
at
org.eclipse.net4j.signal.RequestWithConfirmation.doExecute(RequestWithConfirmation.java:102)
at
org.eclipse.net4j.signal.RequestWithMonitoring.doExecute(RequestWithMonitoring.java:233)
at org.eclipse.net4j.signal.SignalActor.execute(SignalActor.java:51)
at org.eclipse.net4j.signal.Signal.runSync(Signal.java:251)
at
org.eclipse.net4j.signal.SignalProtocol.startSignal(SignalProtocol.java:419)
at
org.eclipse.net4j.signal.RequestWithConfirmation.doSend(RequestWithConfirmation.java:87)
at
org.eclipse.net4j.signal.RequestWithConfirmation.send(RequestWithConfirmation.java:73)
at
org.eclipse.net4j.signal.RequestWithMonitoring.send(RequestWithMonitoring.java:108)
at
org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.send(CDOClientProtocol.java:426)
at
org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.commitTransaction(CDOClientProtocol.java:308)
at
org.eclipse.emf.internal.cdo.transaction.CDOSingleTransactionStrategyImpl.commit(CDOSingleTransactionStrategyImpl.java:80)
at
org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1069)
... 49 more

>> Please, Can you tell me which version of EMF Facet you are using?

I'm using HEAD from the SVN repository.

>> So, just to have an overall idea on how the new data is stored: is it
>> structured as a decorator (pointing to the "faceted" model), both
>> having metadata definition and actual data?
>
> Yes, you're right. Currently, no documentation about the feature is
> written. This will be done for the beginning of May.

Good, looking forward ;)

Cheers!
Víctor
Re: [EMF Facet] Serialization mechanisms / CDO integration [message #782155 is a reply to message #779737] Mon, 23 January 2012 09:25 Go to previous messageGo to next message
Gregoire Dupe is currently offline Gregoire DupeFriend
Messages: 75
Registered: September 2009
Location: France
Member
Hello,

> org.eclipse.emf.facet.efacet.core.internal.FacetManager.saveStructuralFeatureInstanceModel(FacetManager.java:62)

The stacktrace show that the error appends when you try to save the resource containing the facet/additional data.

This is quite strange because the resource should not contain any EAttribute. Is the used facet set attached a dedicated resource?

Regards,
Grégoire
Re: [EMF Facet] Serialization mechanisms / CDO integration [message #782766 is a reply to message #782155] Tue, 24 January 2012 11:56 Go to previous messageGo to next message
Victor Roldan Betancort is currently offline Victor Roldan BetancortFriend
Messages: 524
Registered: July 2009
Senior Member
Gregoire,

> The stacktrace show that the error appends when you try to save the
> resource containing the facet/additional data.
>
> This is quite strange because the resource should not contain any
> EAttribute. Is the used facet set attached a dedicated resource?


Yes, it is included in a dedicated resource.


The test-case looks like this:

EObject eObject =
getObjectCDOIfied(ModelTestUtils.getTestResource(TEST_MODEL_2_URI));
CDOObject cdoObject = CDOUtil.getCDOObject(eObject);

// Persist FacetSet
FacetSet facetSet = getFacetSet();
CDOResource facetResource = getNewResource();
facetResource.getContents().add(facetSet);
((CDOTransaction)facetResource.cdoView()).commit();
CDOObject wrappedFacetSet = CDOUtil.getCDOObject(facetSet);

// Create new data corresponding to our new Facet
Facet facet = FacetUtils.getFacet(facetSet, TEST_FACET_NAME);
EAttribute attribute = FacetUtils.getEAttribute(facet,
TEST_FACET_ATTRIBUTE_NAME);
IFacetManager facetManager =
IFacetManagerFactory.INSTANCE.createFacetManager(cdoObject.eResource());
facetManager.set(cdoObject, attribute, "Santa Cruz");
facetManager.saveStructuralFeatureInstanceModel();
String location = facetManager.get(cdoObject, attribute, String.class);
assertEquals("Santa Cruz", location);
Re: [EMF Facet] Serialization mechanisms / CDO integration [message #800058 is a reply to message #782766] Thu, 16 February 2012 16:31 Go to previous messageGo to next message
Gregoire Dupe is currently offline Gregoire DupeFriend
Messages: 75
Registered: September 2009
Location: France
Member
Hello,

I'm really sorry but I'm too busy to spend time to debug this problem. Furthermore, we do not plan to support the use of EMF Facet with CDO in the version 0.2 of EMF Facet.

If you success to solve the problem by your own, we would be really happy to read about that.

Regards,
Grégoire
Re: [EMF Facet] Serialization mechanisms / CDO integration [message #805396 is a reply to message #800058] Thu, 23 February 2012 18:04 Go to previous message
Victor Roldan Betancort is currently offline Victor Roldan BetancortFriend
Messages: 524
Registered: July 2009
Senior Member
Gregoire,

thanks for letting me know, although I don't recall asking for a fix but
rather some general information about EMF Facet.

We already discarded EMF Facet and built our own solution, thanks anyway!

Víctor

Gregoire Dupe escribió:
> Hello,
>
> I'm really sorry but I'm too busy to spend time to debug this problem.
> Furthermore, we do not plan to support the use of EMF Facet with CDO in
> the version 0.2 of EMF Facet.
>
> If you success to solve the problem by your own, we would be really
> happy to read about that.
>
> Regards,
> Grégoire
Previous Topic:[XCORE] Feedback from tutorial
Next Topic:[Texo] Hibernate Search example
Goto Forum:
  


Current Time: Fri Apr 19 17:11:52 GMT 2024

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

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

Back to the top