question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting issues while using Redisson Tomcat session manager to share one redis instance among multiple tomcats

See original GitHub issue

Hi,

I am trying to use one redis instance for multiple tomcats to make session storage centralized for my application. But i am getting below error.

org.redisson.client.RedisTimeoutException: Redis server response timeout (3000 ms) occured for command: (HGET) with params: [redisson:tomcat_session:793608B88C44BAB4E33D83A057A2BD09, PooledUnsafeDirectByteBuf(ridx: 0, widx: 9, cap: 256)] channel: [id: 0x9d152a45, L:/127.0.0.1:60560 - R:127.0.0.1/127.0.0.1:6379]

As far as i understood redisson is not able to get the session created previously and then it goes on to create a new one. Because of this every time i use application on one tomcat to login it creates new session and when i come to other tomcat to use the same application its not able to find the created session and goes on to create a new one.

But i do see all the sessions created in redis and being stored properly. Its just that redisson is not able to read the session.

Below are my config:

redisson.yml

singleServerConfig:
  idleConnectionTimeout: 10000
  pingTimeout: 1000
  connectTimeout: 10000
  timeout: 3000
  retryAttempts: 3
  retryInterval: 1500
  password: null
  subscriptionsPerConnection: 5
  clientName: null
  address: "redis://127.0.0.1:6379"
  subscriptionConnectionMinimumIdleSize: 1
  subscriptionConnectionPoolSize: 50
  connectionMinimumIdleSize: 32
  connectionPoolSize: 64
  database: 0
  dnsMonitoringInterval: 5000
threads: 0
nettyThreads: 0
codec: !<org.redisson.codec.JsonJacksonCodec> {}
transportMode: "NIO"

Context.xml:

<Manager className="org.redisson.tomcat.RedissonSessionManager"
          configPath="${catalina.base}/conf/redisson.yml" readMode="REDIS" updateMode="DEFAULT"/>

I am using redisson 3.7.4

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Yumarcommented, Aug 6, 2020

Te s

Jan 27, 2020 4:35:00 PM org.redisson.tomcat.RedissonSessionManager findSession INFO: Session E580CA0EC6780785207B12987B4DF18C can’t be found [redisson-netty-2-3] ERROR org.redisson.client.handler.CommandDecoder - Unable to decode data. channel: [id: 0x48f008af, L:/10.0.0.76:56574 - R:portalsessionmanagement.lcajar.ng.0001.euw2.cache.amazonaws.com/x.x.x.xxx:xxxx], reply: ReplayingDecoderByteBuf(ridx=404, widx=404), command: (HGET), params: [redisson:tomcat_session:4FEF283AAD7E9F22654781E1BB2CA857, PooledUnsafeDirectByteBuf(ridx: 0, widx: 17, cap: 256)] com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of fullclassname_0 (no Creators, like default construct, exist): cannot deserialize from Object value (no delegate- or property-based Creator) at [Source: (io.netty.buffer.ByteBufInputStream); line: 1, column: 255] (through reference chain: fullclassname_1[“myFieldResponseMessages”]->fullclassname_2[“__GlobalMessages”]->java.util.ArrayList[0])

It says JacksonParser needs an empty constructor in your class to be able to decode it from json

1reaction
Yunixxcommented, Mar 5, 2019

Fix works well for me! Thanks @mrniko!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Redis-Based Tomcat Session Management | Redisson
It empowers you to distribute requests across a cluster of Tomcat servers. This is all done in non-sticky session management backed by Redis....
Read more >
Tomcat non-sticky sessions with redisson - Stack Overflow
Solution: If redisson is not able to find session using current catalina managerBase then search for the session in redis itself and if...
Read more >
Persisting Tomcat Sessions to Redis - SysAid
This is the story of how SysAid achieved high availability and session persistence in our Tomcat clusters.
Read more >
Redis-Based Tomcat Session Management - DZone
It empowers you to distribute requests across a cluster of Tomcat servers. This is all done in non-sticky session management backed by Redis....
Read more >
[Solved]-tomcat deploy war without losing session-Java
Using the Redisson java client, you can configure the RedissonSessionManager, which persists all of Tomcat's session data in Redis.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found