View previous topic :: View next topic |
Author |
Message |
lord n00b
Joined: 16 Oct 2002 Posts: 73 Location: Linköping, Sweden
|
Posted: Tue May 18, 2004 1:12 pm Post subject: Help! No session objects in Tomcat 5.0.18 (JSP) |
|
|
I upgraded tomcat from 4.1.x to 5.0.18 and every single JSP file that accesses the session object stopped working. I cannot figure out what's wrong with it.
I've tried to google and search this forum w/o any luck
Click here to read Tomcat's error msg
I'm using: Tomcat 5.0.18 + Apache2 2.0.49-r1 + mod_jk2
Please help, this is really bad and it's been going on since my upgrade and I cant find a way to fix it! |
|
Back to top |
|
|
josh Guru
Joined: 05 Feb 2003 Posts: 473 Location: Milky Way: Solar System: Earth: North America: USA: NY: Buffalo
|
Posted: Thu Mar 30, 2006 7:07 pm Post subject: |
|
|
I want to know this one too. I actually copied a working tomcat/apache installation over to my gentoo box and turned off all portage-insalled apache/tomcat and I get the same error:
Code: | /opt/tomcat5/work/Catalina/localhost/_/org/apache/jsp/cats/login_jsp.java:94:
setAttribute(java.lang.String,java.lang.Object) in javax.servlet.http.HttpSession cannot be applied to (java.lang.String,int)
session.setAttribute("user_id",user_id); |
Has anyone else had this problem. _________________ -Josh |
|
Back to top |
|
|
stask n00b
Joined: 03 May 2005 Posts: 26 Location: Israel
|
Posted: Sat Apr 01, 2006 5:51 am Post subject: |
|
|
Try to change the Code: | session.setAttribute("user_id", user_id); | line to Code: | session.setAttribute("user_id", new Integer(user_id)); | in your login.jsp file. Most probably, whoever wrote this code, he expected to run it under JVM 1.5, which has "autoboxing" feature. Or maybe just did a mistake. _________________ StasK |
|
Back to top |
|
|
josh Guru
Joined: 05 Feb 2003 Posts: 473 Location: Milky Way: Solar System: Earth: North America: USA: NY: Buffalo
|
Posted: Sat Apr 01, 2006 2:31 pm Post subject: |
|
|
Dude, that was the ticket! thanks. I am far from a Java expert. But when the boss comes around and says "we are re-writing our mod_perl site in jsp for no particular reason" I may not be happy about it, but I'm still getting paid. I originally wrote the code on a FC4 box which had Java/jdk/jvm/whatever 1.5 installed. Just changing that for the Integer made everything OK. The Strings are fine as they were though. Thanks again! _________________ -Josh |
|
Back to top |
|
|
|