[Logo] Terracotta Discussion Forums (LEGACY READ-ONLY ARCHIVE)
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
Tomcat 6.0.29 error redirects replace tc jsessionid with tomcat jsessionid  XML
Forum Index -> Terracotta for Web Sessions
Author Message
robo

neo

Joined: 10/27/2011 14:04:45
Messages: 2
Offline

I am new to terracotta. We just installed 3.5.2 Web Sessions to cluster sessions under Tomcat 6.0.29. We have a Grails 3.6 app running on CentOS 5.4.

Everything is working great except when we get an error response. Whenever we get an error response such as 404 Not Found the user gets kicked back out to the login screen.

After investigation we noticed that when these errors happen the request header has the terracotta jsessionid such as JSESSIONID=9l7zYXF9UCkDesL7VttH.20 but the response header has the Tomcat style jsessionid such as JSESSIONID=7A69191B82AF7139662D2E2CA419A750.

We are using Shiro 1.1.3 for authentication if that helps.

Any help would be greatly appreciated.

robo
robo

neo

Joined: 10/27/2011 14:04:45
Messages: 2
Offline

We found a solution to this problem though we still don't understand it. We were putting the terracotta valve in the tomcat server's conf/context.xml. I then tried all scenarios where we:

a) put the valve in our .war in /META-INF/context.xml. That didnt' work.
b) put the valve in the $CATALINA_HOME/conf/[enginename]/[hostname]/context.xml.default. That didn't work.
c) put the valve in the $CATALINA_HOME/conf/[enginename]/[hostname]/<contextname>.xml. That didn't work.
d) put the valve in the Host section of the conf/server.xml. THAT WORKED!!

I suspect that by putting the valve in the server.xml it was loading before any standard tomcat session manager which fixed this issue.

robo
gyan10

ophanim

Joined: 06/28/2011 23:15:25
Messages: 701
Offline

Thanks for posting the answer robo.
Good to hear that issue is resolved.

Cheers!!!

Gyan Awasthi
Terracotta -A Software AG company
wuwenyao

neo

Joined: 09/03/2013 19:08:12
Messages: 1
Offline

THX,the problem bother me a few weeks,your solution help me.I use Terracotta 3.7.6 with tomcat 6.3.7
ygou

neo

Joined: 08/01/2014 02:38:45
Messages: 1
Offline

Hi Robo,

Thank you so much too! It solved my problem too。

I am using Terracotta 3.7.7 for my Tomcat 7 session clustering, and also using Spring Security Oauth2 version 1.0.5.RELEASE.

Every time when my application server redirected my browser to the OAuth2 authorization server for the authorization code, the jsessionid cookie in my browser was set to Tomcat style jsessionid. So when the authorization server redirected my browser to my application server, my application server regarded the Tomcat session as anonymous, as my application server only authenticated my old Terracotta session before.

The TerracottaTomcat70xSessionValve valve used to be put under conf/Catalina/localhost/myApp.xml.

Now as you suggested, I moved the valve to conf/server.xml, and there is no more Tomcat style session. Everything works.

Thank you again.
 
Forum Index -> Terracotta for Web Sessions
Go to:   
Powered by JForum 2.1.7 © JForum Team