One other thing: most of our web app's Java classes are put into a single JAR file in JBuilder that we then dump into Tomcat's common\lib directory. However, we have to put our servlets individually into Tomcat's common\classes directory. My session listener class gets compiled into the JAR file with all of the other classes in that central package (see below), so I was wondering if perhaps this session listener class needed to be dropped individually into the same place as where the servlets go, and I've tried that (I've even tried making sure the class was also dropped into a directory in common\lib\central in case that's what it needed). However, this still isn't working for me! At least, sessionCreated and sessionDestroyed never seem to be called, according to my print statements (and the static methods they call don't seem to be updating my session HashMap).
----- Original message ----- From: "Stephen Charles Huey" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Date: Fri, 16 Jul 2004 11:41:53 -0500 Subject: RE: session listener not listening I'm trying to add this session listener to a production site that often has over 2,000 concurrent users (according to the Tomcat manager app). As far as I can tell, a session is created as soon as you log in because the very first JSP is accessing a bunch of session beans. However, my listener doesn't seem to be listening! ----- Original message ----- From: "Shapira, Yoav" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Date: Fri, 16 Jul 2004 08:51:47 -0400 Subject: RE: session listener not listening Hi, Are you sure that page you are accessing creates a session? ;) Yoav Shapira Millennium Research Informatics >-----Original Message----- >From: Stephen Charles Huey [mailto:[EMAIL PROTECTED] >Sent: Thursday, July 15, 2004 7:06 PM >To: Tomcat User >Subject: session listener not listening > >My session listener doesn't seem to be listening. At the top of my >web.xml (before any servlet elements, and I have nothing like a filter >or anything else before it), I have this: > ><listener> > <listener-class>central.OurSessionListener</listener-class> ></listener> > > > > > >Here is my listener class: > > >package central; > >import java.util.HashMap; >import javax.servlet.http.HttpSession; >import javax.servlet.http.HttpSessionEvent; >import javax.servlet.http.HttpSessionListener; > >import wwxchange.utility.*; >import wwxchange.beans.*; > >public class OurSessionListener implements HttpSessionListener { > > public void sessionCreated(HttpSessionEvent se) { > HttpSession session = se.getSession(); > UserAcctBean user = (UserAcctBean) > session.getAttribute("currentuser"); > String loginID = user.getLoginID(); > System.out.println("Added session: " + session.getId() + " for user > " + user.getLoginID()); > SystemControl.addActiveUser(session.getId(), user.getLoginID() ); > } > > public void sessionDestroyed(HttpSessionEvent se) { > HttpSession session = se.getSession(); > SystemControl.removeActiveUser(session.getId()); > System.out.println("Removed session: " + session.getId()); > } >} > > >My SystemControl's static HashMap doesn't seem to be getting updated, >and the above methods aren't even getting called because nothing is >going to stdout when I log in as different users. > >What am I doing wrong? Is my listener not registered to listen? > >Thanks, >Stephen > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
