spring-data-commons: Translation of URI segments and request parameters into aggregates broken [DATACMNS-1743]

Craig opened DATACMNS-1743 and commented

I have a controller class (annotated with @RepositoryRestController) with this method:

@ResponseBody
 @RequestMapping(method=RequestMethod.GET,value="/domainWords/search/findByDomainSetWithLocale")
 public CollectionModel<EntityModel<DomainWord>> findByDomainSetAndLocale(final @NonNull @RequestParam("domainSet") DomainSet domainSet, final @NonNull @RequestParam("locale") Locale locale)

DomainSet’s repository is:

@Repository
public interface DomainSetRepository extends org.springframework.data.repository.Repository<DomainSet, Long>

The test is to request

/api/domainWords/search/findByDomainSetWithLocale?domainSet=1&locale=es_ES

With Spring Data Neumann RELEASE, that works great.

With Spring Data Neumann SR1, it fails.

With Spring Data Neumann SR1 forcing spring-data-commons to version 2.3.0.RELEASE, it fails.

Therefore, this issue is a regression in spring-data-commons 2.3.1.RELEASE. So the problem is caused somewhere in this commit range: https://github.com/spring-projects/spring-data-commons/compare/2.3.0.RELEASE...2.3.1.RELEASE

When it fails, here’s the error:

Resolved [org.springframework.web.method.annotation.MethodArgumentConversionNotSupportedException: Failed to convert value of type 'java.lang.String' to required type 'com.isobar.mindsight.domain.DomainSet'; nested exception is java.lang.IllegalStateException: Cannot convert value of type 'java.lang.String' to required type 'com.isobar.mindsight.domain.DomainSet': no matching editors or conversion strategy found]

Affects: 2.2.8 (Moore SR8), 2.3.1 (Neumann SR1)

Issue Links:

  • DATACMNS-1734 Delay Repositories initialization in DomainClassConverter

Backported to: 2.3.2 (Neumann SR2), 2.2.9 (Moore SR9)

2 votes, 9 watchers

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16

Most upvoted comments

yukihane commented

Hi. Here is my testcase.

mvn clean test’ result:

Spring Boot Version Test Result
2.1.14 pass
2.1.15 fail
2.1.16 fail
2.2.7 pass
2.2.8 fail
2.2.9 pass
2.3.0 pass
2.3.1 fail
2.3.2 pass

It seems that this issue also affects version 2.1.x and has not been fixed