Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Problem with RWTLifeCycle / disposed context and Jaas Example implemetation
Problem with RWTLifeCycle / disposed context and Jaas Example implemetation [message #129195] Tue, 21 April 2009 13:25 Go to next message
Eclipse UserFriend
Originally posted by: phiamo.gmail.com

Hello,
I tried to implement a simple JAAS Callback Handler from the JAAS
Tutorial with RAP. I got many things working. But i have a stange
behavior if i try to open a second browser window (another session):

The first time i request the URI i yust get a blank workbench, the
second time the server goes into a exception loop (see end of post)

I am not sure what i did wrong i think it is no bug in rwt i think its
the way i am working with it.

as far as i understand i should try to make sure aother session gets
created for the other browser window. i thought its done but if i change
the asyncexec call into an synced exec call i got other exceptions.
Can you tell me where the new session is created, so i could try to do
this explicitly and the display i use to show my jaashandlerdialog would
perhabs use the right one.
And is there any further documentation where i could find such topics?

sincerely philipp a. mohrenweiser.






async run:




Authentication failed:
org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadTerm inatedError
at
org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.sleep(RWTLif eCycle.java:303)
at org.eclipse.swt.widgets.Display.sleep(Display.java:742)
at
org.eclipse.jface.operation.ModalContext$ModalContextThread. block(ModalContext.java:177)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:374)
at org.xterm.auth.AbstractLoginDialog.handle(AbstractLoginDialo g.java:96)
at
javax.security.auth.login.LoginContext$SecureCallbackHandler $1.run(LoginContext.java:955)
at java.security.AccessController.doPrivileged(Native Method)
at
javax.security.auth.login.LoginContext$SecureCallbackHandler .handle(LoginContext.java:951)
at org.xterm.auth.SampleLoginModule.login(SampleLoginModule.jav a:120)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at javax.security.auth.login.LoginContext.invoke(LoginContext.j ava:769)
at javax.security.auth.login.LoginContext.access$000(LoginConte xt.java:186)
at javax.security.auth.login.LoginContext$4.run(LoginContext.ja va:683)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext.invokePriv(LoginConte xt.java:680)
at javax.security.auth.login.LoginContext.login(LoginContext.ja va:579)
at org.xterm.auth.XtermAuthHandler.login(XtermAuthHandler.java: 47)
at
org.xterm.lounge.XtermLoungeApplication.createUI(XtermLounge Application.java:24)
at
org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
at
org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:228)
at
org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:116)
at java.lang.Thread.run(Thread.java:619)

Authentication failed:
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.swt.widgets.Display.getCurrent(Display.java:142)
at org.xterm.auth.AbstractLoginDialog.handle(AbstractLoginDialo g.java:59)
at
javax.security.auth.login.LoginContext$SecureCallbackHandler $1.run(LoginContext.java:955)
at java.security.AccessController.doPrivileged(Native Method)
at
javax.security.auth.login.LoginContext$SecureCallbackHandler .handle(LoginContext.java:951)
at org.xterm.auth.SampleLoginModule.login(SampleLoginModule.jav a:120)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at javax.security.auth.login.LoginContext.invoke(LoginContext.j ava:769)
at javax.security.auth.login.LoginContext.access$000(LoginConte xt.java:186)
at javax.security.auth.login.LoginContext$4.run(LoginContext.ja va:683)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext.invokePriv(LoginConte xt.java:680)
at javax.security.auth.login.LoginContext.login(LoginContext.ja va:579)
at org.xterm.auth.XtermAuthHandler.login(XtermAuthHandler.java: 47)
at
org.xterm.lounge.XtermLoungeApplication.createUI(XtermLounge Application.java:24)
at
org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
at
org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:228)
at
org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:116)
at java.lang.Thread.run(Thread.java:619)




Synced run:




org.eclipse.swt.SWTException: Invalid thread access
at org.eclipse.swt.SWT.error(SWT.java:2572)
at org.eclipse.swt.SWT.error(SWT.java:2492)
at org.eclipse.swt.SWT.error(SWT.java:2463)
at org.eclipse.swt.widgets.Widget.error(Widget.java:832)
at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:762)
at org.eclipse.swt.widgets.Control.getBounds(Control.java:774)
at org.eclipse.jface.window.Window.constrainShellSize(Window.ja va:416)
at org.eclipse.jface.window.Window.open(Window.java:805)
at org.xterm.auth.AbstractLoginDialog$1.run(AbstractLoginDialog .java:64)
at
org.eclipse.rwt.internal.lifecycle.UICallBackManager.addSync (UICallBackManager.java:119)
at org.eclipse.swt.widgets.Display$2.run(Display.java:649)
at
org.eclipse.rwt.internal.lifecycle.UICallBackServiceHandler. runNonUIThreadWithFakeContext(UICallBackServiceHandler.java: 455)
at
org.eclipse.rwt.lifecycle.UICallBack.runNonUIThreadWithFakeC ontext(UICallBack.java:44)
at org.eclipse.swt.widgets.Display.syncExec(Display.java:647)
at org.xterm.auth.AbstractLoginDialog.handle(AbstractLoginDialo g.java:60)
at
javax.security.auth.login.LoginContext$SecureCallbackHandler $1.run(LoginContext.java:955)
at java.security.AccessController.doPrivileged(Native Method)
at
javax.security.auth.login.LoginContext$SecureCallbackHandler .handle(LoginContext.java:951)
at org.xterm.auth.SampleLoginModule.login(SampleLoginModule.jav a:120)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at javax.security.auth.login.LoginContext.invoke(LoginContext.j ava:769)
at javax.security.auth.login.LoginContext.access$000(LoginConte xt.java:186)
at javax.security.auth.login.LoginContext$4.run(LoginContext.ja va:683)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext.invokePriv(LoginConte xt.java:680)
at javax.security.auth.login.LoginContext.login(LoginContext.ja va:579)
at org.xterm.auth.XtermAuthHandler.login(XtermAuthHandler.java: 47)
at
org.xterm.lounge.XtermLoungeApplication.createUI(XtermLounge Application.java:24)
at
org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
at
org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:228)
at
org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:116)
at java.lang.Thread.run(Thread.java:619)

Authentication failed:
org.eclipse.swt.SWTException: Invalid thread access
at org.eclipse.swt.SWT.error(SWT.java:2572)
at org.eclipse.swt.SWT.error(SWT.java:2492)
at org.eclipse.swt.SWT.error(SWT.java:2463)
at org.eclipse.swt.widgets.Widget.error(Widget.java:832)
at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:762)
at org.eclipse.swt.widgets.Control.getBounds(Control.java:774)
at org.eclipse.jface.window.Window.constrainShellSize(Window.ja va:416)
at org.eclipse.jface.window.Window.open(Window.java:805)
at org.xterm.auth.AbstractLoginDialog$1.run(AbstractLoginDialog .java:64)
at
org.eclipse.rwt.internal.lifecycle.UICallBackManager.addSync (UICallBackManager.java:119)
at org.eclipse.swt.widgets.Display$2.run(Display.java:649)
at
org.eclipse.rwt.internal.lifecycle.UICallBackServiceHandler. runNonUIThreadWithFakeContext(UICallBackServiceHandler.java: 455)
at
org.eclipse.rwt.lifecycle.UICallBack.runNonUIThreadWithFakeC ontext(UICallBack.java:44)
at org.eclipse.swt.widgets.Display.syncExec(Display.java:647)
at org.xterm.auth.AbstractLoginDialog.handle(AbstractLoginDialo g.java:60)
at
javax.security.auth.login.LoginContext$SecureCallbackHandler $1.run(LoginContext.java:955)
at java.security.AccessController.doPrivileged(Native Method)
at
javax.security.auth.login.LoginContext$SecureCallbackHandler .handle(LoginContext.java:951)
at org.xterm.auth.SampleLoginModule.login(SampleLoginModule.jav a:120)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at javax.security.auth.login.LoginContext.invoke(LoginContext.j ava:769)
at javax.security.auth.login.LoginContext.access$000(LoginConte xt.java:186)
at javax.security.auth.login.LoginContext$4.run(LoginContext.ja va:683)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext.invokePriv(LoginConte xt.java:680)
at javax.security.auth.login.LoginContext.login(LoginContext.ja va:579)
at org.xterm.auth.XtermAuthHandler.login(XtermAuthHandler.java: 47)
at
org.xterm.lounge.XtermLoungeApplication.createUI(XtermLounge Application.java:24)
at
org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
at
org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:228)
at
org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:116)
at java.lang.Thread.run(Thread.java:619)
Re: Problem with RWTLifeCycle / disposed context and Jaas Example implemetation [message #129222 is a reply to message #129195] Tue, 21 April 2009 13:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: phiamo.gmail.com

Ok a little bit reading and i got it myself. i was using a singleton i
implemented myself... so it did not create another one but used the
same.. using SessionSingletonBase solved the problem.


public class MySingleton extends SessionSingletonBase {
public static MySingleton getInstance() {
return (MySingleton)getInstance(MySingleton.class);
}
// all the other stuff comes here
}

I found it in the book Eclipse Rich Ajax Platform but nowhere in the
web, could someone tell me where to find such things ? i would also like
to collect and publish them in some wiki, the rap wiki seems to be a
good idea?

thanks phil



Philipp Mohrenweiser schrieb:
> Hello,
> I tried to implement a simple JAAS Callback Handler from the JAAS
> Tutorial with RAP. I got many things working. But i have a stange
> behavior if i try to open a second browser window (another session):
>
> The first time i request the URI i yust get a blank workbench, the
> second time the server goes into a exception loop (see end of post)
>
> I am not sure what i did wrong i think it is no bug in rwt i think its
> the way i am working with it.
>
> as far as i understand i should try to make sure aother session gets
> created for the other browser window. i thought its done but if i change
> the asyncexec call into an synced exec call i got other exceptions.
> Can you tell me where the new session is created, so i could try to do
> this explicitly and the display i use to show my jaashandlerdialog would
> perhabs use the right one.
> And is there any further documentation where i could find such topics?
>
> sincerely philipp a. mohrenweiser.
>
>
>
>
>
>
> async run:
>
>
>
>
> Authentication failed:
> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadTerm inatedError
> at
> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.sleep(RWTLif eCycle.java:303)
>
> at org.eclipse.swt.widgets.Display.sleep(Display.java:742)
> at
> org.eclipse.jface.operation.ModalContext$ModalContextThread. block(ModalContext.java:177)
>
> at org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:374)
> at
> org.xterm.auth.AbstractLoginDialog.handle(AbstractLoginDialo g.java:96)
> at
> javax.security.auth.login.LoginContext$SecureCallbackHandler $1.run(LoginContext.java:955)
>
> at java.security.AccessController.doPrivileged(Native Method)
> at
> javax.security.auth.login.LoginContext$SecureCallbackHandler .handle(LoginContext.java:951)
>
> at org.xterm.auth.SampleLoginModule.login(SampleLoginModule.jav a:120)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at javax.security.auth.login.LoginContext.invoke(LoginContext.j ava:769)
> at
> javax.security.auth.login.LoginContext.access$000(LoginConte xt.java:186)
> at javax.security.auth.login.LoginContext$4.run(LoginContext.ja va:683)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> javax.security.auth.login.LoginContext.invokePriv(LoginConte xt.java:680)
> at javax.security.auth.login.LoginContext.login(LoginContext.ja va:579)
> at org.xterm.auth.XtermAuthHandler.login(XtermAuthHandler.java: 47)
> at
> org.xterm.lounge.XtermLoungeApplication.createUI(XtermLounge Application.java:24)
>
> at
> org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
>
> at
> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:228)
>
> at
> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:116)
>
> at java.lang.Thread.run(Thread.java:619)
>
> Authentication failed:
> 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.swt.widgets.Display.getCurrent(Display.java:142)
> at
> org.xterm.auth.AbstractLoginDialog.handle(AbstractLoginDialo g.java:59)
> at
> javax.security.auth.login.LoginContext$SecureCallbackHandler $1.run(LoginContext.java:955)
>
> at java.security.AccessController.doPrivileged(Native Method)
> at
> javax.security.auth.login.LoginContext$SecureCallbackHandler .handle(LoginContext.java:951)
>
> at org.xterm.auth.SampleLoginModule.login(SampleLoginModule.jav a:120)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at javax.security.auth.login.LoginContext.invoke(LoginContext.j ava:769)
> at
> javax.security.auth.login.LoginContext.access$000(LoginConte xt.java:186)
> at javax.security.auth.login.LoginContext$4.run(LoginContext.ja va:683)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> javax.security.auth.login.LoginContext.invokePriv(LoginConte xt.java:680)
> at javax.security.auth.login.LoginContext.login(LoginContext.ja va:579)
> at org.xterm.auth.XtermAuthHandler.login(XtermAuthHandler.java: 47)
> at
> org.xterm.lounge.XtermLoungeApplication.createUI(XtermLounge Application.java:24)
>
> at
> org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
>
> at
> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:228)
>
> at
> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:116)
>
> at java.lang.Thread.run(Thread.java:619)
>
>
>
>
> Synced run:
>
>
>
>
> org.eclipse.swt.SWTException: Invalid thread access
> at org.eclipse.swt.SWT.error(SWT.java:2572)
> at org.eclipse.swt.SWT.error(SWT.java:2492)
> at org.eclipse.swt.SWT.error(SWT.java:2463)
> at org.eclipse.swt.widgets.Widget.error(Widget.java:832)
> at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:762)
> at org.eclipse.swt.widgets.Control.getBounds(Control.java:774)
> at org.eclipse.jface.window.Window.constrainShellSize(Window.ja va:416)
> at org.eclipse.jface.window.Window.open(Window.java:805)
> at
> org.xterm.auth.AbstractLoginDialog$1.run(AbstractLoginDialog .java:64)
> at
> org.eclipse.rwt.internal.lifecycle.UICallBackManager.addSync (UICallBackManager.java:119)
>
> at org.eclipse.swt.widgets.Display$2.run(Display.java:649)
> at
> org.eclipse.rwt.internal.lifecycle.UICallBackServiceHandler. runNonUIThreadWithFakeContext(UICallBackServiceHandler.java: 455)
>
> at
> org.eclipse.rwt.lifecycle.UICallBack.runNonUIThreadWithFakeC ontext(UICallBack.java:44)
>
> at org.eclipse.swt.widgets.Display.syncExec(Display.java:647)
> at
> org.xterm.auth.AbstractLoginDialog.handle(AbstractLoginDialo g.java:60)
> at
> javax.security.auth.login.LoginContext$SecureCallbackHandler $1.run(LoginContext.java:955)
>
> at java.security.AccessController.doPrivileged(Native Method)
> at
> javax.security.auth.login.LoginContext$SecureCallbackHandler .handle(LoginContext.java:951)
>
> at org.xterm.auth.SampleLoginModule.login(SampleLoginModule.jav a:120)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at javax.security.auth.login.LoginContext.invoke(LoginContext.j ava:769)
> at
> javax.security.auth.login.LoginContext.access$000(LoginConte xt.java:186)
> at javax.security.auth.login.LoginContext$4.run(LoginContext.ja va:683)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> javax.security.auth.login.LoginContext.invokePriv(LoginConte xt.java:680)
> at javax.security.auth.login.LoginContext.login(LoginContext.ja va:579)
> at org.xterm.auth.XtermAuthHandler.login(XtermAuthHandler.java: 47)
> at
> org.xterm.lounge.XtermLoungeApplication.createUI(XtermLounge Application.java:24)
>
> at
> org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
>
> at
> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:228)
>
> at
> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:116)
>
> at java.lang.Thread.run(Thread.java:619)
>
> Authentication failed:
> org.eclipse.swt.SWTException: Invalid thread access
> at org.eclipse.swt.SWT.error(SWT.java:2572)
> at org.eclipse.swt.SWT.error(SWT.java:2492)
> at org.eclipse.swt.SWT.error(SWT.java:2463)
> at org.eclipse.swt.widgets.Widget.error(Widget.java:832)
> at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:762)
> at org.eclipse.swt.widgets.Control.getBounds(Control.java:774)
> at org.eclipse.jface.window.Window.constrainShellSize(Window.ja va:416)
> at org.eclipse.jface.window.Window.open(Window.java:805)
> at
> org.xterm.auth.AbstractLoginDialog$1.run(AbstractLoginDialog .java:64)
> at
> org.eclipse.rwt.internal.lifecycle.UICallBackManager.addSync (UICallBackManager.java:119)
>
> at org.eclipse.swt.widgets.Display$2.run(Display.java:649)
> at
> org.eclipse.rwt.internal.lifecycle.UICallBackServiceHandler. runNonUIThreadWithFakeContext(UICallBackServiceHandler.java: 455)
>
> at
> org.eclipse.rwt.lifecycle.UICallBack.runNonUIThreadWithFakeC ontext(UICallBack.java:44)
>
> at org.eclipse.swt.widgets.Display.syncExec(Display.java:647)
> at
> org.xterm.auth.AbstractLoginDialog.handle(AbstractLoginDialo g.java:60)
> at
> javax.security.auth.login.LoginContext$SecureCallbackHandler $1.run(LoginContext.java:955)
>
> at java.security.AccessController.doPrivileged(Native Method)
> at
> javax.security.auth.login.LoginContext$SecureCallbackHandler .handle(LoginContext.java:951)
>
> at org.xterm.auth.SampleLoginModule.login(SampleLoginModule.jav a:120)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at javax.security.auth.login.LoginContext.invoke(LoginContext.j ava:769)
> at
> javax.security.auth.login.LoginContext.access$000(LoginConte xt.java:186)
> at javax.security.auth.login.LoginContext$4.run(LoginContext.ja va:683)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> javax.security.auth.login.LoginContext.invokePriv(LoginConte xt.java:680)
> at javax.security.auth.login.LoginContext.login(LoginContext.ja va:579)
> at org.xterm.auth.XtermAuthHandler.login(XtermAuthHandler.java: 47)
> at
> org.xterm.lounge.XtermLoungeApplication.createUI(XtermLounge Application.java:24)
>
> at
> org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
>
> at
> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:228)
>
> at
> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:116)
>
> at java.lang.Thread.run(Thread.java:619)
>
Re: Problem with RWTLifeCycle / disposed context and Jaas Example implemetation [message #129249 is a reply to message #129222] Tue, 21 April 2009 14:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: phiamo.gmail.com

OK now i am experiencing the old
java.lang.IllegalStateException: The context has been disposed.

but only if i try to refresh a browser window after more than 30sekonds
(session timeout?)
i think its a wrong approach in my app but i do not know where.

thanks for any suggestions
phil

Philipp Mohrenweiser schrieb:
> Ok a little bit reading and i got it myself. i was using a singleton i
> implemented myself... so it did not create another one but used the
> same.. using SessionSingletonBase solved the problem.
>
>
> public class MySingleton extends SessionSingletonBase {
> public static MySingleton getInstance() {
> return (MySingleton)getInstance(MySingleton.class);
> }
> // all the other stuff comes here
> }
>
> I found it in the book Eclipse Rich Ajax Platform but nowhere in the
> web, could someone tell me where to find such things ? i would also like
> to collect and publish them in some wiki, the rap wiki seems to be a
> good idea?
>
> thanks phil
>
>
>
> Philipp Mohrenweiser schrieb:
>> Hello,
>> I tried to implement a simple JAAS Callback Handler from the JAAS
>> Tutorial with RAP. I got many things working. But i have a stange
>> behavior if i try to open a second browser window (another session):
>>
>> The first time i request the URI i yust get a blank workbench, the
>> second time the server goes into a exception loop (see end of post)
>>
>> I am not sure what i did wrong i think it is no bug in rwt i think its
>> the way i am working with it.
>>
>> as far as i understand i should try to make sure aother session gets
>> created for the other browser window. i thought its done but if i
>> change the asyncexec call into an synced exec call i got other
>> exceptions.
>> Can you tell me where the new session is created, so i could try to do
>> this explicitly and the display i use to show my jaashandlerdialog
>> would perhabs use the right one.
>> And is there any further documentation where i could find such topics?
>>
>> sincerely philipp a. mohrenweiser.
>>
>>
>>
>>
>>
>>
>> async run:
>>
>>
>>
>>
>> Authentication failed:
>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadTerm inatedError
>> at
>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.sleep(RWTLif eCycle.java:303)
>>
>> at org.eclipse.swt.widgets.Display.sleep(Display.java:742)
>> at
>> org.eclipse.jface.operation.ModalContext$ModalContextThread. block(ModalContext.java:177)
>>
>> at
>> org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:374)
>> at
>> org.xterm.auth.AbstractLoginDialog.handle(AbstractLoginDialo g.java:96)
>> at
>> javax.security.auth.login.LoginContext$SecureCallbackHandler $1.run(LoginContext.java:955)
>>
>> at java.security.AccessController.doPrivileged(Native Method)
>> at
>> javax.security.auth.login.LoginContext$SecureCallbackHandler .handle(LoginContext.java:951)
>>
>> at org.xterm.auth.SampleLoginModule.login(SampleLoginModule.jav a:120)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>>
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>>
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at
>> javax.security.auth.login.LoginContext.invoke(LoginContext.j ava:769)
>> at
>> javax.security.auth.login.LoginContext.access$000(LoginConte xt.java:186)
>> at
>> javax.security.auth.login.LoginContext$4.run(LoginContext.ja va:683)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at
>> javax.security.auth.login.LoginContext.invokePriv(LoginConte xt.java:680)
>> at
>> javax.security.auth.login.LoginContext.login(LoginContext.ja va:579)
>> at org.xterm.auth.XtermAuthHandler.login(XtermAuthHandler.java: 47)
>> at
>> org.xterm.lounge.XtermLoungeApplication.createUI(XtermLounge Application.java:24)
>>
>> at
>> org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
>>
>> at
>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:228)
>>
>> at
>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:116)
>>
>> at java.lang.Thread.run(Thread.java:619)
>>
>> Authentication failed:
>> 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.swt.widgets.Display.getCurrent(Display.java:142)
>> at
>> org.xterm.auth.AbstractLoginDialog.handle(AbstractLoginDialo g.java:59)
>> at
>> javax.security.auth.login.LoginContext$SecureCallbackHandler $1.run(LoginContext.java:955)
>>
>> at java.security.AccessController.doPrivileged(Native Method)
>> at
>> javax.security.auth.login.LoginContext$SecureCallbackHandler .handle(LoginContext.java:951)
>>
>> at org.xterm.auth.SampleLoginModule.login(SampleLoginModule.jav a:120)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>>
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>>
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at
>> javax.security.auth.login.LoginContext.invoke(LoginContext.j ava:769)
>> at
>> javax.security.auth.login.LoginContext.access$000(LoginConte xt.java:186)
>> at
>> javax.security.auth.login.LoginContext$4.run(LoginContext.ja va:683)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at
>> javax.security.auth.login.LoginContext.invokePriv(LoginConte xt.java:680)
>> at
>> javax.security.auth.login.LoginContext.login(LoginContext.ja va:579)
>> at org.xterm.auth.XtermAuthHandler.login(XtermAuthHandler.java: 47)
>> at
>> org.xterm.lounge.XtermLoungeApplication.createUI(XtermLounge Application.java:24)
>>
>> at
>> org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
>>
>> at
>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:228)
>>
>> at
>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:116)
>>
>> at java.lang.Thread.run(Thread.java:619)
>>
>>
>>
>>
>> Synced run:
>>
>>
>>
>>
>> org.eclipse.swt.SWTException: Invalid thread access
>> at org.eclipse.swt.SWT.error(SWT.java:2572)
>> at org.eclipse.swt.SWT.error(SWT.java:2492)
>> at org.eclipse.swt.SWT.error(SWT.java:2463)
>> at org.eclipse.swt.widgets.Widget.error(Widget.java:832)
>> at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:762)
>> at org.eclipse.swt.widgets.Control.getBounds(Control.java:774)
>> at
>> org.eclipse.jface.window.Window.constrainShellSize(Window.ja va:416)
>> at org.eclipse.jface.window.Window.open(Window.java:805)
>> at
>> org.xterm.auth.AbstractLoginDialog$1.run(AbstractLoginDialog .java:64)
>> at
>> org.eclipse.rwt.internal.lifecycle.UICallBackManager.addSync (UICallBackManager.java:119)
>>
>> at org.eclipse.swt.widgets.Display$2.run(Display.java:649)
>> at
>> org.eclipse.rwt.internal.lifecycle.UICallBackServiceHandler. runNonUIThreadWithFakeContext(UICallBackServiceHandler.java: 455)
>>
>> at
>> org.eclipse.rwt.lifecycle.UICallBack.runNonUIThreadWithFakeC ontext(UICallBack.java:44)
>>
>> at org.eclipse.swt.widgets.Display.syncExec(Display.java:647)
>> at
>> org.xterm.auth.AbstractLoginDialog.handle(AbstractLoginDialo g.java:60)
>> at
>> javax.security.auth.login.LoginContext$SecureCallbackHandler $1.run(LoginContext.java:955)
>>
>> at java.security.AccessController.doPrivileged(Native Method)
>> at
>> javax.security.auth.login.LoginContext$SecureCallbackHandler .handle(LoginContext.java:951)
>>
>> at org.xterm.auth.SampleLoginModule.login(SampleLoginModule.jav a:120)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>>
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>>
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at
>> javax.security.auth.login.LoginContext.invoke(LoginContext.j ava:769)
>> at
>> javax.security.auth.login.LoginContext.access$000(LoginConte xt.java:186)
>> at
>> javax.security.auth.login.LoginContext$4.run(LoginContext.ja va:683)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at
>> javax.security.auth.login.LoginContext.invokePriv(LoginConte xt.java:680)
>> at
>> javax.security.auth.login.LoginContext.login(LoginContext.ja va:579)
>> at org.xterm.auth.XtermAuthHandler.login(XtermAuthHandler.java: 47)
>> at
>> org.xterm.lounge.XtermLoungeApplication.createUI(XtermLounge Application.java:24)
>>
>> at
>> org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
>>
>> at
>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:228)
>>
>> at
>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:116)
>>
>> at java.lang.Thread.run(Thread.java:619)
>>
>> Authentication failed:
>> org.eclipse.swt.SWTException: Invalid thread access
>> at org.eclipse.swt.SWT.error(SWT.java:2572)
>> at org.eclipse.swt.SWT.error(SWT.java:2492)
>> at org.eclipse.swt.SWT.error(SWT.java:2463)
>> at org.eclipse.swt.widgets.Widget.error(Widget.java:832)
>> at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:762)
>> at org.eclipse.swt.widgets.Control.getBounds(Control.java:774)
>> at
>> org.eclipse.jface.window.Window.constrainShellSize(Window.ja va:416)
>> at org.eclipse.jface.window.Window.open(Window.java:805)
>> at
>> org.xterm.auth.AbstractLoginDialog$1.run(AbstractLoginDialog .java:64)
>> at
>> org.eclipse.rwt.internal.lifecycle.UICallBackManager.addSync (UICallBackManager.java:119)
>>
>> at org.eclipse.swt.widgets.Display$2.run(Display.java:649)
>> at
>> org.eclipse.rwt.internal.lifecycle.UICallBackServiceHandler. runNonUIThreadWithFakeContext(UICallBackServiceHandler.java: 455)
>>
>> at
>> org.eclipse.rwt.lifecycle.UICallBack.runNonUIThreadWithFakeC ontext(UICallBack.java:44)
>>
>> at org.eclipse.swt.widgets.Display.syncExec(Display.java:647)
>> at
>> org.xterm.auth.AbstractLoginDialog.handle(AbstractLoginDialo g.java:60)
>> at
>> javax.security.auth.login.LoginContext$SecureCallbackHandler $1.run(LoginContext.java:955)
>>
>> at java.security.AccessController.doPrivileged(Native Method)
>> at
>> javax.security.auth.login.LoginContext$SecureCallbackHandler .handle(LoginContext.java:951)
>>
>> at org.xterm.auth.SampleLoginModule.login(SampleLoginModule.jav a:120)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>>
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>>
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at
>> javax.security.auth.login.LoginContext.invoke(LoginContext.j ava:769)
>> at
>> javax.security.auth.login.LoginContext.access$000(LoginConte xt.java:186)
>> at
>> javax.security.auth.login.LoginContext$4.run(LoginContext.ja va:683)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at
>> javax.security.auth.login.LoginContext.invokePriv(LoginConte xt.java:680)
>> at
>> javax.security.auth.login.LoginContext.login(LoginContext.ja va:579)
>> at org.xterm.auth.XtermAuthHandler.login(XtermAuthHandler.java: 47)
>> at
>> org.xterm.lounge.XtermLoungeApplication.createUI(XtermLounge Application.java:24)
>>
>> at
>> org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
>>
>> at
>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:228)
>>
>> at
>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:116)
>>
>> at java.lang.Thread.run(Thread.java:619)
>>
Re: Problem with RWTLifeCycle / disposed context and Jaas Example implemetation [message #129550 is a reply to message #129249] Thu, 23 April 2009 01:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: phiamo.gmail.com

Hi,
i came to the conclusion that this is related with the bug
ProgressMonitorDialog causes an Exception on page reload
https://bugs.eclipse.org/bugs/show_bug.cgi?id=258102
i am using a open method for the callback window:
could someone verify this ? or give me another approach
while hitting f5 i get uithreadterminated error and IllegalStateExceptions
sincerly philipp a. mohrenweiser



package org.xterm.auth;

/*********************************************************** ********************
* Copyright (c) 2005, 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation

************************************************************ *******************/

import java.io.IOException;
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.login.LoginException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.operation.ModalContext;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.widgets.*;
import org.eclipse.ui.PlatformUI;

public abstract class AbstractLoginDialog extends TitleAreaDialog
implements CallbackHandler {

boolean processCallbacks = false;
boolean isCancelled = false;
Callback[] callbackArray;

protected final Callback[] getCallbacks() {
return this.callbackArray;
}

public abstract void handleLoginException(LoginException loginException);

public abstract IProgressMonitor getProgressMonitor();

public abstract void internalHandle();

public boolean isCancelled() {
return isCancelled;
}

protected AbstractLoginDialog(Shell parentShell) {
super(parentShell);
}

/* (non-Javadoc)
* @see
javax.security.auth.callback.CallbackHandler#handle(javax.se curity.auth.callback.Callback[])
*/
public void handle(final Callback[] callbacks) throws IOException {

this.callbackArray = callbacks;
Display display = null;
try{
display = Display.getDefault();
}
catch(Exception e){
display = PlatformUI.createDisplay();
System.out.println("created display !?");

}
System.out.println("Got display:");
System.out.println(display);
display.syncExec(new Runnable() {
public void run() {
isCancelled = false;
setBlockOnOpen(false);
open();

final Button okButton = getButton(IDialogConstants.OK_ID);
okButton.setText("OK");

okButton.addSelectionListener(new SelectionListener() {
public void widgetSelected(final SelectionEvent event) {
processCallbacks = true;
}

public void widgetDefaultSelected(final SelectionEvent event) {
// nothing to do
}
});

final Button cancel = getButton(IDialogConstants.CANCEL_ID);

cancel.addSelectionListener(new SelectionListener() {
public void widgetSelected(final SelectionEvent event) {
isCancelled = true;
processCallbacks = true;
}

public void widgetDefaultSelected(final SelectionEvent event) {
// nothing to do
}
});
}
});
try {
ModalContext.setAllowReadAndDispatch(true); //Works for now.
ModalContext.run(new IRunnableWithProgress() {
public void run(final IProgressMonitor monitor) {

// Wait here until OK or cancel is pressed, then let it rip. The
event listener
// is responsible for closing the dialog (in the loginSucceeded event).
while (!processCallbacks) {
try {
Thread.sleep(100);
} catch (final Exception e) {
//do nothing
}
}
processCallbacks = false;

// Call the adapter to handle the callbacks
if (!isCancelled())
internalHandle();
}
}, true, new NullProgressMonitor(), Display.getDefault());
} catch (final Exception e) {
final IOException ioe = new IOException();
ioe.initCause(e);
//throw ioe;
}
}
}



Philipp Mohrenweiser schrieb:
> OK now i am experiencing the old
> java.lang.IllegalStateException: The context has been disposed.
>
> but only if i try to refresh a browser window after more than 30sekonds
> (session timeout?)
> i think its a wrong approach in my app but i do not know where.
>
> thanks for any suggestions
> phil
>
> Philipp Mohrenweiser schrieb:
>> Ok a little bit reading and i got it myself. i was using a singleton i
>> implemented myself... so it did not create another one but used the
>> same.. using SessionSingletonBase solved the problem.
>>
>>
>> public class MySingleton extends SessionSingletonBase {
>> public static MySingleton getInstance() {
>> return (MySingleton)getInstance(MySingleton.class);
>> }
>> // all the other stuff comes here
>> }
>>
>> I found it in the book Eclipse Rich Ajax Platform but nowhere in the
>> web, could someone tell me where to find such things ? i would also
>> like to collect and publish them in some wiki, the rap wiki seems to
>> be a good idea?
>>
>> thanks phil
>>
>>
>>
>> Philipp Mohrenweiser schrieb:
>>> Hello,
>>> I tried to implement a simple JAAS Callback Handler from the JAAS
>>> Tutorial with RAP. I got many things working. But i have a stange
>>> behavior if i try to open a second browser window (another session):
>>>
>>> The first time i request the URI i yust get a blank workbench, the
>>> second time the server goes into a exception loop (see end of post)
>>>
>>> I am not sure what i did wrong i think it is no bug in rwt i think
>>> its the way i am working with it.
>>>
>>> as far as i understand i should try to make sure aother session gets
>>> created for the other browser window. i thought its done but if i
>>> change the asyncexec call into an synced exec call i got other
>>> exceptions.
>>> Can you tell me where the new session is created, so i could try to
>>> do this explicitly and the display i use to show my jaashandlerdialog
>>> would perhabs use the right one.
>>> And is there any further documentation where i could find such topics?
>>>
>>> sincerely philipp a. mohrenweiser.
>>>
>>>
>>>
>>>
>>>
>>>
>>> async run:
>>>
>>>
>>>
>>>
>>> Authentication failed:
>>>
>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadTerm inatedError
>>> at
>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.sleep(RWTLif eCycle.java:303)
>>>
>>> at org.eclipse.swt.widgets.Display.sleep(Display.java:742)
>>> at
>>> org.eclipse.jface.operation.ModalContext$ModalContextThread. block(ModalContext.java:177)
>>>
>>> at
>>> org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:374)
>>> at
>>> org.xterm.auth.AbstractLoginDialog.handle(AbstractLoginDialo g.java:96)
>>> at
>>> javax.security.auth.login.LoginContext$SecureCallbackHandler $1.run(LoginContext.java:955)
>>>
>>> at java.security.AccessController.doPrivileged(Native Method)
>>> at
>>> javax.security.auth.login.LoginContext$SecureCallbackHandler .handle(LoginContext.java:951)
>>>
>>> at
>>> org.xterm.auth.SampleLoginModule.login(SampleLoginModule.jav a:120)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>>>
>>> at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>>>
>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>> at
>>> javax.security.auth.login.LoginContext.invoke(LoginContext.j ava:769)
>>> at
>>> javax.security.auth.login.LoginContext.access$000(LoginConte xt.java:186)
>>> at
>>> javax.security.auth.login.LoginContext$4.run(LoginContext.ja va:683)
>>> at java.security.AccessController.doPrivileged(Native Method)
>>> at
>>> javax.security.auth.login.LoginContext.invokePriv(LoginConte xt.java:680)
>>> at
>>> javax.security.auth.login.LoginContext.login(LoginContext.ja va:579)
>>> at org.xterm.auth.XtermAuthHandler.login(XtermAuthHandler.java: 47)
>>> at
>>> org.xterm.lounge.XtermLoungeApplication.createUI(XtermLounge Application.java:24)
>>>
>>> at
>>> org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
>>>
>>> at
>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:228)
>>>
>>> at
>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:116)
>>>
>>> at java.lang.Thread.run(Thread.java:619)
>>>
>>> Authentication failed:
>>> 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.swt.widgets.Display.getCurrent(Display.java:142)
>>> at
>>> org.xterm.auth.AbstractLoginDialog.handle(AbstractLoginDialo g.java:59)
>>> at
>>> javax.security.auth.login.LoginContext$SecureCallbackHandler $1.run(LoginContext.java:955)
>>>
>>> at java.security.AccessController.doPrivileged(Native Method)
>>> at
>>> javax.security.auth.login.LoginContext$SecureCallbackHandler .handle(LoginContext.java:951)
>>>
>>> at
>>> org.xterm.auth.SampleLoginModule.login(SampleLoginModule.jav a:120)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>>>
>>> at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>>>
>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>> at
>>> javax.security.auth.login.LoginContext.invoke(LoginContext.j ava:769)
>>> at
>>> javax.security.auth.login.LoginContext.access$000(LoginConte xt.java:186)
>>> at
>>> javax.security.auth.login.LoginContext$4.run(LoginContext.ja va:683)
>>> at java.security.AccessController.doPrivileged(Native Method)
>>> at
>>> javax.security.auth.login.LoginContext.invokePriv(LoginConte xt.java:680)
>>> at
>>> javax.security.auth.login.LoginContext.login(LoginContext.ja va:579)
>>> at org.xterm.auth.XtermAuthHandler.login(XtermAuthHandler.java: 47)
>>> at
>>> org.xterm.lounge.XtermLoungeApplication.createUI(XtermLounge Application.java:24)
>>>
>>> at
>>> org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
>>>
>>> at
>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:228)
>>>
>>> at
>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:116)
>>>
>>> at java.lang.Thread.run(Thread.java:619)
>>>
>>>
>>>
>>>
>>> Synced run:
>>>
>>>
>>>
>>>
>>> org.eclipse.swt.SWTException: Invalid thread access
>>> at org.eclipse.swt.SWT.error(SWT.java:2572)
>>> at org.eclipse.swt.SWT.error(SWT.java:2492)
>>> at org.eclipse.swt.SWT.error(SWT.java:2463)
>>> at org.eclipse.swt.widgets.Widget.error(Widget.java:832)
>>> at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:762)
>>> at org.eclipse.swt.widgets.Control.getBounds(Control.java:774)
>>> at
>>> org.eclipse.jface.window.Window.constrainShellSize(Window.ja va:416)
>>> at org.eclipse.jface.window.Window.open(Window.java:805)
>>> at
>>> org.xterm.auth.AbstractLoginDialog$1.run(AbstractLoginDialog .java:64)
>>> at
>>> org.eclipse.rwt.internal.lifecycle.UICallBackManager.addSync (UICallBackManager.java:119)
>>>
>>> at org.eclipse.swt.widgets.Display$2.run(Display.java:649)
>>> at
>>> org.eclipse.rwt.internal.lifecycle.UICallBackServiceHandler. runNonUIThreadWithFakeContext(UICallBackServiceHandler.java: 455)
>>>
>>> at
>>> org.eclipse.rwt.lifecycle.UICallBack.runNonUIThreadWithFakeC ontext(UICallBack.java:44)
>>>
>>> at org.eclipse.swt.widgets.Display.syncExec(Display.java:647)
>>> at
>>> org.xterm.auth.AbstractLoginDialog.handle(AbstractLoginDialo g.java:60)
>>> at
>>> javax.security.auth.login.LoginContext$SecureCallbackHandler $1.run(LoginContext.java:955)
>>>
>>> at java.security.AccessController.doPrivileged(Native Method)
>>> at
>>> javax.security.auth.login.LoginContext$SecureCallbackHandler .handle(LoginContext.java:951)
>>>
>>> at
>>> org.xterm.auth.SampleLoginModule.login(SampleLoginModule.jav a:120)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>>>
>>> at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>>>
>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>> at
>>> javax.security.auth.login.LoginContext.invoke(LoginContext.j ava:769)
>>> at
>>> javax.security.auth.login.LoginContext.access$000(LoginConte xt.java:186)
>>> at
>>> javax.security.auth.login.LoginContext$4.run(LoginContext.ja va:683)
>>> at java.security.AccessController.doPrivileged(Native Method)
>>> at
>>> javax.security.auth.login.LoginContext.invokePriv(LoginConte xt.java:680)
>>> at
>>> javax.security.auth.login.LoginContext.login(LoginContext.ja va:579)
>>> at org.xterm.auth.XtermAuthHandler.login(XtermAuthHandler.java: 47)
>>> at
>>> org.xterm.lounge.XtermLoungeApplication.createUI(XtermLounge Application.java:24)
>>>
>>> at
>>> org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
>>>
>>> at
>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:228)
>>>
>>> at
>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:116)
>>>
>>> at java.lang.Thread.run(Thread.java:619)
>>>
>>> Authentication failed:
>>> org.eclipse.swt.SWTException: Invalid thread access
>>> at org.eclipse.swt.SWT.error(SWT.java:2572)
>>> at org.eclipse.swt.SWT.error(SWT.java:2492)
>>> at org.eclipse.swt.SWT.error(SWT.java:2463)
>>> at org.eclipse.swt.widgets.Widget.error(Widget.java:832)
>>> at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:762)
>>> at org.eclipse.swt.widgets.Control.getBounds(Control.java:774)
>>> at
>>> org.eclipse.jface.window.Window.constrainShellSize(Window.ja va:416)
>>> at org.eclipse.jface.window.Window.open(Window.java:805)
>>> at
>>> org.xterm.auth.AbstractLoginDialog$1.run(AbstractLoginDialog .java:64)
>>> at
>>> org.eclipse.rwt.internal.lifecycle.UICallBackManager.addSync (UICallBackManager.java:119)
>>>
>>> at org.eclipse.swt.widgets.Display$2.run(Display.java:649)
>>> at
>>> org.eclipse.rwt.internal.lifecycle.UICallBackServiceHandler. runNonUIThreadWithFakeContext(UICallBackServiceHandler.java: 455)
>>>
>>> at
>>> org.eclipse.rwt.lifecycle.UICallBack.runNonUIThreadWithFakeC ontext(UICallBack.java:44)
>>>
>>> at org.eclipse.swt.widgets.Display.syncExec(Display.java:647)
>>> at
>>> org.xterm.auth.AbstractLoginDialog.handle(AbstractLoginDialo g.java:60)
>>> at
>>> javax.security.auth.login.LoginContext$SecureCallbackHandler $1.run(LoginContext.java:955)
>>>
>>> at java.security.AccessController.doPrivileged(Native Method)
>>> at
>>> javax.security.auth.login.LoginContext$SecureCallbackHandler .handle(LoginContext.java:951)
>>>
>>> at
>>> org.xterm.auth.SampleLoginModule.login(SampleLoginModule.jav a:120)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>>>
>>> at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>>>
>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>> at
>>> javax.security.auth.login.LoginContext.invoke(LoginContext.j ava:769)
>>> at
>>> javax.security.auth.login.LoginContext.access$000(LoginConte xt.java:186)
>>> at
>>> javax.security.auth.login.LoginContext$4.run(LoginContext.ja va:683)
>>> at java.security.AccessController.doPrivileged(Native Method)
>>> at
>>> javax.security.auth.login.LoginContext.invokePriv(LoginConte xt.java:680)
>>> at
>>> javax.security.auth.login.LoginContext.login(LoginContext.ja va:579)
>>> at org.xterm.auth.XtermAuthHandler.login(XtermAuthHandler.java: 47)
>>> at
>>> org.xterm.lounge.XtermLoungeApplication.createUI(XtermLounge Application.java:24)
>>>
>>> at
>>> org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
>>>
>>> at
>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:228)
>>>
>>> at
>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:116)
>>>
>>> at java.lang.Thread.run(Thread.java:619)
>>>
Re: Problem with RWTLifeCycle / disposed context and Jaas Example implemetation [message #130175 is a reply to message #129550] Fri, 24 April 2009 16:32 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
to me it looks like you ran into this problem:
262220: Invalid Thread Access
https://bugs.eclipse.org/bugs/show_bug.cgi?id=262220

Philipp Mohrenweiser wrote:
> Hi,
> i came to the conclusion that this is related with the bug
> ProgressMonitorDialog causes an Exception on page reload
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=258102
> i am using a open method for the callback window:
> could someone verify this ? or give me another approach
> while hitting f5 i get uithreadterminated error and IllegalStateExceptions
> sincerly philipp a. mohrenweiser
>
>
>
> package org.xterm.auth;
>
> /*********************************************************** ********************
>
> * Copyright (c) 2005, 2007 IBM Corporation and others.
> * All rights reserved. This program and the accompanying materials
> * are made available under the terms of the Eclipse Public License v1.0
> * which accompanies this distribution, and is available at
> * http://www.eclipse.org/legal/epl-v10.html
> *
> * Contributors:
> * IBM Corporation - initial API and implementation
>
> ************************************************************ *******************/
>
>
> import java.io.IOException;
> import javax.security.auth.callback.Callback;
> import javax.security.auth.callback.CallbackHandler;
> import javax.security.auth.login.LoginException;
> import org.eclipse.core.runtime.IProgressMonitor;
> import org.eclipse.core.runtime.NullProgressMonitor;
> import org.eclipse.jface.dialogs.IDialogConstants;
> import org.eclipse.jface.dialogs.TitleAreaDialog;
> import org.eclipse.jface.operation.IRunnableWithProgress;
> import org.eclipse.jface.operation.ModalContext;
> import org.eclipse.swt.events.SelectionEvent;
> import org.eclipse.swt.events.SelectionListener;
> import org.eclipse.swt.widgets.*;
> import org.eclipse.ui.PlatformUI;
>
> public abstract class AbstractLoginDialog extends TitleAreaDialog
> implements CallbackHandler {
>
> boolean processCallbacks = false;
> boolean isCancelled = false;
> Callback[] callbackArray;
>
> protected final Callback[] getCallbacks() {
> return this.callbackArray;
> }
>
> public abstract void handleLoginException(LoginException
> loginException);
>
> public abstract IProgressMonitor getProgressMonitor();
>
> public abstract void internalHandle();
>
> public boolean isCancelled() {
> return isCancelled;
> }
>
> protected AbstractLoginDialog(Shell parentShell) {
> super(parentShell);
> }
>
> /* (non-Javadoc)
> * @see
> javax.security.auth.callback.CallbackHandler#handle(javax.se curity.auth.callback.Callback[])
>
> */
> public void handle(final Callback[] callbacks) throws IOException {
>
> this.callbackArray = callbacks;
> Display display = null;
> try{
> display = Display.getDefault();
> }
> catch(Exception e){
> display = PlatformUI.createDisplay();
> System.out.println("created display !?");
>
> }
> System.out.println("Got display:");
> System.out.println(display);
> display.syncExec(new Runnable() {
> public void run() {
> isCancelled = false;
> setBlockOnOpen(false);
> open();
>
> final Button okButton = getButton(IDialogConstants.OK_ID);
> okButton.setText("OK");
>
> okButton.addSelectionListener(new SelectionListener() {
> public void widgetSelected(final SelectionEvent
> event) {
> processCallbacks = true;
> }
>
> public void widgetDefaultSelected(final
> SelectionEvent event) {
> // nothing to do
> }
> });
>
> final Button cancel =
> getButton(IDialogConstants.CANCEL_ID);
>
> cancel.addSelectionListener(new SelectionListener() {
> public void widgetSelected(final SelectionEvent
> event) {
> isCancelled = true;
> processCallbacks = true;
> }
>
> public void widgetDefaultSelected(final
> SelectionEvent event) {
> // nothing to do
> }
> });
> }
> });
> try {
> ModalContext.setAllowReadAndDispatch(true); //Works for now.
> ModalContext.run(new IRunnableWithProgress() {
> public void run(final IProgressMonitor monitor) {
>
> // Wait here until OK or cancel is pressed, then let
> it rip. The event listener
> // is responsible for closing the dialog (in the
> loginSucceeded event).
> while (!processCallbacks) {
> try {
> Thread.sleep(100);
> } catch (final Exception e) {
> //do nothing
> }
> }
> processCallbacks = false;
>
> // Call the adapter to handle the callbacks
> if (!isCancelled())
> internalHandle();
> }
> }, true, new NullProgressMonitor(), Display.getDefault());
> } catch (final Exception e) {
> final IOException ioe = new IOException();
> ioe.initCause(e);
> //throw ioe;
> }
> }
> }
>
>
>
> Philipp Mohrenweiser schrieb:
>> OK now i am experiencing the old
>> java.lang.IllegalStateException: The context has been disposed.
>>
>> but only if i try to refresh a browser window after more than
>> 30sekonds (session timeout?)
>> i think its a wrong approach in my app but i do not know where.
>>
>> thanks for any suggestions
>> phil
>>
>> Philipp Mohrenweiser schrieb:
>>> Ok a little bit reading and i got it myself. i was using a singleton
>>> i implemented myself... so it did not create another one but used the
>>> same.. using SessionSingletonBase solved the problem.
>>>
>>>
>>> public class MySingleton extends SessionSingletonBase {
>>> public static MySingleton getInstance() {
>>> return (MySingleton)getInstance(MySingleton.class);
>>> }
>>> // all the other stuff comes here
>>> }
>>>
>>> I found it in the book Eclipse Rich Ajax Platform but nowhere in the
>>> web, could someone tell me where to find such things ? i would also
>>> like to collect and publish them in some wiki, the rap wiki seems to
>>> be a good idea?
>>>
>>> thanks phil
>>>
>>>
>>>
>>> Philipp Mohrenweiser schrieb:
>>>> Hello,
>>>> I tried to implement a simple JAAS Callback Handler from the JAAS
>>>> Tutorial with RAP. I got many things working. But i have a stange
>>>> behavior if i try to open a second browser window (another session):
>>>>
>>>> The first time i request the URI i yust get a blank workbench, the
>>>> second time the server goes into a exception loop (see end of post)
>>>>
>>>> I am not sure what i did wrong i think it is no bug in rwt i think
>>>> its the way i am working with it.
>>>>
>>>> as far as i understand i should try to make sure aother session gets
>>>> created for the other browser window. i thought its done but if i
>>>> change the asyncexec call into an synced exec call i got other
>>>> exceptions.
>>>> Can you tell me where the new session is created, so i could try to
>>>> do this explicitly and the display i use to show my
>>>> jaashandlerdialog would perhabs use the right one.
>>>> And is there any further documentation where i could find such topics?
>>>>
>>>> sincerely philipp a. mohrenweiser.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> async run:
>>>>
>>>>
>>>>
>>>>
>>>> Authentication failed:
>>>>
>>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadTerm inatedError
>>>> at
>>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.sleep(RWTLif eCycle.java:303)
>>>>
>>>> at org.eclipse.swt.widgets.Display.sleep(Display.java:742)
>>>> at
>>>> org.eclipse.jface.operation.ModalContext$ModalContextThread. block(ModalContext.java:177)
>>>>
>>>> at
>>>> org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:374)
>>>> at
>>>> org.xterm.auth.AbstractLoginDialog.handle(AbstractLoginDialo g.java:96)
>>>> at
>>>> javax.security.auth.login.LoginContext$SecureCallbackHandler $1.run(LoginContext.java:955)
>>>>
>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>> at
>>>> javax.security.auth.login.LoginContext$SecureCallbackHandler .handle(LoginContext.java:951)
>>>>
>>>> at
>>>> org.xterm.auth.SampleLoginModule.login(SampleLoginModule.jav a:120)
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>> at
>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>>>>
>>>> at
>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>>>>
>>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>>> at
>>>> javax.security.auth.login.LoginContext.invoke(LoginContext.j ava:769)
>>>> at
>>>> javax.security.auth.login.LoginContext.access$000(LoginConte xt.java:186)
>>>>
>>>> at
>>>> javax.security.auth.login.LoginContext$4.run(LoginContext.ja va:683)
>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>> at
>>>> javax.security.auth.login.LoginContext.invokePriv(LoginConte xt.java:680)
>>>>
>>>> at
>>>> javax.security.auth.login.LoginContext.login(LoginContext.ja va:579)
>>>> at org.xterm.auth.XtermAuthHandler.login(XtermAuthHandler.java: 47)
>>>> at
>>>> org.xterm.lounge.XtermLoungeApplication.createUI(XtermLounge Application.java:24)
>>>>
>>>> at
>>>> org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
>>>>
>>>> at
>>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:228)
>>>>
>>>> at
>>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:116)
>>>>
>>>> at java.lang.Thread.run(Thread.java:619)
>>>>
>>>> Authentication failed:
>>>> 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.swt.widgets.Display.getCurrent(Display.java:142)
>>>> at
>>>> org.xterm.auth.AbstractLoginDialog.handle(AbstractLoginDialo g.java:59)
>>>> at
>>>> javax.security.auth.login.LoginContext$SecureCallbackHandler $1.run(LoginContext.java:955)
>>>>
>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>> at
>>>> javax.security.auth.login.LoginContext$SecureCallbackHandler .handle(LoginContext.java:951)
>>>>
>>>> at
>>>> org.xterm.auth.SampleLoginModule.login(SampleLoginModule.jav a:120)
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>> at
>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>>>>
>>>> at
>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>>>>
>>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>>> at
>>>> javax.security.auth.login.LoginContext.invoke(LoginContext.j ava:769)
>>>> at
>>>> javax.security.auth.login.LoginContext.access$000(LoginConte xt.java:186)
>>>>
>>>> at
>>>> javax.security.auth.login.LoginContext$4.run(LoginContext.ja va:683)
>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>> at
>>>> javax.security.auth.login.LoginContext.invokePriv(LoginConte xt.java:680)
>>>>
>>>> at
>>>> javax.security.auth.login.LoginContext.login(LoginContext.ja va:579)
>>>> at org.xterm.auth.XtermAuthHandler.login(XtermAuthHandler.java: 47)
>>>> at
>>>> org.xterm.lounge.XtermLoungeApplication.createUI(XtermLounge Application.java:24)
>>>>
>>>> at
>>>> org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
>>>>
>>>> at
>>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:228)
>>>>
>>>> at
>>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:116)
>>>>
>>>> at java.lang.Thread.run(Thread.java:619)
>>>>
>>>>
>>>>
>>>>
>>>> Synced run:
>>>>
>>>>
>>>>
>>>>
>>>> org.eclipse.swt.SWTException: Invalid thread access
>>>> at org.eclipse.swt.SWT.error(SWT.java:2572)
>>>> at org.eclipse.swt.SWT.error(SWT.java:2492)
>>>> at org.eclipse.swt.SWT.error(SWT.java:2463)
>>>> at org.eclipse.swt.widgets.Widget.error(Widget.java:832)
>>>> at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:762)
>>>> at org.eclipse.swt.widgets.Control.getBounds(Control.java:774)
>>>> at
>>>> org.eclipse.jface.window.Window.constrainShellSize(Window.ja va:416)
>>>> at org.eclipse.jface.window.Window.open(Window.java:805)
>>>> at
>>>> org.xterm.auth.AbstractLoginDialog$1.run(AbstractLoginDialog .java:64)
>>>> at
>>>> org.eclipse.rwt.internal.lifecycle.UICallBackManager.addSync (UICallBackManager.java:119)
>>>>
>>>> at org.eclipse.swt.widgets.Display$2.run(Display.java:649)
>>>> at
>>>> org.eclipse.rwt.internal.lifecycle.UICallBackServiceHandler. runNonUIThreadWithFakeContext(UICallBackServiceHandler.java: 455)
>>>>
>>>> at
>>>> org.eclipse.rwt.lifecycle.UICallBack.runNonUIThreadWithFakeC ontext(UICallBack.java:44)
>>>>
>>>> at org.eclipse.swt.widgets.Display.syncExec(Display.java:647)
>>>> at
>>>> org.xterm.auth.AbstractLoginDialog.handle(AbstractLoginDialo g.java:60)
>>>> at
>>>> javax.security.auth.login.LoginContext$SecureCallbackHandler $1.run(LoginContext.java:955)
>>>>
>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>> at
>>>> javax.security.auth.login.LoginContext$SecureCallbackHandler .handle(LoginContext.java:951)
>>>>
>>>> at
>>>> org.xterm.auth.SampleLoginModule.login(SampleLoginModule.jav a:120)
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>> at
>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>>>>
>>>> at
>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>>>>
>>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>>> at
>>>> javax.security.auth.login.LoginContext.invoke(LoginContext.j ava:769)
>>>> at
>>>> javax.security.auth.login.LoginContext.access$000(LoginConte xt.java:186)
>>>>
>>>> at
>>>> javax.security.auth.login.LoginContext$4.run(LoginContext.ja va:683)
>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>> at
>>>> javax.security.auth.login.LoginContext.invokePriv(LoginConte xt.java:680)
>>>>
>>>> at
>>>> javax.security.auth.login.LoginContext.login(LoginContext.ja va:579)
>>>> at org.xterm.auth.XtermAuthHandler.login(XtermAuthHandler.java: 47)
>>>> at
>>>> org.xterm.lounge.XtermLoungeApplication.createUI(XtermLounge Application.java:24)
>>>>
>>>> at
>>>> org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
>>>>
>>>> at
>>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:228)
>>>>
>>>> at
>>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:116)
>>>>
>>>> at java.lang.Thread.run(Thread.java:619)
>>>>
>>>> Authentication failed:
>>>> org.eclipse.swt.SWTException: Invalid thread access
>>>> at org.eclipse.swt.SWT.error(SWT.java:2572)
>>>> at org.eclipse.swt.SWT.error(SWT.java:2492)
>>>> at org.eclipse.swt.SWT.error(SWT.java:2463)
>>>> at org.eclipse.swt.widgets.Widget.error(Widget.java:832)
>>>> at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:762)
>>>> at org.eclipse.swt.widgets.Control.getBounds(Control.java:774)
>>>> at
>>>> org.eclipse.jface.window.Window.constrainShellSize(Window.ja va:416)
>>>> at org.eclipse.jface.window.Window.open(Window.java:805)
>>>> at
>>>> org.xterm.auth.AbstractLoginDialog$1.run(AbstractLoginDialog .java:64)
>>>> at
>>>> org.eclipse.rwt.internal.lifecycle.UICallBackManager.addSync (UICallBackManager.java:119)
>>>>
>>>> at org.eclipse.swt.widgets.Display$2.run(Display.java:649)
>>>> at
>>>> org.eclipse.rwt.internal.lifecycle.UICallBackServiceHandler. runNonUIThreadWithFakeContext(UICallBackServiceHandler.java: 455)
>>>>
>>>> at
>>>> org.eclipse.rwt.lifecycle.UICallBack.runNonUIThreadWithFakeC ontext(UICallBack.java:44)
>>>>
>>>> at org.eclipse.swt.widgets.Display.syncExec(Display.java:647)
>>>> at
>>>> org.xterm.auth.AbstractLoginDialog.handle(AbstractLoginDialo g.java:60)
>>>> at
>>>> javax.security.auth.login.LoginContext$SecureCallbackHandler $1.run(LoginContext.java:955)
>>>>
>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>> at
>>>> javax.security.auth.login.LoginContext$SecureCallbackHandler .handle(LoginContext.java:951)
>>>>
>>>> at
>>>> org.xterm.auth.SampleLoginModule.login(SampleLoginModule.jav a:120)
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>> at
>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>>>>
>>>> at
>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>>>>
>>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>>> at
>>>> javax.security.auth.login.LoginContext.invoke(LoginContext.j ava:769)
>>>> at
>>>> javax.security.auth.login.LoginContext.access$000(LoginConte xt.java:186)
>>>>
>>>> at
>>>> javax.security.auth.login.LoginContext$4.run(LoginContext.ja va:683)
>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>> at
>>>> javax.security.auth.login.LoginContext.invokePriv(LoginConte xt.java:680)
>>>>
>>>> at
>>>> javax.security.auth.login.LoginContext.login(LoginContext.ja va:579)
>>>> at org.xterm.auth.XtermAuthHandler.login(XtermAuthHandler.java: 47)
>>>> at
>>>> org.xterm.lounge.XtermLoungeApplication.createUI(XtermLounge Application.java:24)
>>>>
>>>> at
>>>> org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
>>>>
>>>> at
>>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:228)
>>>>
>>>> at
>>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:116)
>>>>
>>>> at java.lang.Thread.run(Thread.java:619)
>>>>
Re: Problem with RWTLifeCycle / disposed context and Jaas Example implemetation [message #130291 is a reply to message #130175] Sun, 26 April 2009 21:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: phiamo.gmail.com

Hello Rüdiger,
thanks for your help, but i tred the patch and verifiyed that i run into
the patched code. but i still get a loop with the IllegalStateException
while trying to PlatformUI.createDisplay();
and prior to that a UIThreadTerminatedError
atm i am tring to rearrange the code and the logic but did not get any
results yet.
if you have any clues i would be very grateful.
cheers phil

Rüdiger Herrmann schrieb:
> to me it looks like you ran into this problem:
> 262220: Invalid Thread Access
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=262220
>
> Philipp Mohrenweiser wrote:
>> Hi,
>> i came to the conclusion that this is related with the bug
>> ProgressMonitorDialog causes an Exception on page reload
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=258102
>> i am using a open method for the callback window:
>> could someone verify this ? or give me another approach
>> while hitting f5 i get uithreadterminated error and
>> IllegalStateExceptions
>> sincerly philipp a. mohrenweiser
>>
>>
>>
>> package org.xterm.auth;
>>
>> /*********************************************************** ********************
>>
>> * Copyright (c) 2005, 2007 IBM Corporation and others.
>> * All rights reserved. This program and the accompanying materials
>> * are made available under the terms of the Eclipse Public License v1.0
>> * which accompanies this distribution, and is available at
>> * http://www.eclipse.org/legal/epl-v10.html
>> *
>> * Contributors:
>> * IBM Corporation - initial API and implementation
>>
>> ************************************************************ *******************/
>>
>>
>> import java.io.IOException;
>> import javax.security.auth.callback.Callback;
>> import javax.security.auth.callback.CallbackHandler;
>> import javax.security.auth.login.LoginException;
>> import org.eclipse.core.runtime.IProgressMonitor;
>> import org.eclipse.core.runtime.NullProgressMonitor;
>> import org.eclipse.jface.dialogs.IDialogConstants;
>> import org.eclipse.jface.dialogs.TitleAreaDialog;
>> import org.eclipse.jface.operation.IRunnableWithProgress;
>> import org.eclipse.jface.operation.ModalContext;
>> import org.eclipse.swt.events.SelectionEvent;
>> import org.eclipse.swt.events.SelectionListener;
>> import org.eclipse.swt.widgets.*;
>> import org.eclipse.ui.PlatformUI;
>>
>> public abstract class AbstractLoginDialog extends TitleAreaDialog
>> implements CallbackHandler {
>> boolean processCallbacks = false;
>> boolean isCancelled = false;
>> Callback[] callbackArray;
>> protected final Callback[] getCallbacks() {
>> return this.callbackArray;
>> }
>>
>> public abstract void handleLoginException(LoginException
>> loginException);
>>
>> public abstract IProgressMonitor getProgressMonitor();
>>
>> public abstract void internalHandle();
>> public boolean isCancelled() {
>> return isCancelled;
>> }
>>
>> protected AbstractLoginDialog(Shell parentShell) {
>> super(parentShell);
>> }
>>
>> /* (non-Javadoc)
>> * @see
>> javax.security.auth.callback.CallbackHandler#handle(javax.se curity.auth.callback.Callback[])
>>
>> */
>> public void handle(final Callback[] callbacks) throws IOException {
>>
>> this.callbackArray = callbacks;
>> Display display = null;
>> try{
>> display = Display.getDefault();
>> }
>> catch(Exception e){
>> display = PlatformUI.createDisplay();
>> System.out.println("created display !?");
>> }
>> System.out.println("Got display:");
>> System.out.println(display);
>> display.syncExec(new Runnable() {
>> public void run() {
>> isCancelled = false;
>> setBlockOnOpen(false);
>> open();
>>
>> final Button okButton =
>> getButton(IDialogConstants.OK_ID);
>> okButton.setText("OK");
>>
>> okButton.addSelectionListener(new SelectionListener() {
>> public void widgetSelected(final SelectionEvent
>> event) {
>> processCallbacks = true;
>> }
>>
>> public void widgetDefaultSelected(final
>> SelectionEvent event) {
>> // nothing to do
>> }
>> });
>>
>> final Button cancel =
>> getButton(IDialogConstants.CANCEL_ID);
>>
>> cancel.addSelectionListener(new SelectionListener() {
>> public void widgetSelected(final SelectionEvent
>> event) {
>> isCancelled = true;
>> processCallbacks = true;
>> }
>>
>> public void widgetDefaultSelected(final
>> SelectionEvent event) {
>> // nothing to do
>> }
>> });
>> }
>> });
>> try {
>> ModalContext.setAllowReadAndDispatch(true); //Works for now.
>> ModalContext.run(new IRunnableWithProgress() {
>> public void run(final IProgressMonitor monitor) {
>>
>> // Wait here until OK or cancel is pressed, then
>> let it rip. The event listener
>> // is responsible for closing the dialog (in the
>> loginSucceeded event).
>> while (!processCallbacks) {
>> try {
>> Thread.sleep(100);
>> } catch (final Exception e) {
>> //do nothing
>> }
>> }
>> processCallbacks = false;
>>
>> // Call the adapter to handle the callbacks
>> if (!isCancelled())
>> internalHandle();
>> }
>> }, true, new NullProgressMonitor(), Display.getDefault());
>> } catch (final Exception e) {
>> final IOException ioe = new IOException();
>> ioe.initCause(e);
>> //throw ioe;
>> }
>> }
>> }
>>
>>
>>
>> Philipp Mohrenweiser schrieb:
>>> OK now i am experiencing the old
>>> java.lang.IllegalStateException: The context has been disposed.
>>>
>>> but only if i try to refresh a browser window after more than
>>> 30sekonds (session timeout?)
>>> i think its a wrong approach in my app but i do not know where.
>>>
>>> thanks for any suggestions
>>> phil
>>>
>>> Philipp Mohrenweiser schrieb:
>>>> Ok a little bit reading and i got it myself. i was using a singleton
>>>> i implemented myself... so it did not create another one but used
>>>> the same.. using SessionSingletonBase solved the problem.
>>>>
>>>>
>>>> public class MySingleton extends SessionSingletonBase {
>>>> public static MySingleton getInstance() {
>>>> return (MySingleton)getInstance(MySingleton.class);
>>>> }
>>>> // all the other stuff comes here
>>>> }
>>>>
>>>> I found it in the book Eclipse Rich Ajax Platform but nowhere in the
>>>> web, could someone tell me where to find such things ? i would also
>>>> like to collect and publish them in some wiki, the rap wiki seems to
>>>> be a good idea?
>>>>
>>>> thanks phil
>>>>
>>>>
>>>>
>>>> Philipp Mohrenweiser schrieb:
>>>>> Hello,
>>>>> I tried to implement a simple JAAS Callback Handler from the JAAS
>>>>> Tutorial with RAP. I got many things working. But i have a stange
>>>>> behavior if i try to open a second browser window (another session):
>>>>>
>>>>> The first time i request the URI i yust get a blank workbench, the
>>>>> second time the server goes into a exception loop (see end of post)
>>>>>
>>>>> I am not sure what i did wrong i think it is no bug in rwt i think
>>>>> its the way i am working with it.
>>>>>
>>>>> as far as i understand i should try to make sure aother session
>>>>> gets created for the other browser window. i thought its done but
>>>>> if i change the asyncexec call into an synced exec call i got other
>>>>> exceptions.
>>>>> Can you tell me where the new session is created, so i could try to
>>>>> do this explicitly and the display i use to show my
>>>>> jaashandlerdialog would perhabs use the right one.
>>>>> And is there any further documentation where i could find such topics?
>>>>>
>>>>> sincerely philipp a. mohrenweiser.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> async run:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Authentication failed:
>>>>>
>>>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadTerm inatedError
>>>>>
>>>>> at
>>>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.sleep(RWTLif eCycle.java:303)
>>>>>
>>>>> at org.eclipse.swt.widgets.Display.sleep(Display.java:742)
>>>>> at
>>>>> org.eclipse.jface.operation.ModalContext$ModalContextThread. block(ModalContext.java:177)
>>>>>
>>>>> at
>>>>> org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:374)
>>>>> at
>>>>> org.xterm.auth.AbstractLoginDialog.handle(AbstractLoginDialo g.java:96)
>>>>> at
>>>>> javax.security.auth.login.LoginContext$SecureCallbackHandler $1.run(LoginContext.java:955)
>>>>>
>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>> at
>>>>> javax.security.auth.login.LoginContext$SecureCallbackHandler .handle(LoginContext.java:951)
>>>>>
>>>>> at
>>>>> org.xterm.auth.SampleLoginModule.login(SampleLoginModule.jav a:120)
>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>> at
>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>>>>>
>>>>> at
>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>>>>>
>>>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>>>> at
>>>>> javax.security.auth.login.LoginContext.invoke(LoginContext.j ava:769)
>>>>> at
>>>>> javax.security.auth.login.LoginContext.access$000(LoginConte xt.java:186)
>>>>>
>>>>> at
>>>>> javax.security.auth.login.LoginContext$4.run(LoginContext.ja va:683)
>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>> at
>>>>> javax.security.auth.login.LoginContext.invokePriv(LoginConte xt.java:680)
>>>>>
>>>>> at
>>>>> javax.security.auth.login.LoginContext.login(LoginContext.ja va:579)
>>>>> at org.xterm.auth.XtermAuthHandler.login(XtermAuthHandler.java: 47)
>>>>> at
>>>>> org.xterm.lounge.XtermLoungeApplication.createUI(XtermLounge Application.java:24)
>>>>>
>>>>> at
>>>>> org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
>>>>>
>>>>> at
>>>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:228)
>>>>>
>>>>> at
>>>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:116)
>>>>>
>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>
>>>>> Authentication failed:
>>>>> 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.swt.widgets.Display.getCurrent(Display.java:142)
>>>>> at
>>>>> org.xterm.auth.AbstractLoginDialog.handle(AbstractLoginDialo g.java:59)
>>>>> at
>>>>> javax.security.auth.login.LoginContext$SecureCallbackHandler $1.run(LoginContext.java:955)
>>>>>
>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>> at
>>>>> javax.security.auth.login.LoginContext$SecureCallbackHandler .handle(LoginContext.java:951)
>>>>>
>>>>> at
>>>>> org.xterm.auth.SampleLoginModule.login(SampleLoginModule.jav a:120)
>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>> at
>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>>>>>
>>>>> at
>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>>>>>
>>>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>>>> at
>>>>> javax.security.auth.login.LoginContext.invoke(LoginContext.j ava:769)
>>>>> at
>>>>> javax.security.auth.login.LoginContext.access$000(LoginConte xt.java:186)
>>>>>
>>>>> at
>>>>> javax.security.auth.login.LoginContext$4.run(LoginContext.ja va:683)
>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>> at
>>>>> javax.security.auth.login.LoginContext.invokePriv(LoginConte xt.java:680)
>>>>>
>>>>> at
>>>>> javax.security.auth.login.LoginContext.login(LoginContext.ja va:579)
>>>>> at org.xterm.auth.XtermAuthHandler.login(XtermAuthHandler.java: 47)
>>>>> at
>>>>> org.xterm.lounge.XtermLoungeApplication.createUI(XtermLounge Application.java:24)
>>>>>
>>>>> at
>>>>> org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
>>>>>
>>>>> at
>>>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:228)
>>>>>
>>>>> at
>>>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:116)
>>>>>
>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Synced run:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> org.eclipse.swt.SWTException: Invalid thread access
>>>>> at org.eclipse.swt.SWT.error(SWT.java:2572)
>>>>> at org.eclipse.swt.SWT.error(SWT.java:2492)
>>>>> at org.eclipse.swt.SWT.error(SWT.java:2463)
>>>>> at org.eclipse.swt.widgets.Widget.error(Widget.java:832)
>>>>> at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:762)
>>>>> at org.eclipse.swt.widgets.Control.getBounds(Control.java:774)
>>>>> at
>>>>> org.eclipse.jface.window.Window.constrainShellSize(Window.ja va:416)
>>>>> at org.eclipse.jface.window.Window.open(Window.java:805)
>>>>> at
>>>>> org.xterm.auth.AbstractLoginDialog$1.run(AbstractLoginDialog .java:64)
>>>>> at
>>>>> org.eclipse.rwt.internal.lifecycle.UICallBackManager.addSync (UICallBackManager.java:119)
>>>>>
>>>>> at org.eclipse.swt.widgets.Display$2.run(Display.java:649)
>>>>> at
>>>>> org.eclipse.rwt.internal.lifecycle.UICallBackServiceHandler. runNonUIThreadWithFakeContext(UICallBackServiceHandler.java: 455)
>>>>>
>>>>> at
>>>>> org.eclipse.rwt.lifecycle.UICallBack.runNonUIThreadWithFakeC ontext(UICallBack.java:44)
>>>>>
>>>>> at org.eclipse.swt.widgets.Display.syncExec(Display.java:647)
>>>>> at
>>>>> org.xterm.auth.AbstractLoginDialog.handle(AbstractLoginDialo g.java:60)
>>>>> at
>>>>> javax.security.auth.login.LoginContext$SecureCallbackHandler $1.run(LoginContext.java:955)
>>>>>
>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>> at
>>>>> javax.security.auth.login.LoginContext$SecureCallbackHandler .handle(LoginContext.java:951)
>>>>>
>>>>> at
>>>>> org.xterm.auth.SampleLoginModule.login(SampleLoginModule.jav a:120)
>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>> at
>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>>>>>
>>>>> at
>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>>>>>
>>>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>>>> at
>>>>> javax.security.auth.login.LoginContext.invoke(LoginContext.j ava:769)
>>>>> at
>>>>> javax.security.auth.login.LoginContext.access$000(LoginConte xt.java:186)
>>>>>
>>>>> at
>>>>> javax.security.auth.login.LoginContext$4.run(LoginContext.ja va:683)
>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>> at
>>>>> javax.security.auth.login.LoginContext.invokePriv(LoginConte xt.java:680)
>>>>>
>>>>> at
>>>>> javax.security.auth.login.LoginContext.login(LoginContext.ja va:579)
>>>>> at org.xterm.auth.XtermAuthHandler.login(XtermAuthHandler.java: 47)
>>>>> at
>>>>> org.xterm.lounge.XtermLoungeApplication.createUI(XtermLounge Application.java:24)
>>>>>
>>>>> at
>>>>> org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
>>>>>
>>>>> at
>>>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:228)
>>>>>
>>>>> at
>>>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:116)
>>>>>
>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>
>>>>> Authentication failed:
>>>>> org.eclipse.swt.SWTException: Invalid thread access
>>>>> at org.eclipse.swt.SWT.error(SWT.java:2572)
>>>>> at org.eclipse.swt.SWT.error(SWT.java:2492)
>>>>> at org.eclipse.swt.SWT.error(SWT.java:2463)
>>>>> at org.eclipse.swt.widgets.Widget.error(Widget.java:832)
>>>>> at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:762)
>>>>> at org.eclipse.swt.widgets.Control.getBounds(Control.java:774)
>>>>> at
>>>>> org.eclipse.jface.window.Window.constrainShellSize(Window.ja va:416)
>>>>> at org.eclipse.jface.window.Window.open(Window.java:805)
>>>>> at
>>>>> org.xterm.auth.AbstractLoginDialog$1.run(AbstractLoginDialog .java:64)
>>>>> at
>>>>> org.eclipse.rwt.internal.lifecycle.UICallBackManager.addSync (UICallBackManager.java:119)
>>>>>
>>>>> at org.eclipse.swt.widgets.Display$2.run(Display.java:649)
>>>>> at
>>>>> org.eclipse.rwt.internal.lifecycle.UICallBackServiceHandler. runNonUIThreadWithFakeContext(UICallBackServiceHandler.java: 455)
>>>>>
>>>>> at
>>>>> org.eclipse.rwt.lifecycle.UICallBack.runNonUIThreadWithFakeC ontext(UICallBack.java:44)
>>>>>
>>>>> at org.eclipse.swt.widgets.Display.syncExec(Display.java:647)
>>>>> at
>>>>> org.xterm.auth.AbstractLoginDialog.handle(AbstractLoginDialo g.java:60)
>>>>> at
>>>>> javax.security.auth.login.LoginContext$SecureCallbackHandler $1.run(LoginContext.java:955)
>>>>>
>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>> at
>>>>> javax.security.auth.login.LoginContext$SecureCallbackHandler .handle(LoginContext.java:951)
>>>>>
>>>>> at
>>>>> org.xterm.auth.SampleLoginModule.login(SampleLoginModule.jav a:120)
>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>> at
>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>>>>>
>>>>> at
>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>>>>>
>>>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>>>> at
>>>>> javax.security.auth.login.LoginContext.invoke(LoginContext.j ava:769)
>>>>> at
>>>>> javax.security.auth.login.LoginContext.access$000(LoginConte xt.java:186)
>>>>>
>>>>> at
>>>>> javax.security.auth.login.LoginContext$4.run(LoginContext.ja va:683)
>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>> at
>>>>> javax.security.auth.login.LoginContext.invokePriv(LoginConte xt.java:680)
>>>>>
>>>>> at
>>>>> javax.security.auth.login.LoginContext.login(LoginContext.ja va:579)
>>>>> at org.xterm.auth.XtermAuthHandler.login(XtermAuthHandler.java: 47)
>>>>> at
>>>>> org.xterm.lounge.XtermLoungeApplication.createUI(XtermLounge Application.java:24)
>>>>>
>>>>> at
>>>>> org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
>>>>>
>>>>> at
>>>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:228)
>>>>>
>>>>> at
>>>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:116)
>>>>>
>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>
Re: Problem with RWTLifeCycle / disposed context and Jaas Example implemetation [message #130357 is a reply to message #130291] Mon, 27 April 2009 07:40 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
Phil,

feel free to file a bugzilla if you can reproduce the problem. See
[1] for bug reporting guidelines.

Cheers,
Rüdiger

[1] http://wiki.eclipse.org/RAP_Bug_Reporting_Howto

Philipp Mohrenweiser wrote:
> Hello Rüdiger,
> thanks for your help, but i tred the patch and verifiyed that i run into
> the patched code. but i still get a loop with the IllegalStateException
> while trying to PlatformUI.createDisplay();
> and prior to that a UIThreadTerminatedError
> atm i am tring to rearrange the code and the logic but did not get any
> results yet.
> if you have any clues i would be very grateful.
> cheers phil
>
> Rüdiger Herrmann schrieb:
>> to me it looks like you ran into this problem:
>> 262220: Invalid Thread Access
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=262220
>>
>> Philipp Mohrenweiser wrote:
>>> Hi,
>>> i came to the conclusion that this is related with the bug
>>> ProgressMonitorDialog causes an Exception on page reload
>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=258102
>>> i am using a open method for the callback window:
>>> could someone verify this ? or give me another approach
>>> while hitting f5 i get uithreadterminated error and
>>> IllegalStateExceptions
>>> sincerly philipp a. mohrenweiser
>>>
>>>
>>>
>>> package org.xterm.auth;
>>>
>>> /*********************************************************** ********************
>>>
>>> * Copyright (c) 2005, 2007 IBM Corporation and others.
>>> * All rights reserved. This program and the accompanying materials
>>> * are made available under the terms of the Eclipse Public License v1.0
>>> * which accompanies this distribution, and is available at
>>> * http://www.eclipse.org/legal/epl-v10.html
>>> *
>>> * Contributors:
>>> * IBM Corporation - initial API and implementation
>>>
>>> ************************************************************ *******************/
>>>
>>>
>>> import java.io.IOException;
>>> import javax.security.auth.callback.Callback;
>>> import javax.security.auth.callback.CallbackHandler;
>>> import javax.security.auth.login.LoginException;
>>> import org.eclipse.core.runtime.IProgressMonitor;
>>> import org.eclipse.core.runtime.NullProgressMonitor;
>>> import org.eclipse.jface.dialogs.IDialogConstants;
>>> import org.eclipse.jface.dialogs.TitleAreaDialog;
>>> import org.eclipse.jface.operation.IRunnableWithProgress;
>>> import org.eclipse.jface.operation.ModalContext;
>>> import org.eclipse.swt.events.SelectionEvent;
>>> import org.eclipse.swt.events.SelectionListener;
>>> import org.eclipse.swt.widgets.*;
>>> import org.eclipse.ui.PlatformUI;
>>>
>>> public abstract class AbstractLoginDialog extends TitleAreaDialog
>>> implements CallbackHandler {
>>> boolean processCallbacks = false;
>>> boolean isCancelled = false;
>>> Callback[] callbackArray;
>>> protected final Callback[] getCallbacks() {
>>> return this.callbackArray;
>>> }
>>>
>>> public abstract void handleLoginException(LoginException
>>> loginException);
>>>
>>> public abstract IProgressMonitor getProgressMonitor();
>>>
>>> public abstract void internalHandle();
>>> public boolean isCancelled() {
>>> return isCancelled;
>>> }
>>>
>>> protected AbstractLoginDialog(Shell parentShell) {
>>> super(parentShell);
>>> }
>>>
>>> /* (non-Javadoc)
>>> * @see
>>> javax.security.auth.callback.CallbackHandler#handle(javax.se curity.auth.callback.Callback[])
>>>
>>> */
>>> public void handle(final Callback[] callbacks) throws IOException {
>>>
>>> this.callbackArray = callbacks;
>>> Display display = null;
>>> try{
>>> display = Display.getDefault();
>>> }
>>> catch(Exception e){
>>> display = PlatformUI.createDisplay();
>>> System.out.println("created display !?");
>>> }
>>> System.out.println("Got display:");
>>> System.out.println(display);
>>> display.syncExec(new Runnable() {
>>> public void run() {
>>> isCancelled = false;
>>> setBlockOnOpen(false);
>>> open();
>>>
>>> final Button okButton =
>>> getButton(IDialogConstants.OK_ID);
>>> okButton.setText("OK");
>>>
>>> okButton.addSelectionListener(new SelectionListener() {
>>> public void widgetSelected(final SelectionEvent
>>> event) {
>>> processCallbacks = true;
>>> }
>>>
>>> public void widgetDefaultSelected(final
>>> SelectionEvent event) {
>>> // nothing to do
>>> }
>>> });
>>>
>>> final Button cancel =
>>> getButton(IDialogConstants.CANCEL_ID);
>>>
>>> cancel.addSelectionListener(new SelectionListener() {
>>> public void widgetSelected(final SelectionEvent
>>> event) {
>>> isCancelled = true;
>>> processCallbacks = true;
>>> }
>>>
>>> public void widgetDefaultSelected(final
>>> SelectionEvent event) {
>>> // nothing to do
>>> }
>>> });
>>> }
>>> });
>>> try {
>>> ModalContext.setAllowReadAndDispatch(true); //Works for now.
>>> ModalContext.run(new IRunnableWithProgress() {
>>> public void run(final IProgressMonitor monitor) {
>>>
>>> // Wait here until OK or cancel is pressed, then
>>> let it rip. The event listener
>>> // is responsible for closing the dialog (in the
>>> loginSucceeded event).
>>> while (!processCallbacks) {
>>> try {
>>> Thread.sleep(100);
>>> } catch (final Exception e) {
>>> //do nothing
>>> }
>>> }
>>> processCallbacks = false;
>>>
>>> // Call the adapter to handle the callbacks
>>> if (!isCancelled())
>>> internalHandle();
>>> }
>>> }, true, new NullProgressMonitor(), Display.getDefault());
>>> } catch (final Exception e) {
>>> final IOException ioe = new IOException();
>>> ioe.initCause(e);
>>> //throw ioe;
>>> }
>>> }
>>> }
>>>
>>>
>>>
>>> Philipp Mohrenweiser schrieb:
>>>> OK now i am experiencing the old
>>>> java.lang.IllegalStateException: The context has been disposed.
>>>>
>>>> but only if i try to refresh a browser window after more than
>>>> 30sekonds (session timeout?)
>>>> i think its a wrong approach in my app but i do not know where.
>>>>
>>>> thanks for any suggestions
>>>> phil
>>>>
>>>> Philipp Mohrenweiser schrieb:
>>>>> Ok a little bit reading and i got it myself. i was using a
>>>>> singleton i implemented myself... so it did not create another one
>>>>> but used the same.. using SessionSingletonBase solved the problem.
>>>>>
>>>>>
>>>>> public class MySingleton extends SessionSingletonBase {
>>>>> public static MySingleton getInstance() {
>>>>> return (MySingleton)getInstance(MySingleton.class);
>>>>> }
>>>>> // all the other stuff comes here
>>>>> }
>>>>>
>>>>> I found it in the book Eclipse Rich Ajax Platform but nowhere in
>>>>> the web, could someone tell me where to find such things ? i would
>>>>> also like to collect and publish them in some wiki, the rap wiki
>>>>> seems to be a good idea?
>>>>>
>>>>> thanks phil
>>>>>
>>>>>
>>>>>
>>>>> Philipp Mohrenweiser schrieb:
>>>>>> Hello,
>>>>>> I tried to implement a simple JAAS Callback Handler from the JAAS
>>>>>> Tutorial with RAP. I got many things working. But i have a stange
>>>>>> behavior if i try to open a second browser window (another session):
>>>>>>
>>>>>> The first time i request the URI i yust get a blank workbench,
>>>>>> the second time the server goes into a exception loop (see end of
>>>>>> post)
>>>>>>
>>>>>> I am not sure what i did wrong i think it is no bug in rwt i think
>>>>>> its the way i am working with it.
>>>>>>
>>>>>> as far as i understand i should try to make sure aother session
>>>>>> gets created for the other browser window. i thought its done but
>>>>>> if i change the asyncexec call into an synced exec call i got
>>>>>> other exceptions.
>>>>>> Can you tell me where the new session is created, so i could try
>>>>>> to do this explicitly and the display i use to show my
>>>>>> jaashandlerdialog would perhabs use the right one.
>>>>>> And is there any further documentation where i could find such
>>>>>> topics?
>>>>>>
>>>>>> sincerely philipp a. mohrenweiser.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> async run:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Authentication failed:
>>>>>>
>>>>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadTerm inatedError
>>>>>>
>>>>>> at
>>>>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.sleep(RWTLif eCycle.java:303)
>>>>>>
>>>>>> at org.eclipse.swt.widgets.Display.sleep(Display.java:742)
>>>>>> at
>>>>>> org.eclipse.jface.operation.ModalContext$ModalContextThread. block(ModalContext.java:177)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:374)
>>>>>> at
>>>>>> org.xterm.auth.AbstractLoginDialog.handle(AbstractLoginDialo g.java:96)
>>>>>>
>>>>>> at
>>>>>> javax.security.auth.login.LoginContext$SecureCallbackHandler $1.run(LoginContext.java:955)
>>>>>>
>>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>>> at
>>>>>> javax.security.auth.login.LoginContext$SecureCallbackHandler .handle(LoginContext.java:951)
>>>>>>
>>>>>> at
>>>>>> org.xterm.auth.SampleLoginModule.login(SampleLoginModule.jav a:120)
>>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>> at
>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>>>>>>
>>>>>> at
>>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>>>>>>
>>>>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>>>>> at
>>>>>> javax.security.auth.login.LoginContext.invoke(LoginContext.j ava:769)
>>>>>> at
>>>>>> javax.security.auth.login.LoginContext.access$000(LoginConte xt.java:186)
>>>>>>
>>>>>> at
>>>>>> javax.security.auth.login.LoginContext$4.run(LoginContext.ja va:683)
>>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>>> at
>>>>>> javax.security.auth.login.LoginContext.invokePriv(LoginConte xt.java:680)
>>>>>>
>>>>>> at
>>>>>> javax.security.auth.login.LoginContext.login(LoginContext.ja va:579)
>>>>>> at
>>>>>> org.xterm.auth.XtermAuthHandler.login(XtermAuthHandler.java: 47)
>>>>>> at
>>>>>> org.xterm.lounge.XtermLoungeApplication.createUI(XtermLounge Application.java:24)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:228)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:116)
>>>>>>
>>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>>
>>>>>> Authentication failed:
>>>>>> 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.swt.widgets.Display.getCurrent(Display.java:142)
>>>>>> at
>>>>>> org.xterm.auth.AbstractLoginDialog.handle(AbstractLoginDialo g.java:59)
>>>>>>
>>>>>> at
>>>>>> javax.security.auth.login.LoginContext$SecureCallbackHandler $1.run(LoginContext.java:955)
>>>>>>
>>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>>> at
>>>>>> javax.security.auth.login.LoginContext$SecureCallbackHandler .handle(LoginContext.java:951)
>>>>>>
>>>>>> at
>>>>>> org.xterm.auth.SampleLoginModule.login(SampleLoginModule.jav a:120)
>>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>> at
>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>>>>>>
>>>>>> at
>>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>>>>>>
>>>>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>>>>> at
>>>>>> javax.security.auth.login.LoginContext.invoke(LoginContext.j ava:769)
>>>>>> at
>>>>>> javax.security.auth.login.LoginContext.access$000(LoginConte xt.java:186)
>>>>>>
>>>>>> at
>>>>>> javax.security.auth.login.LoginContext$4.run(LoginContext.ja va:683)
>>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>>> at
>>>>>> javax.security.auth.login.LoginContext.invokePriv(LoginConte xt.java:680)
>>>>>>
>>>>>> at
>>>>>> javax.security.auth.login.LoginContext.login(LoginContext.ja va:579)
>>>>>> at
>>>>>> org.xterm.auth.XtermAuthHandler.login(XtermAuthHandler.java: 47)
>>>>>> at
>>>>>> org.xterm.lounge.XtermLoungeApplication.createUI(XtermLounge Application.java:24)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:228)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:116)
>>>>>>
>>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Synced run:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> org.eclipse.swt.SWTException: Invalid thread access
>>>>>> at org.eclipse.swt.SWT.error(SWT.java:2572)
>>>>>> at org.eclipse.swt.SWT.error(SWT.java:2492)
>>>>>> at org.eclipse.swt.SWT.error(SWT.java:2463)
>>>>>> at org.eclipse.swt.widgets.Widget.error(Widget.java:832)
>>>>>> at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:762)
>>>>>> at org.eclipse.swt.widgets.Control.getBounds(Control.java:774)
>>>>>> at
>>>>>> org.eclipse.jface.window.Window.constrainShellSize(Window.ja va:416)
>>>>>> at org.eclipse.jface.window.Window.open(Window.java:805)
>>>>>> at
>>>>>> org.xterm.auth.AbstractLoginDialog$1.run(AbstractLoginDialog .java:64)
>>>>>> at
>>>>>> org.eclipse.rwt.internal.lifecycle.UICallBackManager.addSync (UICallBackManager.java:119)
>>>>>>
>>>>>> at org.eclipse.swt.widgets.Display$2.run(Display.java:649)
>>>>>> at
>>>>>> org.eclipse.rwt.internal.lifecycle.UICallBackServiceHandler. runNonUIThreadWithFakeContext(UICallBackServiceHandler.java: 455)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.rwt.lifecycle.UICallBack.runNonUIThreadWithFakeC ontext(UICallBack.java:44)
>>>>>>
>>>>>> at org.eclipse.swt.widgets.Display.syncExec(Display.java:647)
>>>>>> at
>>>>>> org.xterm.auth.AbstractLoginDialog.handle(AbstractLoginDialo g.java:60)
>>>>>>
>>>>>> at
>>>>>> javax.security.auth.login.LoginContext$SecureCallbackHandler $1.run(LoginContext.java:955)
>>>>>>
>>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>>> at
>>>>>> javax.security.auth.login.LoginContext$SecureCallbackHandler .handle(LoginContext.java:951)
>>>>>>
>>>>>> at
>>>>>> org.xterm.auth.SampleLoginModule.login(SampleLoginModule.jav a:120)
>>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>> at
>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>>>>>>
>>>>>> at
>>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>>>>>>
>>>>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>>>>> at
>>>>>> javax.security.auth.login.LoginContext.invoke(LoginContext.j ava:769)
>>>>>> at
>>>>>> javax.security.auth.login.LoginContext.access$000(LoginConte xt.java:186)
>>>>>>
>>>>>> at
>>>>>> javax.security.auth.login.LoginContext$4.run(LoginContext.ja va:683)
>>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>>> at
>>>>>> javax.security.auth.login.LoginContext.invokePriv(LoginConte xt.java:680)
>>>>>>
>>>>>> at
>>>>>> javax.security.auth.login.LoginContext.login(LoginContext.ja va:579)
>>>>>> at
>>>>>> org.xterm.auth.XtermAuthHandler.login(XtermAuthHandler.java: 47)
>>>>>> at
>>>>>> org.xterm.lounge.XtermLoungeApplication.createUI(XtermLounge Application.java:24)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:228)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:116)
>>>>>>
>>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>>
>>>>>> Authentication failed:
>>>>>> org.eclipse.swt.SWTException: Invalid thread access
>>>>>> at org.eclipse.swt.SWT.error(SWT.java:2572)
>>>>>> at org.eclipse.swt.SWT.error(SWT.java:2492)
>>>>>> at org.eclipse.swt.SWT.error(SWT.java:2463)
>>>>>> at org.eclipse.swt.widgets.Widget.error(Widget.java:832)
>>>>>> at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:762)
>>>>>> at org.eclipse.swt.widgets.Control.getBounds(Control.java:774)
>>>>>> at
>>>>>> org.eclipse.jface.window.Window.constrainShellSize(Window.ja va:416)
>>>>>> at org.eclipse.jface.window.Window.open(Window.java:805)
>>>>>> at
>>>>>> org.xterm.auth.AbstractLoginDialog$1.run(AbstractLoginDialog .java:64)
>>>>>> at
>>>>>> org.eclipse.rwt.internal.lifecycle.UICallBackManager.addSync (UICallBackManager.java:119)
>>>>>>
>>>>>> at org.eclipse.swt.widgets.Display$2.run(Display.java:649)
>>>>>> at
>>>>>> org.eclipse.rwt.internal.lifecycle.UICallBackServiceHandler. runNonUIThreadWithFakeContext(UICallBackServiceHandler.java: 455)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.rwt.lifecycle.UICallBack.runNonUIThreadWithFakeC ontext(UICallBack.java:44)
>>>>>>
>>>>>> at org.eclipse.swt.widgets.Display.syncExec(Display.java:647)
>>>>>> at
>>>>>> org.xterm.auth.AbstractLoginDialog.handle(AbstractLoginDialo g.java:60)
>>>>>>
>>>>>> at
>>>>>> javax.security.auth.login.LoginContext$SecureCallbackHandler $1.run(LoginContext.java:955)
>>>>>>
>>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>>> at
>>>>>> javax.security.auth.login.LoginContext$SecureCallbackHandler .handle(LoginContext.java:951)
>>>>>>
>>>>>> at
>>>>>> org.xterm.auth.SampleLoginModule.login(SampleLoginModule.jav a:120)
>>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>> at
>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>>>>>>
>>>>>> at
>>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>>>>>>
>>>>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>>>>> at
>>>>>> javax.security.auth.login.LoginContext.invoke(LoginContext.j ava:769)
>>>>>> at
>>>>>> javax.security.auth.login.LoginContext.access$000(LoginConte xt.java:186)
>>>>>>
>>>>>> at
>>>>>> javax.security.auth.login.LoginContext$4.run(LoginContext.ja va:683)
>>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>>> at
>>>>>> javax.security.auth.login.LoginContext.invokePriv(LoginConte xt.java:680)
>>>>>>
>>>>>> at
>>>>>> javax.security.auth.login.LoginContext.login(LoginContext.ja va:579)
>>>>>> at
>>>>>> org.xterm.auth.XtermAuthHandler.login(XtermAuthHandler.java: 47)
>>>>>> at
>>>>>> org.xterm.lounge.XtermLoungeApplication.createUI(XtermLounge Application.java:24)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:228)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:116)
>>>>>>
>>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>>
Re: Problem with RWTLifeCycle / disposed context and Jaas Example implemetation [message #131413 is a reply to message #129195] Tue, 05 May 2009 13:04 Go to previous messageGo to next message
laura.b is currently offline laura.bFriend
Messages: 5
Registered: July 2009
Junior Member
Hi,

I encountered the same problem as you when trying to setup JAAS with a RAP
application: if I am on the login page and hit F5 to refresh, the context
is disposed.

I used as tutorials:

http://blogs.itemis.de/stundzig/archives/130

and the org.eclipse.equinox.security.sample from Eclipse CVS repository,
so the implementation is much the same as yours.
Did you manage to find a solution?

Thank you,
Laura
Re: Problem with RWTLifeCycle / disposed context and Jaas Example implemetation [message #131437 is a reply to message #131413] Tue, 05 May 2009 13:33 Go to previous message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
Laura,

maybe the actual source of your problem is caused by this bug:
225167: [Display] dispose() causes a IllegalStateException
https://bugs.eclipse.org/bugs/show_bug.cgi?id=225167

HTH
Rüdiger


Laura Bunea wrote:
> Hi,
> I encountered the same problem as you when trying to setup JAAS with a
> RAP application: if I am on the login page and hit F5 to refresh, the
> context is disposed.
>
> I used as tutorials:
>
> http://blogs.itemis.de/stundzig/archives/130
>
> and the org.eclipse.equinox.security.sample from Eclipse CVS repository,
> so the implementation is much the same as yours. Did you manage to find
> a solution?
>
> Thank you,
> Laura
>
Previous Topic:Browser window title and flavicon on RWT level
Next Topic:TreeItem with 2 or more Images
Goto Forum:
  


Current Time: Fri Apr 19 06:30:17 GMT 2024

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

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

Back to the top