Hello Vitaliy Kalayda,
firstly this issue was not resolved but rejected as there was not enough information about it.
Secondly, I took a glance at your case and I think you are not using the injected HTTPServletRequest correctly. To be more precise, you are trying to use it once it has been already invalidated.
The invalidate() call will actually invalidate the session when "all servlets using that session have exited the service method. Once the session invalidation is initiated, a new request must not be able to see that session." (servlet spec 3.0, section 7.5) That will happen after your app exits the logout() method, after which Weld tries to destroy the bean linked to that session (since session was invalidated). Here, you reach the @PreDestroy method, which fails to execute since you are using invalid session. Hence Weld fails to destroy the bean.
Hope it does make some sense
|