| Summary: | Application context is not active in UISessionListener#beforeDestroy under some constellations | ||
|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Ivan Furnadjiev <ivan> |
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P2 | CC: | wolfgang.pedot |
| Version: | unspecified | ||
| Target Milestone: | 2.3 M2 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
|
Description
Ivan Furnadjiev
Quote a related comment from Frank in UIThread#processShutdown: "TODO [fappel]: Think about a better solution: isActivated() checks whether the applicationContext is still activated before starting cleanup. This is due to the missing possibility of OSGi HttpService to shutdown HttpContext instances. Therefore sessions will survive the deactivation of ApplicationContext instances. In case the HttpService gets halted the corresponding ApplicationContext instances have already been deactivated and this will cause a NPE." This could be related to bug 422472. When a server push request is waiting, the servlet container may not terminate HTTPSessions. In this case, the ApplicationContext is deactivated, but the UISessions are still alive. We should consider to destroy all UISessions on ApplicationContext deactivation. If we decide to do so, commit 6916db631aa7f7772eb73c8799f864cb37d8162d can be revoked. Destroy all UISessions on ApplicationContext deactivation with change https://git.eclipse.org/r/22962. I think this change introduced another problem:
UISessionImpl does register itself as a listener with the ApplicationContext on creation but it does not unregister when it gets destroyed because of timeout or some other reason. This means UISessionImpl objects are leaking and cause a lot of exceptions when the ApplicationContext finally gets terminated because the corresponding HttpSessions may not be valid any more.
I ran into this problem when testing our RAP application (jetty-based) with the current master from git.eclipse.org. Adding
if( applicationContext != null ) {
applicationContext.removeApplicationContextListener( this );
}
in the destroy-method of UISessionImpl fixed it for me.
Reopening based on latest comment and set the priority to P2. (In reply to comment #4) > I think this change introduced another problem Fixed with change https://git.eclipse.org/r/25333. |