Skip to content

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

Open
@spring-projects-issues

Description

@spring-projects-issues

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

Metadata

Metadata

Assignees

Labels

in: mappingMapping and conversion infrastructuretype: bugA general bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions