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

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

Comments

@spring-projects-issues
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);
converter.setApplicationContext(context);

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
Labels
in: mapping type: bug
Projects
None yet
Development

No branches or pull requests

2 participants