Login screen causes a null pointer exception in ExceptionHandler.handleException(Throwable t) [message #659539] |
Mon, 14 March 2011 09:37  |
Eclipse User |
|
|
|
We have a RAP application based on 1.3 M3, its contents depends on the user authorizations.
That's why we implemented an ApplicationWindow. It is called in the IEntryPoint.createUI().
We do call the Window.run() method.
Here is the code
public void run()
{
// Don't return from open() until window closes
setBlockOnOpen(true);
// Set the shell style
setShellStyle(SWT.TITLE);
// Open the main window
open();
}
So this blocks until the window closes, and then we create the workbench.
It has worked fine for monthes.
But we have problems on a production environnement. The log is
java.lang.NullPointerException
org.eclipse.ui.internal.ExceptionHandler.handleException(Exc eptionHandler.java:62)
org.eclipse.jface.window.Window.runEventLoop(Window.java:838 )
org.eclipse.jface.window.Window.open(Window.java:810)
The line that seems to cause the problem is
wb.getAdvisor().eventLoopException(t);
Well, I'm confused because that problem did not appear before, and now it appears on
a production environnement...
Ca you give me the reason ?
Otherwise, what is the best way to implement the type of login screen I want ?
Thanks
|
|
|
|
|
Re: Login screen causes a null pointer exception in ExceptionHandler.handleException(Throwable t) [message #659763 is a reply to message #659757] |
Tue, 15 March 2011 10:24  |
Eclipse User |
|
|
|
I think the actual problem is caused by bug
340008: Consider Window#setExceptionHandler() to have session scope
https://bugs.eclipse.org/bugs/show_bug.cgi?id=340008
HTH
Rüdiger
On 15.03.2011 15:12, Philippe NEMBRARD wrote:
> here is my code
>
> public int createUI()
> {
> Display display = PlatformUI.createDisplay();
> // Display login dialog until logged in
> TPMUserInfo userInfo = null;
> while (userInfo == null)
> {
> LoginScreen loginScreen = new LoginScreen(display.getActiveShell());
> loginScreen.run();
> userInfo = loginScreen.getUserInfo();
>
> if (userInfo != null)
> {
> // save user info and rights into session
> RWT.getSessionStore().setAttribute("userInfo", userInfo);
> }
> }
>
> // The user is authenticated, start the workbench
> if (userInfo != null)
> {
> PlatformUI.createAndRunWorkbench(display,
> new ApplicationWorkbenchAdvisor());
> return PlatformUI.RETURN_OK;
> }
> // User authentication failed, stop application
> else
> {
> return PlatformUI.RETURN_EMERGENCY_CLOSE;
> }
> }
>
> In this way of coding, I understand that it could cause a problem in
> org.eclipse.ui.internal.ExceptionHandler.handleException
>
> that is why i patch RAP code as follows
>
> Workbench wb = Workbench.getInstance();
> //if (wb != null) if (wb != null && wb.getAdvisor() != null)
> {
> wb.getAdvisor().eventLoopException(t);
> }
>
> In fact we never had this problem before, but now in the new production
> environnement the machine is really faster, and i think it is the reason
> that this problem has revealed.
>
> What is for your the best way of creating a login screen.
>
> Thanks for your answer
|
|
|
Powered by
FUDForum. Page generated in 0.03623 seconds