Thursday, April 2, 2015

{"cause":null,"message":"No @Param annotation found on query method findByLastName for parameter null"}

When you use Spring Data REST and get the following URL:

http://localhost:18080/api/customers/search/findByLastName?lastName=Bauer

you can encounter the following error:

{"cause":null,"message":"No @Param annotation found on query method findByLastName for parameter null"}

Change the following code:

List<Customer> findByLastName(String lastName);

to the following code:

List<Customer> findByLastName(@Param("lastName") String lastName);

No comments:

Post a Comment