Type parameter of Int? is treated as java.lang.Integer for generics and int for function parameters

In your definition you’re using Int as the ID type rather than Int?; this ends up with java.lang.Interger for the generics and primitive int for the function arguments; this means the two don’t match and Spring can’t find the methods.

i.e. it looks for a findById method accepting a type that matches the ID type (java.lang.Integer) but can only find findById(int id).