Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Exceptions(ConcurrentModificationException & SWTException (v1.1.0))
Exceptions [message #1376131] Fri, 23 May 2014 09:18 Go to next message
Ludwig Moser is currently offline Ludwig MoserFriend
Messages: 452
Registered: July 2009
Senior Member
Hello,

i am using nattable and run into two exceptions.

(1) an ConcurrentModificationException.
it gets raised but nattable can continue working as expected. no sideeffects.
-> just catch and drop it

(2) an SWTException, which gets raised because the Widget is disposed (when closing the program) this one prevents my program from closing!
also this exception should be catched and dropped, as the program is closing anyway.

iff this can be caught outside of NatTable's code let me know how/where, was not able to find the right spot.

Thanks in Advance
Ludwig


Exceptions:
(1)
!ENTRY org.eclipse.ui 4 0 2014-05-23 08:31:14.597
!MESSAGE Unhandled event loop exception
!STACK 0
java.util.ConcurrentModificationException
	at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(Unknown Source)
	at java.util.LinkedHashMap$KeyIterator.next(Unknown Source)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.fireLayerEvent(AbstractLayer.java:256)
	at org.eclipse.nebula.widgets.nattable.selection.SelectionLayer.fireCellSelectionEvent(SelectionLayer.java:424)
	at org.eclipse.nebula.widgets.nattable.selection.SelectCellCommandHandler.doCommand(SelectCellCommandHandler.java:33)
	at org.eclipse.nebula.widgets.nattable.selection.SelectCellCommandHandler.doCommand(SelectCellCommandHandler.java:1)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.doCommand(AbstractLayer.java:162)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractIndexLayerTransform.doCommand(AbstractIndexLayerTransform.java:109)
	at org.eclipse.nebula.widgets.nattable.selection.SelectionLayer.doCommand(SelectionLayer.java:416)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractIndexLayerTransform.doCommand(AbstractIndexLayerTransform.java:113)
	at org.eclipse.nebula.widgets.nattable.layer.CompositeLayer.doCommandOnChildLayers(CompositeLayer.java:141)
	at org.eclipse.nebula.widgets.nattable.layer.CompositeLayer.doCommand(CompositeLayer.java:135)
	at org.eclipse.nebula.widgets.nattable.freeze.CompositeFreezeLayer.doCommand(CompositeFreezeLayer.java:99)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractLayerTransform.doCommand(AbstractLayerTransform.java:107)
	at org.eclipse.nebula.widgets.nattable.grid.layer.GridLayer.doCommandOnChildLayer(GridLayer.java:109)
	at org.eclipse.nebula.widgets.nattable.grid.layer.GridLayer.doCommandOnChildLayers(GridLayer.java:96)
	at org.eclipse.nebula.widgets.nattable.layer.CompositeLayer.doCommand(CompositeLayer.java:135)
	at org.eclipse.nebula.widgets.nattable.grid.layer.GridLayer.doCommand(GridLayer.java:178)
	at org.eclipse.nebula.widgets.nattable.NatTable.doCommand(NatTable.java:626)
	at org.eclipse.nebula.widgets.nattable.selection.action.SelectCellAction.run(SelectCellAction.java:26)
	at org.eclipse.nebula.widgets.nattable.ui.mode.ConfigurableModeEventHandler.mouseDown(ConfigurableModeEventHandler.java:50)
	at org.eclipse.nebula.widgets.nattable.ui.mode.ModeSupport.mouseDown(ModeSupport.java:100)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:192)
	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 at.biooffice.application.Application.start(Application.java:55)
	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(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: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)


