2
votes

After updating Spring Boot 2.3.0.RELEASE to 2.3.1.RELEASE, domian class conversion stopped working inside controller methods.

Here is the reference controller, which was working perfectly fine till Spring Boot 2.3.0.RELEASE

@Controller 
@RequestMapping("/users")
class UserController {

  @RequestMapping("/{id}")
  String showUserForm(@PathVariable("id") User user, Model model) {

    model.addAttribute("user", user);
    return "userForm";
  }
}

in 2.3.1.RELEASE, I get the below error, when i make the following request

GET /users/<userid>

2020-06-17 13:07:12.780 WARN 574637 --- [ XNIO-1 task-3] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.method.annotation.MethodArgumentConversionNotSupportedException: Failed to convert value of type 'java.lang.String' to required type 'com.xxx.User'; nested exception is java.lang.IllegalStateException: Cannot convert value of type 'java.lang.String' to required type 'com.xxx.User': no matching editors or conversion strategy found]

1
Where is Post parameter - muasif80
fixed the logs, sorry for the wrong logs earlier - Munish Chandel
What are you sending the in the string for the value can you put that in the question too? - muasif80
It seems a same issue as this one, caused by a bug of Spring Data Commons: - Translation of URI segments and request parameters into aggregates broken This bug affects Spring Boot version 2.3.1, 2.2.8 and 2.1.15. - DEWA Kazuyuki - 出羽和之

1 Answers

1
votes

you can update to Spring Boot 2.3.2 which was released "yesterday". This should fix your issue.

It contains the update to Spring Data Neumann-SR2. This version is listed a fix version for your related bug ticket.