tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harry Koehnemann <...@asu.edu>
Subject NullPointerException in StandardSession w/ Tomcat 4.1.8
Date Thu, 08 Aug 2002 16:45:32 GMT
Hi all,

I'm not sure if this is a developer question.  But, I tried this question on Tomcat user and
didn't receive any responses.  Any help is appreciated.  Thanks.

-------- Original Message --------
Subject: NullPointerException in StandardSession w/ Tomcat 4.1.8
Date: Tue, 06 Aug 2002 17:02:22 -0700
From: Harry Koehnemann <hek@asu.edu>
Reply-To: Tomcat Users List <tomcat-user@jakarta.apache.org>
To: tomcat-user@jakarta.apache.org

Hi, 

I'm in need of scaling a webapp in Tomcat to multiple boxes and need to solve the shared servlet
session problem.  We wrote an RMI-based session server 4 years ago and it's been heavily utilized
with several servet engines hitting it.  There is an internal push to keep it as it's been
very reliable at managing and reaping sessions and scale.

I've written a little adapter that extends ManagerBase and overloads interesting methods to
read and write sessions to that existing server.  CreateSession() and addSession() appear
to work fine but the first servlet to call findSession() generates this exception.

java.lang.NullPointerException
	at org.apache.catalina.session.StandardSession.setAttribute(StandardSession.java:1268)
	at org.apache.catalina.session.StandardSessionFacade.setAttribute(StandardSessionFacade.java:191)
	at org.apache.catalina.session.StandardSessionFacade.setAttribute(StandardSessionFacade.java:191)
	at Session1.doGet(Unknown Source)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
	<snip>

Looking at CVS, StandardSession.java:1268 is 

    Context context = (Context) manager.getContainer();

I notice manager is not transient and think that may be my problem.  I'm not sure that StandardSession
objects can be serialized then brought back into the container as I'm attempting.  Can they?
 If so, any pointers on what I might be doing wrong?

Also, I see Tomcat ships with a session manager that appears to share sessions using a multicast
socket.  I assume this manager broadcast all session changes to all other engines.  Does anyone
have performance stats on how much work it is for the engine to receive these sessions as
a site scales.  It seems that adding more servlet engines causes more work for the servlet
engines using this scheme.

Regards,
Harry.

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message