You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Greg Vilardi <gv...@recurrentsoft.com> on 2005/04/27 00:47:14 UTC

(Fwd) Session attributes disappear between .jsp pages

For the record, I figured this out. Our webapp was automatically reloading 
every 15 seconds, and that was killing our non serializable objects out of the 
sessions. 

Now, does anyone know why a single .jar file that is __NOT__ changing, might 
cause a context reload to occur? The jar is provided by a third-party API and 
contains some older version of the org.apache.xerces.* classes and 
org.apache.xml.* too. Could that be causing us problems? Note that this .jar 
does not cause problems in our other webapps, where it is used identically. 
Setting debug to 4 doesn't help, and the catalina.out shows lots of lines like 
this:
 Apr 25, 2005 2:15:47 PM org.apache.catalina.loader.WebappClassLoader modified
INFO:     Additional JARs have been added : 'achexxml-2_0.jar'
Apr 25, 2005 2:15:47 PM org.apache.catalina.core.StandardContext reload
INFO: Reloading this Context has started
Apr 25, 2005 2:15:57 PM org.apache.catalina.loader.WebappClassLoader modified
INFO:     Additional JARs have been added : 'achexxml-2_0.jar'
Apr 25, 2005 2:15:57 PM org.apache.catalina.core.StandardContext reload

Hopefully this question is better formed than the last one.

Thanks for any help you can offer...

	-Greg
------- Forwarded message follows -------
Send reply to:  	"Tomcat Users List" <to...@jakarta.apache.org>
From:           	"Greg Vilardi" <gv...@recurrentsoft.com>
Organization:   	Recurrent Software Solutions, Inc.
To:             	tomcat-user@jakarta.apache.org
Date sent:      	Thu, 21 Apr 2005 18:03:55 -0400
Subject:        	Session attributes disappear between .jsp pages 
Send reply to:  	gvilardi@recurrentsoft.com
Priority:       	normal

[ Double-click this line for list subscription options ] 

Hi. I've got an odd problem that I'm hoping that someone can help to diagnose.

 A new application that we're building is losing attributes of a session 
between SOME of its pages. This behavior occurs about 85% of the time. 
Sometimes all of our session will transmit and most times about half of the
objects get through. The objects that always come through are strings and some
numbers. The bits that occasionally get through are our database connector
object, our menu bar class and a couple of other ints. The kicker is that the
entire session is created by a java object called from a jsp (login) and it
ALWAYS propagates to the next page correctly. The transition between the second
and third page, whether it is a redrect or a link causes, the problem. We've
reduced the page that this occurs on to something that just enumerates the
session and has a link to itself. I'm including the page source at the end of
the message.

We're running Tomcat 5.0.28 through Apache (Apache/2.0.52 (Unix) mod_ssl/2.0.52
OpenSSL/0.9.6m mod_jk/1.2.6 Server at devlinux.recurrentsoft.com Port 443) on
Debian unstable patched two days ago.

The other thing that has me chasing my tail is that we have a much more complex
system using the same core library with massive sessions and similar objects
that work fine on the same system. For those of you who are still reading,
(thank you!) the sequence of events is that we start by keying the URI for
login.jsp into the browser. We then login to the database, and a session is
created and populated. When we finish logging in, the system sends a redirect
that brings us to bbs.jsp (below).  When we arrive the session has all
attributes we expect. Clicking on the middle link at the bottom of the page
causes the problem.

Any insight that you may be able to offer would _really_ be appreciated. My
brain is currently trying to claw its way out of my skull to escape impending
madness.

 -Greg

----------------- begin bbs.jsp
<%@ page buffer="50kb"
         language="java" 

import="com.recurrentsoft.util.*,com.recurrentsoft.biz.*,com.recurrents
oft.hbiz.*,com.recurrentsoft.hutil.*,java.util.*,java.io.*" %>
<html>
<body>
<%
Enumeration en = session.getAttributeNames();
while (en.hasMoreElements()) {
    String sName = (String)en.nextElement();
%>
    <%=sName%> = <%=session.getAttribute(sName)%><br>
<%
}
session.setAttribute("BeenInBBS","yes");
    //session.removeAttribute("UserID");
    //session.removeAttribute("Pass");
    //session.removeAttribute("SecurityLevel");
    session.removeAttribute("Intl");
    //session.removeAttribute("Properties");
    session.removeAttribute("BizObj");
    session.removeAttribute("MenuBar");
%>
<a href="bbsmaint.jsp">bbsmaint.jsp</a>
<a href="bbs.jsp">bbs.jsp</a>
<a href="tempsysadm.jsp">tempsysadm.jsp</a>
</body>
</html>
------------------- end bbs.jsp-- 
Gregory H. Vilardi    631-752-2701x240     gvilardi@recurrentsoft.com
Project Manager / Lead Software Engineer           Fax: (631)752-3397
Recurrent Software Solutions, Inc.       http://www.recurrentsoft.com
1 Huntington Quadrangle, Suite 1C02, Melville, NY 11747 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

------- End of forwarded message --------- 
Gregory H. Vilardi    631-752-2701x240     gvilardi@recurrentsoft.com
Project Manager / Lead Software Engineer           Fax: (631)752-3397
Recurrent Software Solutions, Inc.       http://www.recurrentsoft.com
1 Huntington Quadrangle, Suite 1C02, Melville, NY 11747 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org