Failed to Convert Value of Type 'Java.Lang.String' to Required Type 'Java.Lang.Integer' in JPA Spring

Failed to convert from type [java.lang.String] to type [java.lang.Long] for Spring JPA?

The solution is shown below.

I wrongly use this url http://localhost:8080/api/states/findByCountryCode?code=BR

Convert url

http://localhost:8080/api/states/findByCountryCode?code=BR`

to

http://localhost:8080/api/states?code=BR

Spring Boot Get Request: Failed to convert type java.lang.String to required type int

The problem was that autogenerated methods automatically get /search prefix.

Answer: http://localhost:8081/posts/search/byAuthorId?page=1&size=1&authorId=1



Related Topics



Leave a reply



Submit