Unfortunately the FacesContext, not being set on the current ThreadLocalVariable, is causing issues, as attempting to access the ExternalContext runs into the assertNotReleased() check. In this scenario, the user is trying to access the Session through the FacesContext in order to remove a session variable. Is it unsafe to set the FacesContext on the new Thread? If so, perhaps we could also allow injecting the ExternalContext or Session object?
WARNING: Failed to invokeinterface org.icefaces.bean.AllWindowsClosed on class com.acme.bean.web.UserInfoB
ean
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.icefaces.impl.application.WindowScopeManager.callAnnotatedMethod(WindowScopeManager.java:282)
at org.icefaces.impl.application.WindowScopeManager.access$1900(WindowScopeManager.java:42)
at org.icefaces.impl.application.WindowScopeManager$AllWindowsClosedNotifier.run(WindowScopeManager.java:655)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Caused by: java.lang.IllegalStateException
at com.sun.faces.context.FacesContextImpl.assertNotReleased(FacesContextImpl.java:654)
at com.sun.faces.context.FacesContextImpl.getExternalContext(FacesContextImpl.java:139)
at org.icefaces.impl.context.ICEfacesContext.getExternalContext(ICEfacesContext.java:25)
at com.acme.bean.web.UserInfoBean.allWindowsForSessionClosed(UserInfoBean.java:204)
... 9 more