Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Help! No session objects in Tomcat 5.0.18 (JSP)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
lord
n00b
n00b


Joined: 16 Oct 2002
Posts: 73
Location: Linköping, Sweden

PostPosted: Tue May 18, 2004 1:12 pm    Post subject: Help! No session objects in Tomcat 5.0.18 (JSP) Reply with quote

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
View user's profile Send private message
josh
Guru
Guru


Joined: 05 Feb 2003
Posts: 473
Location: Milky Way: Solar System: Earth: North America: USA: NY: Buffalo

PostPosted: Thu Mar 30, 2006 7:07 pm    Post subject: Reply with quote

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
View user's profile Send private message
stask
n00b
n00b


Joined: 03 May 2005
Posts: 26
Location: Israel

PostPosted: Sat Apr 01, 2006 5:51 am    Post subject: Reply with quote

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
View user's profile Send private message
josh
Guru
Guru


Joined: 05 Feb 2003
Posts: 473
Location: Milky Way: Solar System: Earth: North America: USA: NY: Buffalo

PostPosted: Sat Apr 01, 2006 2:31 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum