Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 321503 - Use of IProgressService causes WARNING java.lang.RuntimeException: WARNING: Prevented recursive attempt to activate part
Summary: Use of IProgressService causes WARNING java.lang.RuntimeException: WARNING: P...
Status: RESOLVED INVALID
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-02 09:11 EDT by vikas CLA
Modified: 2010-10-11 13:42 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description vikas CLA 2010-08-02 09:11:29 EDT
Build Identifier: Target platform 3.3.2 

Please find stack trace of warning produced. From stack trace it is observed that till ModelContext.java, progress monitor code was executed and after that code to close 1 view started executing.  

java.lang.RuntimeException: WARNING: Prevented recursive attempt to activate part com.myApp.view1 while still in the middle of activating part com.myApp.SampleView
at org.eclipse.ui.internal.WorkbenchPage.setActivePart(WorkbenchPage.java:3352)
at org.eclipse.ui.internal.WorkbenchPage.activate(WorkbenchPage.java:611)
at org.eclipse.ui.internal.WorkbenchPage.makeActive(WorkbenchPage.java:1193)
at org.eclipse.ui.internal.WorkbenchPage.updateActivePart(WorkbenchPage.java:1173)
at org.eclipse.ui.internal.WorkbenchPage.hideView(WorkbenchPage.java:2263)
at org.eclipse.ui.internal.ViewPane.doHide(ViewPane.java:212)
at org.eclipse.ui.internal.PartStack.close(PartStack.java:543)
at org.eclipse.ui.internal.PartStack.close(PartStack.java:526)
at org.eclipse.ui.internal.PartStack$1.close(PartStack.java:122)
at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation$1.handleEvent(TabbedStackPresentation.java:81)
at org.eclipse.ui.internal.presentations.util.AbstractTabFolder.fireEvent(AbstractTabFolder.java:267)
at org.eclipse.ui.internal.presentations.util.AbstractTabFolder.fireEvent(AbstractTabFolder.java:276)
at org.eclipse.ui.internal.presentations.r33.DefaultTabFolder.access$1(DefaultTabFolder.java:1)
at org.eclipse.ui.internal.presentations.r33.DefaultTabFolder$1.closeButtonPressed(DefaultTabFolder.java:66)
at org.eclipse.ui.internal.presentations.r33.PaneFolder.notifyCloseListeners(PaneFolder.java:601)
at org.eclipse.ui.internal.presentations.r33.PaneFolder$3.close(PaneFolder.java:190)
at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:2171)
at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:324)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1158)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3401)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3033)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.block(ModalContext.java:158)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:326)
at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:495)
at org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.run(ProgressMonitorJobsDialog.java:268)
at org.eclipse.ui.internal.progress.ProgressManager$3.run(ProgressManager.java:909)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.internal.progress.ProgressManager.busyCursorWhile(ProgressManager.java:944)
at org.eclipse.ui.internal.progress.ProgressManager.busyCursorWhile(ProgressManager.java:919)
at com.myApp.core.Workorder$1.run(Workorder.java:34)
at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:178)
at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:118)
at org.eclipse.swt.widgets.Display.syncExec(Display.java:4021)
at com.myApp.Workorder.execute(Workorder.java:67)
at com.myApp.paintSelection(EntityDependencyPart.java:2540)
at com.myApp.selectionChanged(EntityDependencyPart.java:2815)
at org.eclipse.ui.internal.AbstractSelectionService.fireSelection(AbstractSelectionService.java:156)
at org.eclipse.ui.internal.AbstractSelectionService.setActivePart(AbstractSelectionService.java:282)
at org.eclipse.ui.internal.WWinPartService.updateActivePart(WWinPartService.java:125)
at org.eclipse.ui.internal.WWinPartService.access$0(WWinPartService.java:115)
at org.eclipse.ui.internal.WWinPartService$1.partDeactivated(WWinPartService.java:48)
at org.eclipse.ui.internal.PartListenerList2$4.run(PartListenerList2.java:113)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:857)
at org.eclipse.ui.internal.PartListenerList2.fireEvent(PartListenerList2.java:53)
at org.eclipse.ui.internal.PartListenerList2.firePartDeactivated(PartListenerList2.java:111)
at org.eclipse.ui.internal.PartService.firePartDeactivated(PartService.java:116)
at org.eclipse.ui.internal.PartService.setActivePart(PartService.java:165)
at org.eclipse.ui.internal.WorkbenchPagePartList.fireActivePartChanged(WorkbenchPagePartList.java:56)
at org.eclipse.ui.internal.PartList.setActivePart(PartList.java:126)
at org.eclipse.ui.internal.WorkbenchPage.setActivePart(WorkbenchPage.java:3402)
at org.eclipse.ui.internal.WorkbenchPage.requestActivation(WorkbenchPage.java:2946)
at org.eclipse.ui.internal.PartPane.requestActivation(PartPane.java:265)
at org.eclipse.ui.internal.presentations.PresentablePart.setFocus(PresentablePart.java:191)
at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation$1.handleEvent(TabbedStackPresentation.java:92)
at org.eclipse.ui.internal.presentations.util.AbstractTabFolder.fireEvent(AbstractTabFolder.java:267)
at org.eclipse.ui.internal.presentations.util.AbstractTabFolder.fireEvent(AbstractTabFolder.java:272)
at org.eclipse.ui.internal.presentations.util.AbstractTabFolder.handleMouseDown(AbstractTabFolder.java:342)
at org.eclipse.ui.internal.presentations.util.AbstractTabFolder$3.mouseDown(AbstractTabFolder.java:79)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:179)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1158)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3401)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3033)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at com.myApp.core.Application.run(Application.java:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethod(EclipseAppContainer.java:572)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:171)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
at org.eclipse.equinox.launcher.Main.main(Main.java:1148)


Reproducible: Always

Steps to Reproduce:
In our myApp application we have 3 views having selection changed event implemented. Each view listens and reacts to selection changed generated by other views. 
To display figures in a view a progress service with busy cursor is implemented in myApp.part view. A selection of text in com.myApp.view1 view selects equivalent text in com.myApp.SampleView and draws equivalent diagram in com.myApp.part view. 

We observed this WARNING: Prevented recursive attempt to activate part when we select mulitple text in com.myApp.view1 and tries to close com.myApp.SampleView using close button. 
This generates selection changed events from SampleView, and again selection changes from com.myApp.view1 view. It produces WARNING in error log view. The stack strace of warning is copied in Details section. 

We observed that avoiding progress service with busy cursor from com.myApp.part view, the warning is not observed. However we need busy cursor to indicate progress small time events. 

We verified the setFocus method  and tried to execute code in both sync and async threads. But this does not resolve the problem. 

Any pointers in this issue will be of great help. 

Regards, 
Vikas
Comment 1 Remy Suen CLA 2010-08-02 10:10:08 EDT
(In reply to comment #0)
> Build Identifier: Target platform 3.3.2

Does this happen with a 3.6 target platform?

On what grounds is this a bug of "critical" severity?
Comment 2 vikas CLA 2010-08-02 10:29:20 EDT
Does this happen with a 3.6 target platform?

Thanks for quick response. 
According to our application requirement we have modified org.eclipse.workbench 3.3.1 plugin. Due to this we need to use 3.3.2 as target platform. 

On what grounds is this a bug of "critical" severity?

It logs a Warning related to prevented recursive attempt to activate part and also create Unhandled Event loop exceptions.

Regards, 
Vikas
Comment 3 Remy Suen CLA 2010-08-02 11:25:36 EDT
(In reply to comment #2)
> Does this happen with a 3.6 target platform?
> 
> Thanks for quick response. 
> According to our application requirement we have modified org.eclipse.workbench
> 3.3.1 plugin. Due to this we need to use 3.3.2 as target platform. 

This doesn't actually answer my question. :o

The 3.3.x line is no longer under maintenance. We need verification on whether this is still a problem on 3.6. The fact that you have locally modified org.eclipse.ui.workbench also presents an additional variable in this matter.

Please provide code/reproducible steps which shows the problem on Eclipse 3.6 or one of our integration builds.
http://download.eclipse.org/eclipse/downloads/

> On what grounds is this a bug of "critical" severity?
> 
> It logs a Warning related to prevented recursive attempt to activate part and
> also create Unhandled Event loop exceptions.

What is the stack trace of the event loop exception? Is it constantly appearing? Does the workbench become unusable?
Comment 4 Prakash Rangaraj CLA 2010-08-03 01:18:31 EDT
In addition to Remy's questions:

org.eclipse.ui.internal.presentations.r33.DefaultTabFolder$1.closeButtonPressed(DefaultTabFolder.java:66)
at
org.eclipse.ui.internal.presentations.r33.PaneFolder.notifyCloseListeners(PaneFolder.java:601)
at
org.eclipse.ui.internal.presentations.r33.PaneFolder$3.close(PaneFolder.java:190)
at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:2171)
at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:324)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)


The stack trace indicates that you have pressed the close button with your mouse. Is that the case?
Comment 5 vikas CLA 2010-08-03 07:00:09 EDT
Hi 
We did not tested myApp on Target platform 3.6. 
The stack trace is observed when i click on Close button on com.myApp.SampleView. 

Following is stack trace for Unhandled Event loop Exception which is observed alongwith WARNING. The workbench is usable after this exception and WARNING message. 


org.eclipse.swt.SWTException: Widget is disposed
	at org.eclipse.swt.SWT.error(SWT.java:3777)
	at org.eclipse.swt.SWT.error(SWT.java:3695)
	at org.eclipse.swt.SWT.error(SWT.java:3666)
	at org.eclipse.swt.widgets.Widget.error(Widget.java:446)
	at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:384)
	at org.eclipse.swt.widgets.Widget.getData(Widget.java:500)
	at org.eclipse.ui.presentations.PresentationUtil$4.handleEvent(PresentationUtil.java:81)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1158)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3401)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3033)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
	at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at com.myApp.core.Application.run(Application.java:55)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethod(EclipseAppContainer.java:572)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:171)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:508)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
Comment 6 Prakash Rangaraj CLA 2010-08-03 07:08:03 EDT
"We observed that avoiding progress service with busy cursor from com.myApp.part
view, the warning is not observed. However we need busy cursor to indicate
progress small time events."

If all you need is a busy cursor, why can't you use BusyIndicator.showWhile()?
Comment 7 vikas CLA 2010-08-03 08:53:32 EDT
Hi Prakash, 
Thanks for reply. 

"If all you need is a busy cursor, why can't you use BusyIndicator.showWhile()?"

1. We require functionality to "Cancel" the long running tasks. Due to this we are using progress service with busyCursorWhile so that monitor dialog is displayed if selection is taking long time and for short time we do not see any dialog box. 

2. I tried using BusyIndicator.showWhile() and it works well. But for long running tasks, it does not provide functinality to cancel the running task.
Comment 8 Prakash Rangaraj CLA 2010-08-06 00:36:59 EDT
3.3 is out of support. We cannot fix this unless we can reproduce it in 3.6. Please try with 3.6 and let us know the steps to reproduce this.
Comment 9 Francis Upton IV CLA 2010-10-11 13:42:30 EDT
Please reopen if you can reproduce this on 3.6