Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » [TableViewer] Busy ColumnViewer
[TableViewer] Busy ColumnViewer [message #1052018] Mon, 29 April 2013 14:15 Go to next message
Setya Nugdjaja is currently offline Setya NugdjajaFriend
Messages: 564
Registered: July 2009
Senior Member
Hi all,

We often encountered Exception stating that the ColumnViewer is busy. This happens when we invoke 'tableViewer.replace(model, index)'. Although it does not showstop our application, but the stacktrace looks daunting.

We've tried to desperately wait by inspecting tableViewer.isBusy() within loop and sleep, but it never returned false so we ended up looping forever.

We still on 1.4.2 and below is the complete stacktrace:

!ENTRY org.eclipse.jface 2 0 2013-04-29 21:03:31.022
!MESSAGE Ignored reentrant call while viewer is busy. This is only logged once per viewer instance, but similar calls will still be ignored.
!STACK 0
java.lang.RuntimeException
	at org.eclipse.jface.viewers.ColumnViewer.checkBusy(ColumnViewer.java:758)
	at org.eclipse.jface.viewers.AbstractTableViewer.replace(AbstractTableViewer.java:1056)
	at com.modulariti.ui.widgets.table.TablePage$TablePageUI.replaceTableViewerModel(TablePage.java:364)
	at com.modulariti.ui.widgets.table.TablePage$1.updateElement(TablePage.java:65)
	at org.eclipse.jface.viewers.AbstractTableViewer$1.handleEvent(AbstractTableViewer.java:86)
	at org.eclipse.swt.internal.widgets.UntypedEventAdapter.dispatchEvent(UntypedEventAdapter.java:652)
	at org.eclipse.swt.internal.widgets.UntypedEventAdapter.update(UntypedEventAdapter.java:161)
	at org.eclipse.swt.internal.events.SetDataEvent.dispatchToObserver(SetDataEvent.java:48)
	at org.eclipse.rwt.internal.events.Event.processEvent(Event.java:44)
	at org.eclipse.swt.events.TypedEvent.processEvent(TypedEvent.java:163)
	at org.eclipse.swt.widgets.Table.checkData(Table.java:2253)
	at org.eclipse.swt.widgets.TableItem.getImage(TableItem.java:414)
	at org.eclipse.jface.viewers.TableViewerRow.setImage(TableViewerRow.java:132)
	at org.eclipse.jface.viewers.ViewerCell.setImage(ViewerCell.java:170)
	at org.eclipse.jface.viewers.ColumnLabelProvider.update(ColumnLabelProvider.java:38)
	at com.modulariti.ui.widgets.table.TablePage$5.update(TablePage.java:252)
	at org.eclipse.jface.viewers.ViewerColumn.refresh(ViewerColumn.java:153)
	at org.eclipse.jface.viewers.AbstractTableViewer.doUpdateItem(AbstractTableViewer.java:399)
	at org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRunnable.run(StructuredViewer.java:481)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:51)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
	at org.eclipse.jface.viewers.StructuredViewer.refreshItem(StructuredViewer.java:1534)
	at org.eclipse.jface.viewers.AbstractTableViewer.replace(AbstractTableViewer.java:1059)
	at com.modulariti.ui.widgets.table.TablePage$TablePageUI.replaceTableViewerModel(TablePage.java:364)
	at com.modulariti.ui.widgets.table.TablePage$1.updateElement(TablePage.java:65)
	at org.eclipse.jface.viewers.AbstractTableViewer.getVirtualSelection(AbstractTableViewer.java:510)
	at org.eclipse.jface.viewers.AbstractTableViewer.getSelectionFromWidget(AbstractTableViewer.java:481)
	at org.eclipse.jface.viewers.StructuredViewer.getSelection(StructuredViewer.java:1025)
	at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1434)
	at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1384)
	at org.eclipse.jface.viewers.AbstractTableViewer.inputChanged(AbstractTableViewer.java:590)
	at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:280)
	at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1670)
	at com.modulariti.ui.widgets.table.TablePage$TablePageUI.setTableViewerInput(TablePage.java:367)
	at com.modulariti.ui.widgets.table.TablePage.updateContent(TablePage.java:268)
	at com.modulariti.ui.widgets.table.TablePage.access$6(TablePage.java:257)
	at com.modulariti.ui.widgets.table.TablePage$8$1.run(TablePage.java:303)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:169)
	at org.eclipse.swt.widgets.Display.runPendingMessages(Display.java:1137)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1124)
	at com.modulariti.ui.builder.demo.BuilderDemoEntryPoint.createUI(BuilderDemoEntryPoint.java:57)
	at org.eclipse.rwt.internal.lifecycle.EntryPointManager.createUI(EntryPointManager.java:73)
	at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:211)
	at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:88)
	at java.lang.Thread.run(Thread.java:662)
	at org.eclipse.rwt.internal.lifecycle.UIThread.run(UIThread.java:102)


Any help would be greatly appreciated.


Thanks & Regards,

Setya
Re: [TableViewer] Busy ColumnViewer [message #1052546 is a reply to message #1052018] Tue, 30 April 2013 08:11 Go to previous message
Setya Nugdjaja is currently offline Setya NugdjajaFriend
Messages: 564
Registered: July 2009
Senior Member
Hi,

This seems to be the result of recursive calls.

From AbstractTableViewer#doUpdateItem below:
protected void doUpdateItem(Widget widget, Object element, boolean fullMap) {
	boolean oldBusy = isBusy();
	setBusy(true);
	try {
		if (widget instanceof Item) {
			...

			// Also enter loop if no columns added. See 1G9WWGZ: JFUIF:WINNT -
			// TableViewer with 0 columns does not work
			for (int column = 0; column < columnCount || column == 0; column++) {
				...

				columnViewer.refresh(cellToUpdate);

				...
			}

		}
	} finally {
		setBusy(oldBusy);
	}
}


There's code that set the busy flag to true after which columnViewer#refresh is invoked which leads to AbstractViewer#replace below:

public void replace(Object element, int index) {
	if (checkBusy())
		return;
	Item item = doGetItem(index);
	refreshItem(item, element);
}


and ColumnViewer#checkBusy:
protected boolean checkBusy() {
	if (isBusy()) {
		if (logWhenBusy) {
			String message = "Ignored reentrant call while viewer is busy."; //$NON-NLS-1$
			if (!InternalPolicy.DEBUG_LOG_REENTRANT_VIEWER_CALLS) {
				// stop logging after the first
				logWhenBusy = false;
				message += " This is only logged once per viewer instance," + //$NON-NLS-1$
						" but similar calls will still be ignored."; //$NON-NLS-1$
			}
			Policy.getLog().log(
					new Status(IStatus.WARNING, Policy.JFACE, message,
							new RuntimeException()));
		}
		return true;
	}
	return false;
}


Hence the RuntimeException.

Did I do wrong in my code or I can just ignore it ?

Thanks & Regards,

Setya
Previous Topic:Is it RAP still working with Juno 4.2.2
Next Topic:JUnit tests
Goto Forum:
  


Current Time: Wed Jun 28 19:34:38 GMT 2017

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

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