Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » How to close ProgressMonitorDialog when all UI sessions are exited?(Case: Only one ui session is active. A progress dialog is opened. Then closed the browser.)
How to close ProgressMonitorDialog when all UI sessions are exited? [message #1707728] Tue, 08 September 2015 19:58 Go to next message
Tass Burrfoot is currently offline Tass BurrfootFriend
Messages: 19
Registered: April 2015
Junior Member
Hello

I got problems in the following test case on a RAP 2.3.2 project.

Run the web application. Open a browser to load the page. At this moment there is only one UI session. On the page there is a test button. Click it to populate the progress monitor dialog. While the dialog window is opened, closed the browser so there is no UI session active, but the jetty server is still running.

Here is the code when test button is clicked (called by the selection adapter of the button):
  private void handleTest() {
		ProgressMonitorDialog dialog = new ProgressMonitorDialog(null);
		try {
			IRunnableWithProgress rp = new IRunnableWithProgress(){
				@Override
				public void run(IProgressMonitor monitor)
						throws InvocationTargetException, InterruptedException {
					Thread.sleep(8000);
				}
			};
			dialog.run(true, true, rp);
		}
		catch (Exception e) {
			e.printStackTrace();
		}
    }
  


This method is in the entry point class of the application. When the progress dialog is opened, if I closed the browser, I got the following exceptions

    java.lang.NullPointerException
	at org.eclipse.rap.rwt.internal.serverpush.ServerPushManager.isSessionExpired(ServerPushManager.java:192)
	at org.eclipse.rap.rwt.internal.serverpush.ServerPushManager.isSessionExpired(ServerPushManager.java:187)
	at org.eclipse.rap.rwt.internal.serverpush.ServerPushManager.canReleaseBlockedRequest(ServerPushManager.java:156)
	at org.eclipse.rap.rwt.internal.serverpush.ServerPushManager.processRequest(ServerPushManager.java:140)
	at org.eclipse.rap.rwt.internal.serverpush.ServerPushServiceHandler.service(ServerPushServiceHandler.java:30)
	at org.eclipse.rap.rwt.engine.RWTServlet.handleValidRequest(RWTServlet.java:126)
	at org.eclipse.rap.rwt.engine.RWTServlet.handleRequest(RWTServlet.java:110)
	at org.eclipse.rap.rwt.engine.RWTServlet.doGet(RWTServlet.java:93)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:735)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
	at org.eclipse.rap.rwt.osgi.internal.CutOffContextPathWrapper.service(CutOffContextPathWrapper.java:106)
	at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
        ...... // ignored the remaining stack trace


    Exception in thread "ModalContext" org.eclipse.swt.SWTException: Device is disposed
	at org.eclipse.swt.SWT.error(SWT.java:3645)
	at org.eclipse.swt.SWT.error(SWT.java:3568)
	at org.eclipse.swt.SWT.error(SWT.java:3539)
	at org.eclipse.swt.widgets.Display.error(Display.java:2304)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:1088)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread$1.run(ModalContext.java:154)
	at org.eclipse.rap.rwt.internal.lifecycle.ContextUtil.runNonUIThreadWithFakeContext(ContextUtil.java:67)
	at org.eclipse.rap.rwt.internal.service.UISessionImpl.exec(UISessionImpl.java:233)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)


How can I kill the running process after the UI session is exited? Thanks
Re: How to close ProgressMonitorDialog when all UI sessions are exited? [message #1708244 is a reply to message #1707728] Mon, 14 September 2015 22:20 Go to previous message
Dmitry Dukhov is currently offline Dmitry DukhovFriend
Messages: 192
Registered: February 2013
Senior Member
if i understood right set a check dispose display

if (display.isDisposed()) {
stop all operation
}
or
if (!display.isDisposed()) {
don't run any operation
}

Previous Topic:Canvas and FILL_HOrizontal
Next Topic:CKEditor 4.x & Inline Mode on <DIV> Issues
Goto Forum:
  


Current Time: Thu Apr 18 14:16:29 GMT 2024

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