I am using Spring/Hibernate and Spring-Security for my web-based application. Now I have a requirement where I need to perform some database query at sessionDestroy method of HtppSessionLister.
Inside web.xml :
<listener>
<listener-class>com.test.TestSessionListner</listener-class>
</listener>
<session-config>
<session-timeout>1</session-timeout>
</session-config>
With my implementation, after session timeout (of 1 min), its calling the sessionDestroyed method and fetching the required Object of TestFacade from the ApplicationContext.
Now my problem is whenever I am calling the following method using userFacade, its not able to execute the code inside the method :
Person person = testFacade.findPersonByUserId(userId);
How can I identify the root cause for this?
Finally got the issue….
Inside
sessionDestroyedI was calling a method :which needs some higher permissions then
anonymousUserto execute the method, and atsessionDestroyedits clearing the existing user and callingsessionDestroyedmethod withanonymousUserpermission.So finally I have written a code, which is calling a method using Administrator writes.