Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Launching a dialog on startup(Launching a dialog on startup)
Launching a dialog on startup [message #646772] Fri, 31 December 2010 02:27 Go to next message
Graham Missing name is currently offline Graham Missing nameFriend
Messages: 20
Registered: July 2010
Junior Member
I've created a RAP 1.3.1 application that has a login dialog that can be launched from the menu.

I would like to launch this login dialog on startup rather than having to go to the menu. I've tried adding code to both the postStartup and openWindows methods of my WorkbenchAdvisor class.
I'm seeing some unusual behavior. When my session expires and my login dialog is still active. My SessionStoreListener->beforeDestroy is never called and instead I see a org.eclipse.rwt.internal.lifecycle.UIThread$UIThreadTerminat edError.

If the login dialog is launched from the menu rather than on startup then when my session expires the SessionStoreListener->beforeDestroy is called correctly and no exception occurs.

I tried wrapping the login dialog run inside a execAsync in the WorkbenchAdvisor methods but that didn't help. It still showed that exception when the session expired.

How can I launch the dialog on startup so that I get the same behavior as if it was launched from the menu?

Thanks in advance.
Graham

[Updated on: Fri, 31 December 2010 02:30]

Report message to a moderator

Re: Launching a dialog on startup [message #646773 is a reply to message #646772] Fri, 31 December 2010 03:07 Go to previous messageGo to next message
Graham Missing name is currently offline Graham Missing nameFriend
Messages: 20
Registered: July 2010
Junior Member
I did some more testing.

When I run my app with RAP 1.2.2 I've noticed that if I have an open dialog (whether launched on startup or from the menu) that when the session expires my SessionStoreListener->beforeDestroy is not called and instead I see "java.lang.IllegalStateException: The context has been disposed" exception. If no dialog is active then when the session expires my SessionStoreListener->beforeDestroy is called and no exception occurs. Is this a bug?

When I run my app in RAP 1.3.1 if the dialog is launched from the menu and is still active when the session expires the SessionStoreListener->beforeDestroy is called and no exception occurs. If I launch the dialog from postStartup method of my WorkbenchAdvisor and it is still active when the session expires then the SessionStoreListener->beforeDestroy is not called and instead a org.eclipse.rwt.internal.lifecycle.UIThread$UIThreadTerminat edError occurs.
Re: Launching a dialog on startup [message #646884 is a reply to message #646773] Sun, 02 January 2011 12:48 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Hi Graham,

could you provide a stack trace?

Thanks, Ralf

--
Ralf Sternberg

Twitter: @ralfstx
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Launching a dialog on startup [message #646887 is a reply to message #646773] Sun, 02 January 2011 12:48 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Hi Graham,

could you provide a stack trace?

Thanks, Ralf

--
Ralf Sternberg

Twitter: @ralfstx
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Launching a dialog on startup [message #646890 is a reply to message #646884] Sun, 02 January 2011 15:47 Go to previous messageGo to next message
Graham Missing name is currently offline Graham Missing nameFriend
Messages: 20
Registered: July 2010
Junior Member
Looks like the issue I was having in RAP 1.3.1 was my fault. I had a try catch block that was catching the UIThread$UIThreadTerminatedError exception instead of flowing it back into the RAP framework. Once I removed it then when the session expired the beforeDestroy was called correctly (in both cases where the action is launch from the menu or on startup in the postStartup method). Now this same code still doesn't work in RAP 1.2.2 If I leave the dialog open then when the session expires the following exception occurs. I've supplied the code snippet and exeption below:

public void postStartup()
{
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
public void run()
{
LoginAction loginAction = new LoginAction();
loginAction.run();
}
});
}

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:166)
at org.eclipse.rwt.SessionSingletonBase.getInstance(SessionSing letonBase.java:84)
at org.eclipse.ui.internal.Workbench.getInstance(Workbench.java :466)
at org.eclipse.ui.internal.ExceptionHandler.handleException(Exc eptionHandler.java:60)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2489)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2444)
at org.eclipse.ui.internal.Workbench.access$5(Workbench.java:22 95)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:514)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:497)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:157)
at com.ebss.common.cm.Application.createUI(Application.java:80)
at org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:231)
at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:119)
at java.lang.Thread.run(Thread.java:595)
Exception in thread "UIThread [1wwjhc64x6i8o]" 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.getRequest(S erviceContext.java:82)
at org.eclipse.rwt.internal.service.ContextProvider.getRequest( ContextProvider.java:129)
at org.eclipse.rwt.internal.service.ContextProvider.getSession( ContextProvider.java:148)
at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.setShutdownA dapter(RWTLifeCycle.java:350)
at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.access$0(RWT LifeCycle.java:347)
at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:133)
at java.lang.Thread.run(Thread.java:595)
Re: Launching a dialog on startup [message #646974 is a reply to message #646890] Mon, 03 January 2011 16:44 Go to previous message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Hi Graham,

ok, catching Throwables in the UI code is fatal.

The exception you get in 1.2.2 may be related to [1]. There were a couple
of issues in this area that have been resolved in RAP 1.3.

Regards, Ralf

[1] 219465: Run session invalidation code on UI thread
https://bugs.eclipse.org/bugs/show_bug.cgi?id=219465

--
Ralf Sternberg

Twitter: @ralfstx
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:[ANN] Updated JFace and workbench to 3.7
Next Topic:Wrong Composite width with Decoration
Goto Forum:
  


Current Time: Thu Apr 18 18:17:01 GMT 2024

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

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

Back to the top