Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Invalid
-
None
-
None
-
None
Description
I am currently struggling with HTTP Whiteboard Session Listener. The custom HttpSessionListener callbacks are never getting triggered when HttpRequest#getSession() is invoked in servlets.
As an example,
@Component @HttpWhiteboardListener public final class ApplicationSession implements HttpSessionListener { private final AtomicInteger activeSessions = new AtomicInteger(); @Override public void sessionCreated(final HttpSessionEvent sessionEvent) { activeSessions.incrementAndGet(); } @Override public void sessionDestroyed(final HttpSessionEvent sessionEvent) { activeSessions.decrementAndGet(); } public boolean isSessionValid() { return activeSessions.get() != 0; } }
This is the custom listener I registered with the HTTP Whiteboard and it never gets invoked when I call HttpRequest#getSession().
The SCR Component is ACTIVE, that means, it is not ignored but never triggered.
GitHub Repo replicating the problem: https://github.com/amitjoy/whiteboard-httplistener-problem