• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Tomcat 7 maintaining more than one session

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have recently installed Tomcat 7.0.8 replacing Tomcat 6. With Tomcat 6 my application was working fine.
Now with Tomcat 7 I am not able to login in my application. When i debug the code i found that there are two sessions maintained.
To confirm it, I printed the session id on the login page of my web application from jsp page using Session ID =<%=request.getSession().getId()%>and when I press login button and debug the code I found some attributes are set to different session and then retrived from the other session(printed on login page).

if I replace the tomcat 7 by six again everything works fine. Can some one tell me what could be the reason behind it.


Thanks.
 
Ranch Hand
Posts: 433
Netbeans IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tomcat 7 has a new feature for "versioning webapps". Have you just redeployed your application (without server restart?)
I guess that could be the cause. For further information read this mailing-list entry: http://old.nabble.com/Tomcat-web-app-versioning-td30693003.html
 
arpit kumar
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, I'll read it and get back to you with the results.
 
arpit kumar
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I read that document but could'nt reach to any finite point. How do we provide versioning to our webapps? Where we define the version for the web app?

Thanks.
 
Joachim Rohde
Ranch Hand
Posts: 433
Netbeans IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

http://old.nabble.com/Tomcat-web-app-versioning-td30693003.html wrote:It isn't documented since it is not intended for users to set it directly.


As far as I understood it works like this: You are having a running application with open sessions and you are deploying a new version. Tomcat realizes that there are open sessions and keep both versions (the old and the new one), waits till all sessions in the old version are closed and switches then completly to the new version. I haven't had a closer look yet to this new feature, but that's how I understood it. That's why I was asking, if this error occurs only, if you re-deploy your application without a restart.
 
arpit kumar
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Before running my application I redployed and also restatred the server.

One more thing, when I am setting some attributes in session , I get session from HttpServletRequest (using execute method of struts framework) and when I retrive the same attribute I get the session from page context using pageContext.getRequest().
So, is there any difference in the two ways of getting session, with tomcat 6 same code was working fine.


Thanks.
 
arpit kumar
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Problem solved to some extent . i added "useHttpOnly=false" in context.xml of Tomcat installation pack's conf directory and now I am able to login to my app with only single session. Still having some issues to run web app succesfully, need some more luck.


Thanks.
 
reply
    Bookmark Topic Watch Topic
  • New Topic