0

I am using RMap to store RLock. When I am trying to get(key) from this map, it is returning me an instance of RedissonReference instead of RLock. I am not able to cast it to RLock. I am using the below code:

RMap<String,RLock> locks = redissonClient.getMap("locksMap");
RLock existingLock = locks.get(name); 

I'm getting the below exception here:

java.lang.ClassCastException: org.redisson.RedissonReference cannot be cast to org.redisson.api.RLock  
karel
  • 5,489
  • 46
  • 45
  • 50

1 Answers1

0

RLock can't be stored in Map as value, since it doesn't extend RObject interface. Use name with prefix for RLock object instead

Nikita Koksharov
  • 10,283
  • 1
  • 62
  • 71