Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMF] Exception when using remove/removeAll
[EMF] Exception when using remove/removeAll [message #1700813] Tue, 07 July 2015 11:36 Go to next message
Tobias Zangl is currently offline Tobias ZanglFriend
Messages: 15
Registered: May 2015
Junior Member
Hey,

i always get an exception if i use remove or removeAll for a contained list.
I don't get it for every element in the list nor for the ones to be removed.
Sometimes i get it only for one (the first?) element..

Any ideas why this happens? Where is this ID stored? In EMF-Store and EMF-Forms everything works fine, the element is stored and reloaded correctly. The remove methods also work but i get these exceptions..

!ENTRY org.eclipse.emf.emfstore.client 4 4 2015-07-07 13:31:11.784
!MESSAGE Element in Project does not have an ID: design.impl.FactorModelImpl@7845f53d (name: Analysis.messageSize, variableUnit: null, variableType: Integer) (forceFullFactorial: false)
!STACK 0
java.lang.IllegalStateException: Element in Project does not have an ID: design.impl.FactorModelImpl@7845f53d (name: Analysis.messageSize, variableUnit: null, variableType: Integer) (forceFullFactorial: false)
	at org.eclipse.emf.emfstore.internal.client.model.changeTracking.NotificationToOperationConverter.setCommonValues(NotificationToOperationConverter.java:405)
	at org.eclipse.emf.emfstore.internal.client.model.changeTracking.NotificationToOperationConverter.createSingleReferenceOperation(NotificationToOperationConverter.java:337)
	at org.eclipse.emf.emfstore.internal.client.model.changeTracking.NotificationToOperationConverter.handleSetReference(NotificationToOperationConverter.java:361)
	at org.eclipse.emf.emfstore.internal.client.model.changeTracking.NotificationToOperationConverter.convert(NotificationToOperationConverter.java:82)
	at org.eclipse.emf.emfstore.internal.client.model.impl.OperationRecorder.recordingFinished(OperationRecorder.java:365)
	at org.eclipse.emf.emfstore.internal.client.model.impl.OperationRecorder.notify(OperationRecorder.java:943)
	at org.eclipse.emf.emfstore.internal.client.model.impl.OperationManager.notify(OperationManager.java:252)
	at org.eclipse.emf.emfstore.internal.common.model.impl.NotifiableIdEObjectCollectionImpl$3.run(NotifiableIdEObjectCollectionImpl.java:217)
	at org.eclipse.emf.emfstore.internal.common.model.impl.NotifiableIdEObjectCollectionImpl$2.run(NotifiableIdEObjectCollectionImpl.java:142)
	at org.eclipse.emf.emfstore.common.ESSafeRunner.run(ESSafeRunner.java:38)
	at org.eclipse.emf.emfstore.internal.common.model.impl.NotifiableIdEObjectCollectionImpl.notifyIdEObjectCollectionChangeObservers(NotifiableIdEObjectCollectionImpl.java:165)
	at org.eclipse.emf.emfstore.internal.common.model.impl.NotifiableIdEObjectCollectionImpl.notify(NotifiableIdEObjectCollectionImpl.java:230)
	at org.eclipse.emf.emfstore.internal.common.model.util.EObjectChangeNotifier.notifyCollection(EObjectChangeNotifier.java:220)
	at org.eclipse.emf.emfstore.internal.common.model.util.EObjectChangeNotifier.notifyChanged(EObjectChangeNotifier.java:208)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
	at org.eclipse.emf.common.notify.impl.NotificationImpl.dispatch(NotificationImpl.java:1027)
	at org.eclipse.emf.common.notify.impl.NotificationImpl.dispatch(NotificationImpl.java:1032)
	at org.eclipse.emf.common.notify.impl.NotificationImpl.dispatch(NotificationImpl.java:1032)
	at org.eclipse.emf.common.notify.impl.NotificationImpl.dispatch(NotificationImpl.java:1032)
	at org.eclipse.emf.common.notify.impl.NotificationImpl.dispatch(NotificationImpl.java:1032)
	at org.eclipse.emf.common.notify.impl.NotificationImpl.dispatch(NotificationImpl.java:1032)
	at org.eclipse.emf.common.notify.impl.NotificationImpl.dispatch(NotificationImpl.java:1032)
	at org.eclipse.emf.common.notify.impl.NotificationImpl.dispatch(NotificationImpl.java:1032)
	at org.eclipse.emf.common.notify.impl.NotifyingListImpl.removeAll(NotifyingListImpl.java:954)
	at de.fau.syntony.experiment.control.refresh.DesignValidator.removeWrongFactors(DesignValidator.java:138)
	at de.fau.syntony.experiment.control.refresh.DesignValidator.validate(DesignValidator.java:35)
	at de.fau.syntony.experiment.renderer.DesignValidationRenderer$1.widgetSelected(DesignValidationRenderer.java:77)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4170)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:140)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:611)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	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:354)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1426)