(2)
org.eclipse.swt.SWTException: Widget is disposed
	at org.eclipse.swt.SWT.error(SWT.java:4397)
	at org.eclipse.swt.SWT.error(SWT.java:4312)
	at org.eclipse.swt.SWT.error(SWT.java:4283)
	at org.eclipse.swt.widgets.Widget.error(Widget.java:472)
	at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:344)
	at org.eclipse.swt.widgets.ScrollBar.getEnabled(ScrollBar.java:238)
	at org.eclipse.nebula.widgets.nattable.viewport.ScrollBarScroller.getEnabled(ScrollBarScroller.java:96)
	at org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer.recalculateVerticalScrollBar(ViewportLayer.java:1000)
	at org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer.setMinimumOriginY(ViewportLayer.java:276)
	at org.eclipse.nebula.widgets.nattable.viewport.event.ViewportEventHandler.handleLayerEvent(ViewportEventHandler.java:166)
	at org.eclipse.nebula.widgets.nattable.viewport.event.ViewportEventHandler.handleLayerEvent(ViewportEventHandler.java:1)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.handleLayerEvent(AbstractLayer.java:228)
	at org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer.handleLayerEvent(ViewportLayer.java:1189)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.fireLayerEvent(AbstractLayer.java:261)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.handleLayerEvent(AbstractLayer.java:234)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.fireLayerEvent(AbstractLayer.java:261)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.handleLayerEvent(AbstractLayer.java:234)
	at org.eclipse.nebula.widgets.nattable.hideshow.AbstractColumnHideShowLayer.handleLayerEvent(AbstractColumnHideShowLayer.java:50)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.fireLayerEvent(AbstractLayer.java:261)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.handleLayerEvent(AbstractLayer.java:234)
	at org.eclipse.nebula.widgets.nattable.hideshow.AbstractColumnHideShowLayer.handleLayerEvent(AbstractColumnHideShowLayer.java:50)
	at org.eclipse.nebula.widgets.nattable.hideshow.ColumnHideShowLayer.handleLayerEvent(ColumnHideShowLayer.java:64)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.fireLayerEvent(AbstractLayer.java:261)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.handleLayerEvent(AbstractLayer.java:234)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.fireLayerEvent(AbstractLayer.java:261)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.handleLayerEvent(AbstractLayer.java:234)
	at org.eclipse.nebula.widgets.nattable.reorder.ColumnReorderLayer.handleLayerEvent(ColumnReorderLayer.java:95)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.fireLayerEvent(AbstractLayer.java:261)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.handleLayerEvent(AbstractLayer.java:234)
	at org.eclipse.nebula.widgets.nattable.blink.BlinkLayer.handleLayerEvent(BlinkLayer.java:231)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.fireLayerEvent(AbstractLayer.java:261)
	at org.eclipse.nebula.widgets.nattable.extension.glazedlists.GlazedListsEventLayer$2.run(GlazedListsEventLayer.java:131)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
	... 18 more

[Updated on: Fri, 23 May 2014 09:19]

Report message to a moderator

Re: Exceptions [message #1376186 is a reply to message #1376131] Fri, 23 May 2014 09:50 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2704
Registered: July 2012
Senior Member
I don't understand why there is a ConcurrentModificationException, as it would mean a listener is added or removed at the same time an event is handled. When is it raised?

About the SWTException, it might be related to the BlinkLayer. It also seems that an event is handled while the Control gets disposed. But checking the code the GlazedListsEventLayer should shut down the Scheduler on disposal.

I really wonder where those concurrency issues come from. Are you doing some additional actions in the BlinkLayer?
Re: Exceptions [message #1382983 is a reply to message #1376186] Mon, 26 May 2014 06:49 Go to previous messageGo to next message
Ludwig Moser is currently offline Ludwig MoserFriend
Messages: 452
Registered: July 2009
Senior Member
ConcurrentModificationException: i found the source, but i do not exactly know why.
a cell selection listener tried to get the selection from the table, this caused that exception.
but actually i do not think its wrong what i did. because when a selection changes usually i do get the selection from the table and notify/update something else. and in this case the exception gets raised! actually thats exactly what a selectionlistener is for?

and the SWT Exception... i am not doing anything but construct the BlinkLayer...
i thought it could be due an menu i create on the table, but it isn't because i removed the menue to test for this. and the exception still gets raised... so no clue till now where its coming from.
Re: Exceptions [message #1383008 is a reply to message #1382983] Mon, 26 May 2014 07:03 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2704
Registered: July 2012
Senior Member
Hi,

ConcurrentModificationException:
Are you adding, removing that listener at runtime / on updates? The stacktrace tells it is in fireLayerEvent() where we iterate over the listeners. Of course the selection listener is used to listen for selection updates. I just wonder where the concurrent modification on the listener collection itself comes from.

SWTException
I don't know your composition or example in detail. Are you able to reproduce the issue with a simple BlinkLayer example? Maybe a modified NatTable example?
Maybe there is an issue or even a bug regarding the BlinkLayer.

Greez,
Dirk
Re: Exceptions [message #1383088 is a reply to message #1383008] Mon, 26 May 2014 07:45 Go to previous messageGo to next message
Ludwig Moser is currently offline Ludwig MoserFriend
Messages: 452
Registered: July 2009
Senior Member
The SelectionChangedListener is added after the table is constructed. not added or removed until its disposed.

due the SWTException:
I built a whole framework for my application, which is generating the Table and other components at runtime.
I tried to seperate the table to a small example (before i posted here) but it resolves in too much, as everything is connected/Dependend to other parts of the framework.

but if you give me some hints which event could cause it i'll dig into it. so i'll not waste your time.

thanks for helping!
greets
Ludwig
Re: Exceptions [message #1383147 is a reply to message #1383088] Mon, 26 May 2014 08:23 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2704
Registered: July 2012
Senior Member
The GlazedListsEventLayer is firing events on list changes in 100ms intervals to decrease the number of events handled e.g. in case of sorting or filtering. So there the event seems to be in the pipe on dispose. There a scheduler executor service is running to achieve that.

AFAIK the BlinkLayer has its own background thread handling, not using the scheduler executor service. Maybe that is causing the trouble and the handling in the BlinkLayer needs to be modified. Another thing might be that the BlinkLayer also needs to handle the DisposeResourcesCommand.

Disposing the NatTable will trigger the DisposeResourcesCommand so all layers have the chance to clean up. And the GlazedListsEventLayer will stop the executor service. That's where you should take a look at. Not sure what's wrong here.

You still didn't tell me where the ConcurrentModificationException happens. At creation time, at runtime when you are doing something, ...? If it's at creation time, maybe you attached the listener before rendering took place and there are events fired and handled while there are still handlers added? You said that you have a framework that creates everything, maybe some race condition is coming up because incorrect order of the creation?
Re: Exceptions [message #1383919 is a reply to message #1383147] Tue, 27 May 2014 08:17 Go to previous messageGo to next message
Ludwig Moser is currently offline Ludwig MoserFriend
Messages: 452
Registered: July 2009
Senior Member
sorry i did forget the detail in one of my posts above

The ConcurrentModificationException gets raised if i add a SelectionChangeListener, which does getSelection()
it is added after the table is constructed. not added or removed until its disposed.
so when i clicked on a cell the exception got raised, every time. after removing the getSelection() call from this listener, the Exception is now gone.

ConcurrentModificationException got raised @runtime every time i changed the selection. [fixed by not calling getSelection in the SelectionListener - somehow awkward]

will dig into the SwtException in more detail and let you know!
Thanks
Re: Exceptions [message #1383933 is a reply to message #1383919] Tue, 27 May 2014 09:31 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2704
Registered: July 2012
Senior Member
Without seeing the code I'm not able to give further hints. But it looks like the registering code of the listener is called multiple times, like every time a selection occurs.
Previous Topic:Where the View Configartions shell get the list of properties file nattable style
Next Topic:How to set background image for whole nattable
Goto Forum:
  


Current Time: Fri Aug 23 23:59:09 GMT 2019

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

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

Back to the top