Please excuse the length of this post. I'm getting pretty frustrated, and so I want to give as much info as might be necessary.
I'm trying to add a session listener to the "mainApp" web application of a production website that currently has a little over 2000 concurrent users at peak time, and this site is powered by Tomcat 4 on Windows. However, 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:
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.
One of the main things I'm not sure about is where this SessionListener class needs to be. Part of the confusion stems from the fact that the original developer set it up so that when JBuilder builds the app it puts all class files in all packages into a single JAR file that we stick into Tomcat\common\lib (whereas all the JSPs go into the Tomcat\webapps\mainApp directory). I've discovered that servlets created in JBuilder do get put into the JAR file, but they're not accessible there and so I have to put them into Tomcat's common\classes directory (and mimic the directory structure implied by whatever package they're in).
I wasn't sure if the same needed to be done with this session listener class, so I also copied its class file to the same place even though it's in the JAR file as well. That doesn't seem to help.
I have the session listener declared in the global web.xml in Tomcat\conf, but then I wondered if it needs to be declared in the application's web.xml located under its WEB-INF directory, and so I declared it in there, and also created the directory webapps\mainApp\WEB-INF\classes\mainApp\utility and copied the class file to there, but this still doesn't seem to help when I restart Tomcat!
When a user logs in, their account info gets loaded and they go to a welcome page that accesses some session beans, so I assume that by that point a session has been created. However, when I check in Tomcat's logs directory, nothing is going to stdout, so it's like sessionCreated isn't being called in my listener class! Any ideas why? Thanks...
Joined: Jul 15, 2003
In case anyone is searching for the answer to this, check this out: