File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes HttpSessionListener  is not getting invoked Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "HttpSessionListener  is not getting invoked " Watch "HttpSessionListener  is not getting invoked " New topic

HttpSessionListener is not getting invoked


Joined: Feb 12, 2008
Posts: 2

I am supporting a j2EE application
The main components in the application is

Java 1.4
Struts 1.2.7
Weblogic 8.1 sp 4
Oracle 10 G


The sessionDestroyed method of HttpSessionListener class which is implemented by Local class is not getting invoked.

It is not happening frequently, it is happening for some of the user in the application once in a blue moon

In the application, when a user login into the application the execute method of Action is storing the Session set Maxinactive Interval as the following as

HttpSession hs = httpRequest.getSession(true);
String expireTime = ConfigProperties.getConfigValues(SESSION_EXPIRE_TIME);
int iexpireTime = Integer.parseInt(expireTime);

So when the User login the expire Time is stored in Http Session

The Application´┐Żs Listener class code is the following one

public class SessionListener implements HttpSessionListener {

public void sessionCreated(HttpSessionEvent event) {


public void sessionDestroyed(HttpSessionEvent event) {
String METHOD_NAME = "sessionDestroyed";
LogoutBusiness logoutBusiness = new LogoutBusiness();

HttpSession hs = event.getSession();
Session session = (Session)hs.getAttribute(GlobalConstants.SESSION);
if(session != null){
UserProfile userProfile = session.getProfile();
if(userProfile != null){
String LoginID = userProfile.getLoginID();
}catch(Exception e){

And the entries in web.xml file is the following one

Web .xml Entries

<display-name>APPLICATION NAME</display-name>



<servlet >
<servlet-class> common.utils. StartUpServletJAVA</servlet-class>


So can body help out to find the root cause of the issue

[ February 13, 2008: Message edited by: MATHEW ALEX ]
[ February 13, 2008: Message edited by: MATHEW ALEX ]

Kumar Garlapati
Ranch Hand

Joined: Feb 04, 2008
Posts: 38
please past the code in UBB format, please just dump the code like that.

Regards,<br />Kumar
I agree. Here's the link:
subject: HttpSessionListener is not getting invoked
It's not a secret anymore!