Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DomainClassConverter not registered by SpringDataWebConfiguration [DATACMNS-1759] #2175

spring-projects-issues opened this issue Jun 30, 2020 · 0 comments
in: mapping type: bug


Copy link

spring-projects-issues commented Jun 30, 2020

Martin Hjalmarsson opened DATACMNS-1759 and commented

Version 2.3.1 of DomainClassConverter introduced lazy initialization of Repositories in setApplicationContext(context):

this.repositories = Lazy.of(() -> {
	Repositories repositories = new Repositories(context);
	return repositories;

The problem with this is that SpringDataWebConfiguration (@EnableSpringDataWebSupport) creates an instance of DomainClassConverter but then never registers it anywhere so the instance is discarded(?).

DomainClassConverter<FormattingConversionService> converter = new DomainClassConverter<>(conversionService);

Before the change was introduced the DomainClassConverter would register Id- and Type-converters immediately in the setApplicationContext method.

Either SpringDataWebConfiguration needs to register the DomainClassConverter in the ConversionService, i.e. conversionService.registerConverter(converter);
Or DomainClassConverter should do that it self in the setApplicationContext method

Affects: 2.3.1 (Neumann SR1)

3 votes, 3 watchers

@spring-projects-issues spring-projects-issues added type: bug in: mapping labels Dec 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
in: mapping type: bug
None yet

No branches or pull requests

2 participants