Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » ProgressMonitorDialog caused an Exception (context disposed) on page reload
ProgressMonitorDialog caused an Exception (context disposed) on page reload [message #115012] Tue, 09 December 2008 13:35 Go to next message
Marcus Lehmann is currently offline Marcus LehmannFriend
Messages: 3
Registered: July 2009
Junior Member
Hi

I want to use org.eclipse.jface.dialogs.ProgressMonitorDialog. But when I
reload the page while the dialog is open an IllegalStateException is
thrown and the browserwindow is empty.

Any hints?

Regards,
Marcus


------------------------------------------------------------ -------
org.eclipse.core.commands_3.4.0.I20080509-2000.jar
org.eclipse.equinox.common_3.4.0.v20080421-2006.jar
org.eclipse.rap.jface_1.1.1.20080917-1625.jar
org.eclipse.rap.rwt.q07_1.1.1.20080917-1625.jar
org.eclipse.rap.rwt_1.1.1.20080917-1625.jar
------------------------------------------------------------ -------

package mypackage;


import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.rwt.lifecycle.IEntryPoint;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;


public class MyEntryPoint implements IEntryPoint{

public int createUI() {

Display display = new Display();
Shell shell = new Shell(display, SWT.TITLE);

IRunnableWithProgress runnable = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws
InvocationTargetException, InterruptedException {
monitor.setTaskName("Taskname");
while (true) { // check state
monitor.subTask("subtask");
Thread.sleep(1000); // suspend workingthread
}
}
};

ProgressMonitorDialog progressMonitorDialog = new
ProgressMonitorDialog(shell);

try {
progressMonitorDialog.run(true, false, runnable);
} catch (InvocationTargetException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}

shell.open();
shell.setMaximized(true);
while(!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
return 0;
}
}


------------------------------------------------------------ -------


java.lang.IllegalStateException: The context has been disposed.
at
org.eclipse.rwt.internal.service.ServiceContext.checkState(S erviceContext.java:154)
at
org.eclipse.rwt.internal.service.ServiceContext.getStateInfo (ServiceContext.java:104)
at
org.eclipse.rwt.internal.service.ContextProvider.getStateInf o(ContextProvider.java:165)
at
org.eclipse.rwt.SessionSingletonBase.getInstance(SessionSing letonBase.java:84)
at
org.eclipse.jface.resource.JFaceResources$FontRegistryStore. getInstance(JFaceResources.java:146)
at
org.eclipse.jface.resource.JFaceResources.getFontRegistry(JF aceResources.java:515)
at org.eclipse.jface.window.Window.close(Window.java:318)
at org.eclipse.jface.dialogs.Dialog.close(Dialog.java:1021)
at
org.eclipse.jface.dialogs.ProgressMonitorDialog.close(Progre ssMonitorDialog.java:366)
at
org.eclipse.jface.dialogs.ProgressMonitorDialog.finishedRun( ProgressMonitorDialog.java:608)
at
org.eclipse.jface.dialogs.ProgressMonitorDialog.run(Progress MonitorDialog.java:524)
at raptest.RAPEntryPoint.createUI(RAPEntryPoint.java:135)
at
org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
at
org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:230)
at
org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:116)
at java.lang.Thread.run(Unknown Source)
Exception in thread "UIThread [0252D9008BDAE0D97EB506B16522CAC5]"
java.lang.IllegalStateException: The context has been disposed.
at
org.eclipse.rwt.internal.service.ServiceContext.checkState(S erviceContext.java:154)
at
org.eclipse.rwt.internal.service.ServiceContext.getStateInfo (ServiceContext.java:104)
at
org.eclipse.rwt.internal.service.ContextProvider.getStateInf o(ContextProvider.java:165)
at
org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:133)
at java.lang.Thread.run(Unknown Source)
Re: ProgressMonitorDialog caused an Exception (context disposed) on page reload [message #115064 is a reply to message #115012] Tue, 09 December 2008 15:15 Go to previous message
Eclipse UserFriend
Originally posted by: rherrmann.innoopract.com

Markus,

I opened this bug:
258102: ProgressMonitorDialog causes an Exception on page reload
https://bugs.eclipse.org/bugs/show_bug.cgi?id=258102

though I get an IllegalThreadAccess, I assume the cause is the same.

Cheers,
RĂ¼diger

Marcus wrote:
> Hi
>
> I want to use org.eclipse.jface.dialogs.ProgressMonitorDialog. But when
> I reload the page while the dialog is open an IllegalStateException is
> thrown and the browserwindow is empty.
> Any hints?
>
> Regards,
> Marcus
>
>
> ------------------------------------------------------------ -------
> org.eclipse.core.commands_3.4.0.I20080509-2000.jar
> org.eclipse.equinox.common_3.4.0.v20080421-2006.jar
> org.eclipse.rap.jface_1.1.1.20080917-1625.jar
> org.eclipse.rap.rwt.q07_1.1.1.20080917-1625.jar
> org.eclipse.rap.rwt_1.1.1.20080917-1625.jar
> ------------------------------------------------------------ -------
>
> package mypackage;
>
>
> import java.lang.reflect.InvocationTargetException;
> import org.eclipse.core.runtime.IProgressMonitor;
> import org.eclipse.jface.dialogs.ProgressMonitorDialog;
> import org.eclipse.jface.operation.IRunnableWithProgress;
> import org.eclipse.rwt.lifecycle.IEntryPoint;
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.widgets.Display;
> import org.eclipse.swt.widgets.Shell;
>
>
> public class MyEntryPoint implements IEntryPoint{
>
> public int createUI() {
>
> Display display = new Display();
> Shell shell = new Shell(display, SWT.TITLE);
>
> IRunnableWithProgress runnable = new IRunnableWithProgress() {
> public void run(IProgressMonitor monitor) throws
> InvocationTargetException, InterruptedException {
> monitor.setTaskName("Taskname");
> while (true) { // check state
> monitor.subTask("subtask");
> Thread.sleep(1000); // suspend workingthread
> }
> }
> };
>
> ProgressMonitorDialog progressMonitorDialog = new
> ProgressMonitorDialog(shell);
>
> try {
> progressMonitorDialog.run(true, false, runnable);
> } catch (InvocationTargetException e) {
> e.printStackTrace();
> } catch (InterruptedException e) {
> e.printStackTrace();
> } catch (Exception e) {
> e.printStackTrace();
> }
>
> shell.open();
> shell.setMaximized(true);
> while(!shell.isDisposed()) {
> if (!display.readAndDispatch()) {
> display.sleep();
> }
> }
> return 0;
> }
> }
>
>
> ------------------------------------------------------------ -------
>
>
> java.lang.IllegalStateException: The context has been disposed.
> at
> org.eclipse.rwt.internal.service.ServiceContext.checkState(S erviceContext.java:154)
>
> at
> org.eclipse.rwt.internal.service.ServiceContext.getStateInfo (ServiceContext.java:104)
>
> at
> org.eclipse.rwt.internal.service.ContextProvider.getStateInf o(ContextProvider.java:165)
>
> at
> org.eclipse.rwt.SessionSingletonBase.getInstance(SessionSing letonBase.java:84)
>
> at
> org.eclipse.jface.resource.JFaceResources$FontRegistryStore. getInstance(JFaceResources.java:146)
>
> at
> org.eclipse.jface.resource.JFaceResources.getFontRegistry(JF aceResources.java:515)
>
> at org.eclipse.jface.window.Window.close(Window.java:318)
> at org.eclipse.jface.dialogs.Dialog.close(Dialog.java:1021)
> at
> org.eclipse.jface.dialogs.ProgressMonitorDialog.close(Progre ssMonitorDialog.java:366)
>
> at
> org.eclipse.jface.dialogs.ProgressMonitorDialog.finishedRun( ProgressMonitorDialog.java:608)
>
> at
> org.eclipse.jface.dialogs.ProgressMonitorDialog.run(Progress MonitorDialog.java:524)
>
> at raptest.RAPEntryPoint.createUI(RAPEntryPoint.java:135)
> at
> org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
>
> at
> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:230)
>
> at
> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:116)
>
> at java.lang.Thread.run(Unknown Source)
> Exception in thread "UIThread [0252D9008BDAE0D97EB506B16522CAC5]"
> java.lang.IllegalStateException: The context has been disposed.
> at
> org.eclipse.rwt.internal.service.ServiceContext.checkState(S erviceContext.java:154)
>
> at
> org.eclipse.rwt.internal.service.ServiceContext.getStateInfo (ServiceContext.java:104)
>
> at
> org.eclipse.rwt.internal.service.ContextProvider.getStateInf o(ContextProvider.java:165)
>
> at
> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:133)
>
> at java.lang.Thread.run(Unknown Source)
>
Previous Topic:Translate plug-in manifest
Next Topic:Changing date format of DateTime widget
Goto Forum:
  


Current Time: Wed Feb 08 12:04:43 GMT 2023

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

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

Back to the top