Ben Souther wrote:
On Thursday 20 May 2004 10:15 am, Shapira, Yoav wrote:
in starting jsp 1 session.setAttribute("ml",ml);
in target jsp 2 MyPackage.MyClass ml = (MyPackage.MyClass)session.getAttribute("ml"); System.out.println("ml = "+ml);
then in the log I see...
ml = null
You didn't include it in your code snippet so I have to ask: are you sure that the "ml" object wasn't null before you called setAttribute?
Also, are you testing this with the same browser that you were using with the 4x version of Tomcat (that was working)?
I'm asking because this looks like a case of MSIE not storing session cookies properly. (IOW: every hit to the server is generating it's own session).
Yup the original is non-null. What I did to confirm this is that after the setAttribute I did a getAttribute into another reference and did a System.out on that to be sure that it actually got put in the session.
Today I created a new project in WDSC 5.1.2 (the latest) imported all the files and cleaned up every last validation error. It works just fine in the WAS 5.0 and 5.1 test environments (only J2EE 1.3 though).
Deploying to my test Tomcat 5 on Win2K shows the same problem as before.
I'm using the same browser and machine as was working with Tomcat 4. I did wonder if cookies were being dropped (I have to run this Integrity Client thing on Win2K that does block some stuff) so I've even tried running with Mozilla from Linux and the symptoms are identical. So it still seems to be something related to this specific webapp code but it hasn't dawned on me what yet. Tomorrow I plan on writing a simple pair of jsps, one to display the session id and all the session data and the other that will display the session id, put an element in the session and submit to the first one. That will more or less simulate the function of the real app that seems to be failing. Once I figure this one out I'm sure it will be a "duh" kinda feeling...
I didn't see the earlier posts, but are you using Tomcat-5.0.24? There's a bug related to session cookies which requires a hotfix. However, I'd just install 5.0.25 which has the fix, plus a few others. Also note that Tomcat-5.0.24+ is very strict about objects in the session being serializable (where 5.0.19 was less so). Upon application shutdown, non-serializable attributes will be removed so that upon restart, the non-serializable attributes won't exist in the session. Not sure if that is your problem here, but it's a good thing to note.
http://archive.apache.org/dist/jakarta/tomcat-5/v5.0.25-alpha/
Jake
Mike
--------------------------------------------------------------------- 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]