!ENTRY org.eclipse.osgi 2 1 2015-07-07 13:31:11.793
!MESSAGE NLS missing message: NotifiableIdEObjectCollectionImpl_Exception in: org.eclipse.emf.emfstore.internal.common.model.impl.messages

!ENTRY org.eclipse.osgi 2 1 2015-07-07 13:31:11.804
!MESSAGE NLS missing message: NotifiableIdEObjectCollectionImpl_Exception_Detach in: org.eclipse.emf.emfstore.internal.common.model.impl.messages

!ENTRY org.eclipse.osgi 2 1 2015-07-07 13:31:11.809
!MESSAGE NLS missing message: NotifiableIdEObjectCollectionImpl_Exception_NoDetach in: org.eclipse.emf.emfstore.internal.common.model.impl.messages
Re: [EMF] Exception when using remove/removeAll [message #1701101 is a reply to message #1700813] Thu, 09 July 2015 10:24 Go to previous messageGo to next message
Edgar Mueller is currently offline Edgar MuellerFriend
Messages: 89
Registered: March 2011
Member
Hi Tobias,

this errors occurs, if, for whatever reason, a model element that is
contained within the project, has no ID assigned. This must not happen,
since the operation recording mechanism then isn't capable anymore of
uniquely identifying an element.
What's causing the problem is hard to tell. If you always encounter this
exception, maybe you can provide me with more info about the data and
its shape? Please also consider opening a BR
(https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EMFStore).

Thanks,
Edgar

> Hey,
>
> i always get an exception if i use remove or removeAll for a contained
> list.
> I don't get it for every element in the list nor for the ones to be
> removed.
> Sometimes i get it only for one (the first?) element..
>
> Any ideas why this happens? Where is this ID stored? In EMF-Store and
> EMF-Forms everything works fine, the element is stored and reloaded
> correctly. The remove methods also work but i get these exceptions..
>
> !ENTRY org.eclipse.emf.emfstore.client 4 4 2015-07-07 13:31:11.784
> !MESSAGE Element in Project does not have an ID:
> design.impl.FactorModelImpl@7845f53d (name: Analysis.messageSize,
> variableUnit: null, variableType: Integer) (forceFullFactorial: false)
> !STACK 0
> java.lang.IllegalStateException: Element in Project does not have an ID:
> design.impl.FactorModelImpl@7845f53d (name: Analysis.messageSize,
> variableUnit: null, variableType: Integer) (forceFullFactorial: false)
> at
> org.eclipse.emf.emfstore.internal.client.model.changeTracking.NotificationToOperationConverter.setCommonValues(NotificationToOperationConverter.java:405)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.changeTracking.NotificationToOperationConverter.createSingleReferenceOperation(NotificationToOperationConverter.java:337)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.changeTracking.NotificationToOperationConverter.handleSetReference(NotificationToOperationConverter.java:361)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.changeTracking.NotificationToOperationConverter.convert(NotificationToOperationConverter.java:82)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.impl.OperationRecorder.recordingFinished(OperationRecorder.java:365)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.impl.OperationRecorder.notify(OperationRecorder.java:943)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.impl.OperationManager.notify(OperationManager.java:252)
>
> at
> org.eclipse.emf.emfstore.internal.common.model.impl.NotifiableIdEObjectCollectionImpl$3.run(NotifiableIdEObjectCollectionImpl.java:217)
>
> at
> org.eclipse.emf.emfstore.internal.common.model.impl.NotifiableIdEObjectCollectionImpl$2.run(NotifiableIdEObjectCollectionImpl.java:142)
>
> at
> org.eclipse.emf.emfstore.common.ESSafeRunner.run(ESSafeRunner.java:38)
> at
> org.eclipse.emf.emfstore.internal.common.model.impl.NotifiableIdEObjectCollectionImpl.notifyIdEObjectCollectionChangeObservers(NotifiableIdEObjectCollectionImpl.java:165)
>
> at
> org.eclipse.emf.emfstore.internal.common.model.impl.NotifiableIdEObjectCollectionImpl.notify(NotifiableIdEObjectCollectionImpl.java:230)
>
> at
> org.eclipse.emf.emfstore.internal.common.model.util.EObjectChangeNotifier.notifyCollection(EObjectChangeNotifier.java:220)
>
> at
> org.eclipse.emf.emfstore.internal.common.model.util.EObjectChangeNotifier.notifyChanged(EObjectChangeNotifier.java:208)
>
> at
> org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
>
> at
> org.eclipse.emf.common.notify.impl.NotificationImpl.dispatch(NotificationImpl.java:1027)
>
> at
> org.eclipse.emf.common.notify.impl.NotificationImpl.dispatch(NotificationImpl.java:1032)
>
> at
> org.eclipse.emf.common.notify.impl.NotificationImpl.dispatch(NotificationImpl.java:1032)
>
> at
> org.eclipse.emf.common.notify.impl.NotificationImpl.dispatch(NotificationImpl.java:1032)
>
> at
> org.eclipse.emf.common.notify.impl.NotificationImpl.dispatch(NotificationImpl.java:1032)
>
> at
> org.eclipse.emf.common.notify.impl.NotificationImpl.dispatch(NotificationImpl.java:1032)
>
> at
> org.eclipse.emf.common.notify.impl.NotificationImpl.dispatch(NotificationImpl.java:1032)
>
> at
> org.eclipse.emf.common.notify.impl.NotificationImpl.dispatch(NotificationImpl.java:1032)
>
> at
> org.eclipse.emf.common.notify.impl.NotifyingListImpl.removeAll(NotifyingListImpl.java:954)
>
> at
> de.fau.syntony.experiment.control.refresh.DesignValidator.removeWrongFactors(DesignValidator.java:138)
>
> at
> de.fau.syntony.experiment.control.refresh.DesignValidator.validate(DesignValidator.java:35)
>
> at
> de.fau.syntony.experiment.renderer.DesignValidationRenderer$1.widgetSelected(DesignValidationRenderer.java:77)
>
> at
> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4170)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759)
> at
> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
>
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
>
> at
> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
>
> at
> org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:140)
>
> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:611)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
>
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
> at
> org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
>
> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
>
> 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:354)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>
> at java.lang.reflect.Method.invoke(Method.java:483)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
>
> !ENTRY org.eclipse.osgi 2 1 2015-07-07 13:31:11.793
> !MESSAGE NLS missing message:
> NotifiableIdEObjectCollectionImpl_Exception in:
> org.eclipse.emf.emfstore.internal.common.model.impl.messages
>
> !ENTRY org.eclipse.osgi 2 1 2015-07-07 13:31:11.804
> !MESSAGE NLS missing message:
> NotifiableIdEObjectCollectionImpl_Exception_Detach in:
> org.eclipse.emf.emfstore.internal.common.model.impl.messages
>
> !ENTRY org.eclipse.osgi 2 1 2015-07-07 13:31:11.809
> !MESSAGE NLS missing message:
> NotifiableIdEObjectCollectionImpl_Exception_NoDetach in:
> org.eclipse.emf.emfstore.internal.common.model.impl.messages


--
Edgar Mueller

Get Professional Eclipse Support:
http://eclipsesource.com/en/services/developer-support/
Re: [EMF] Exception when using remove/removeAll [message #1701124 is a reply to message #1701101] Thu, 09 July 2015 13:12 Go to previous messageGo to next message
Tobias Zangl is currently offline Tobias ZanglFriend
Messages: 15
Registered: May 2015
Junior Member
Hey,

thanks for your fast response!

In the EMFStore project.ecp file the models all have IDs, e.g.:
<factors xmi:id="_rCqR8SSbEeWss5lEVCi61A" name="Analysis.messageSize" variableType="Integer">

And as i already mentioned everything else works perfectly fine. I can add and remove model elements without any problem in the generated form and i can also do it programmatically but with these exceptions.
So the ID should be set and stored correctly right?

The funny thing is that i get the exception only for one model.. so if my list contains 5 models i can remove them but i get the exception for only one of them and it is always the same unless ich remove the one with the exception, then it is the "next" one. (and the one with the exception is not the first one in the list)

Greetings,
Tobi
Re: [EMF] Exception when using remove/removeAll [message #1701570 is a reply to message #1701124] Tue, 14 July 2015 08:26 Go to previous messageGo to next message
Edgar Mueller is currently offline Edgar MuellerFriend
Messages: 89
Registered: March 2011
Member
Hi Tobias,

this seems strange and I haven't been able yet to reproduce this.
Nevertheless I've opened a BR for this
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=472584). It would be
great if you could comment on that.
I tried to do something along the lines of the following (this is based
on our test suite, where a league contains players):

final League leagueWithPlayers = Create.league("league");
final Player player1 = Create.player();
final Player player2 = Create.player();
final Player player3 = Create.player();
leagueWithPlayers.getPlayers().addAll(
Arrays.asList(player1, player2, player3)
);
getLocalProject().getModelElements().add(leagueWithPlayers);

assertTrue(getLocalProject().isShared());
assertEquals(getLocalProject().getAllModelElements().size(), 4);

leagueWithPlayers.getPlayers().removeAll(
Arrays.asList(player1, player2)
); assertEquals(getLocalProject().getAllModelElements().size(), 2);

and this works for me, but I guess there must be a difference how you
delete elements programatically?

Thanks,
Edgar

> Hey,
>
> thanks for your fast response!
>
> In the EMFStore project.ecp file the models all have IDs, e.g.:
> <factors xmi:id="_rCqR8SSbEeWss5lEVCi61A" name="Analysis.messageSize"
> variableType="Integer">
>
> And as i already mentioned everything else works perfectly fine. I can
> add and remove model elements without any problem in the generated form
> and i can also do it programmatically but with these exceptions.
> So the ID should be set and stored correctly right?
>
> The funny thing is that i get the exception only for one model.. so if
> my list contains 5 models i can remove them but i get the exception for
> only one of them and it is always the same unless ich remove the one
> with the exception, then it is the "next" one. (and the one with the
> exception is not the first one in the list)
>
> Greetings,
> Tobi


--
Edgar Mueller

Get Professional Eclipse Support:
http://eclipsesource.com/en/services/developer-support/
Re: [EMF] Exception when using remove/removeAll [message #1702789 is a reply to message #1701570] Fri, 24 July 2015 14:48 Go to previous messageGo to next message
Edgar Mueller is currently offline Edgar MuellerFriend
Messages: 89
Registered: March 2011
Member
Hi Tobias,

have you found the time to compare your listing against mine in order to
spot any differences? If so, if would greatly help if you could describe
your findings in the BR.

Thanks,
Edgar

--
Edgar Mueller

Get Professional Eclipse Support:
http://eclipsesource.com/en/services/developer-support/
Re: [EMF] Exception when using remove/removeAll [message #1703328 is a reply to message #1702789] Thu, 30 July 2015 16:23 Go to previous messageGo to next message
Tobias Zangl is currently offline Tobias ZanglFriend
Messages: 15
Registered: May 2015
Junior Member
Hi Edgar,

sorry i was on vacation last week but im working on it. It is a little bit difficult because my model is larger and i have no clue where to start looking for differences.

This is one of the methods which creates the exceptions:
public void removeWrongFactors() {
	EList<FactorModel> removeModels = new BasicEList<FactorModel>();
		
	for(FactorModel m : design.getFactors()) {
		if(!containsInput(m.getName())) {
			removeModels.add(m);
		}
	}
		
	design.getFactors().removeAll(removeModels);
}


As you can see it is rather simple. I will put some more effort into it the next days.

Greetings,
Tobias
Re: [EMF] Exception when using remove/removeAll [message #1703371 is a reply to message #1703328] Fri, 31 July 2015 07:38 Go to previous message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Hi Tobias,

Edgar is on vacation until the end of next week. He will get back to you
after that.

Best regards

Jonas


Am 30.07.2015 um 18:23 schrieb Tobias Zangl:
> Hi Edgar,
>
> sorry i was on vacation last week but im working on it. It is a little
> bit difficult because my model is larger and i have no clue where to
> start looking for differences.
>
> This is one of the methods which creates the exceptions:
>
> public void removeWrongFactors() {
> EList<FactorModel> removeModels = new BasicEList<FactorModel>();
>
> for(FactorModel m : design.getFactors()) {
> if(!containsInput(m.getName())) {
> removeModels.add(m);
> }
> }
>
> design.getFactors().removeAll(removeModels);
> }
>
>
> As you can see it is rather simple. I will put some more effort into it
> the next days.
>
> Greetings,
> Tobias


--
--

Jonas Helming

Get professional Eclipse developer support:

http://eclipsesource.com/en/services/developer-support/
Previous Topic:Problem with installation of ecore diagramm
Next Topic:[Texo] Annotation of EReference with no cascades
Goto Forum:
  


Current Time: Sat Oct 31 08:37:15 GMT 2020

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

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

Back to the top