I just updated from version 2.0.X of Spring Boot to version 2.1.X. I use Spring Redis for in memory storage, and one of the objects that I store in memory has a java.util.concurrent.locks.ReentrantLock
. In version 2.0.X of Spring Boot, the object deserializes successfully. In version 2.1.X, the object fails to deserialize with the exception:
org.springframework.data.keyvalue.core.UncategorizedKeyValueException: Cannot set immutable property java.util.concurrent.locks.ReentrantLock.sync!; nested exception is java.lang.UnsupportedOperationException: Cannot set immutable property java.util.concurrent.locks.ReentrantLock.sync
The problem occurs at org.springframework.data.mapping.model.BeanWrapper:85
.
As this is a serializable object, I should be able to store it in Redis as is. Is this a bug in Spring? Is there a workaround?
Until this is resolved, I cannot update my Spring Boot version, and therefore my Java version. Any help would be appreciated.