spring-projects / spring-data-redis

Provides support to increase developer productivity in Java when using Redis, a key-value store. Uses familiar Spring concepts such as a template classes for core API usage and lightweight repository style data access.
https://spring.io/projects/spring-data-redis/
Apache License 2.0
1.77k stars 1.17k forks source link

SerializationException when using RedisTemplate #2857

Closed Welkin1027 closed 8 months ago

Welkin1027 commented 8 months ago

When I used RedisTemplate to set & get data, the program throwed org.springframework.data.redis.serializer.SerializationException, the exception message was "Could not resolve type id 'xxx.entity.DeptNode' as a subtype of xxx.entity.DeptNode", the two paths are absolutely the same. I found that the RedisTemplate used different types of classloader, so, the class DeptNode was recgonized as different class. By removing spring-boot-devtools in pom.xml, the problem could be solved, but I was not permitted to remove this package, what could I do to resolve this problem?

mp911de commented 8 months ago

If you would like us to spend some time helping you to diagnose the problem, please spend some time describing it and, ideally, providing a minimal yet complete sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or by zipping it up and attaching it to this issue.