Skip to content

RedisTemplate's default serializer assumes that its ClassLoader can load application types [DATAREDIS-501] #1031

Closed
@spring-projects-issues

Description

@spring-projects-issues

Andy Wilkinson opened DATAREDIS-501 and commented

By default, RedisTemplate uses a JdkSerializationRedisSerializer that will use the default class loader (typically the app class loader) for deserialization. This assumes that the class loader that loaded RedisTemplate will also be able to load an application's own classes. This doesn't hold true when using Spring Boot's DevTools or in a container where Spring Data Redis is installed as a shared library.

DATAREDIS-427 made it easier to configure the class loader used by JdkSerializationRedisSerializer. Could RedisTemplate be updated to take advantage of this and configure its default JdkSerializationRedisSerializer to use the application context's ClassLoader?


Affects: 1.7.1 (Hopper SR1)

Reference URL: spring-projects/spring-boot#5760

Referenced from: pull request #192, and commits 0f8969f, 79b4028, f5ecd3a, 97da377, a3bd816

Backported to: 1.7.2 (Hopper SR2)

Metadata

Metadata

Labels

in: coreIssues in core supporttype: bugA general bug

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions