Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » EMF Compare problem comparing instances
EMF Compare problem comparing instances [message #622547] Mon, 03 May 2010 12:56 Go to next message
Johannes Albrecht is currently offline Johannes Albrecht
Messages: 4
Registered: May 2010
Junior Member
Hi,

I've got a problem when comparing instances with EMF Compare.
We created some dynamic instances of our meta model with the 'Create dynamic instances...' dialog of the sample ecore editor.
If I compare instances with EMF Compare, I'll always get error messages like 'The feature 'name' is not a valid feature' when expanding the tree in the top part of the compare editor.

Does EMF Compare work with dynamic instances or do I have to generate the code from the meta model? If I generate the code it works fine, but I would rather prefer to work with dynamic instances.

Could it be, that the meta model wasn't loaded correctly?


Here is the stack trace:

java.lang.IllegalArgumentException: The feature 'name' is not a valid feature
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eOpenGet(BasicEO bjectImpl.java:1064)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:1017)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:1005)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:1000)
at org.eclipse.emf.compare.diff.provider.UpdateAttributeItemPro vider.getText(UpdateAttributeItemProvider.java:98)
at org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider .getText(AdapterFactoryLabelProvider.java:380)
at org.eclipse.emf.compare.ui.viewer.structure.ModelStructureMe rgeViewer$ModelStructureLabelProvider.getText(ModelStructure MergeViewer.java:394)
at org.eclipse.jface.viewers.WrappedViewerLabelProvider.getText (WrappedViewerLabelProvider.java:108)
at org.eclipse.jface.viewers.WrappedViewerLabelProvider.update( WrappedViewerLabelProvider.java:164)
at org.eclipse.jface.viewers.ViewerColumn.refresh(ViewerColumn. java:145)
at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(Ab stractTreeViewer.java:932)
at org.eclipse.jface.viewers.AbstractTreeViewer$UpdateItemSafeR unnable.run(AbstractTreeViewer.java:102)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.runtime.Platform.run(Platform.java:888)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(Ab stractTreeViewer.java:1012)
at org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRun nable.run(StructuredViewer.java:481)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.runtime.Platform.run(Platform.java:888)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at org.eclipse.jface.viewers.StructuredViewer.updateItem(Struct uredViewer.java:2111)
at org.eclipse.jface.viewers.AbstractTreeViewer.createTreeItem( AbstractTreeViewer.java:827)
at org.eclipse.jface.viewers.AbstractTreeViewer$1.run(AbstractT reeViewer.java:802)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren( AbstractTreeViewer.java:776)
at org.eclipse.jface.viewers.TreeViewer.createChildren(TreeView er.java:639)
at org.eclipse.jface.viewers.AbstractTreeViewer.handleTreeExpan d(AbstractTreeViewer.java:1442)
at org.eclipse.jface.viewers.TreeViewer.handleTreeExpand(TreeVi ewer.java:937)
at org.eclipse.jface.viewers.AbstractTreeViewer$4.treeExpanded( AbstractTreeViewer.java:1453)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:126)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1012)
at org.eclipse.swt.widgets.Tree.wmNotifyChild(Tree.java:7349)
at org.eclipse.swt.widgets.Control.wmNotify(Control.java:4877)
at org.eclipse.swt.widgets.Composite.wmNotify(Composite.java:17 57)
at org.eclipse.swt.widgets.Control.WM_NOTIFY(Control.java:4507)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4000 )
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4589 )
at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method)
at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:231 3)
at org.eclipse.swt.widgets.Tree.callWindowProc(Tree.java:1530)
at org.eclipse.swt.widgets.Tree.WM_LBUTTONDOWN(Tree.java:6280)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:3981 )
at org.eclipse.swt.widgets.Tree.windowProc(Tree.java:5821)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4602 )
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:24 10)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3471)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:194)
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(EclipseS tarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
at org.eclipse.equinox.launcher.Main.main(Main.java:1287)#



Thanks in advance
Johannes
Re: EMF Compare problem comparing instances [message #672422 is a reply to message #622547] Sat, 21 May 2011 00:57 Go to previous messageGo to next message
Frank is currently offline Frank
Messages: 7
Registered: May 2011
Junior Member
Greetings,

I am having the same issue as Johannes, any light on this issue yet?

Stack Trace ( The part related to EMF and EMF Comapre):
Exception in thread "main" java.lang.IllegalArgumentException: The feature 'isbn' is not a valid feature
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eOpenGet(BasicEObjectImpl.java:1072)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1025)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1013)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1008)
	at org.eclipse.emf.compare.diff.metamodel.impl.UpdateAttributeImpl.toString(UpdateAttributeImpl.java:61)



Thanks in advanced,
Frank
Re: EMF Compare problem comparing instances [message #672575 is a reply to message #622547] Sat, 21 May 2011 21:19 Go to previous messageGo to next message
Frank is currently offline Frank
Messages: 7
Registered: May 2011
Junior Member
Greetings Johannes,

Have you found the solution to this problem yet?


Thanks,
Frank
Re: EMF Compare problem comparing instances [message #673206 is a reply to message #622547] Sun, 22 May 2011 20:58 Go to previous messageGo to next message
Frank is currently offline Frank
Messages: 7
Registered: May 2011
Junior Member
Greetings Johannes,

I am not sure if you have already solved the problem but I seem to have found a solution.

I was having the same problem and, at least in my case, the problem seems to have been caused by the fact that I was creating the metamodel twice, once for every instance model. This was causing the attributes to be the same and at the same time have separate IDs.

My approach was to create only one metamodel and then create both my instance models separately.

I have attached a folder containing:

EMFComparator.java (My test driver)
EcoreLibraryBuilder.java (My Solution, where I only create one metamodel)
EcoreDynamic.java (My original class where I created the models dynamically. This is the one that gave me the errors, I left it there in case you want to see the issue for yourself)

Hope it helps,
Frank
Re: EMF Compare problem comparing instances [message #673335 is a reply to message #673206] Mon, 23 May 2011 09:43 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent Goubet
Messages: 1632
Registered: July 2009
Senior Member
Hi Frank,

Seem like I see this message too late Smile.

As you found out, this kind of exception usually arise when a same model is loaded twice. Sometimes because the code itself loads it twice, sometimes because it is referenced with two different URIs for the same file (for example, "platform:/resource/.../.../myModel.ecore" and "../../myModel.ecore") which end up loading two different instances of the same Resource.

Laurent Goubet
Obeo
Re: EMF Compare problem comparing instances [message #673495 is a reply to message #673335] Mon, 23 May 2011 20:35 Go to previous message
Frank is currently offline Frank
Messages: 7
Registered: May 2011
Junior Member
Greetings Laurent,

Thanks for the reply.

My problem came from the fact that I was creating the same metamodel twice. I had just copy/pasted the code in two separate methods and was creating my models that way. That's the price you pay for laziness I suppose lol.

Thanks once again,
Frank
Previous Topic:EMF Compare problem comparing instances
Next Topic:EEF 1.0 missing EEF extension feature
Goto Forum:
  


Current Time: Wed Oct 22 22:38:26 GMT 2014

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

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