feign.FeignException$InternalServerError: [500] during [GET]

报错信息:
feign.FeignException$InternalServerError: [500] during [GET] to [http://USERS/users/2] [UserOpenfig#queryByUserId(Integer)]: [{"timestamp":"2023-11-09T11:39:16.890+00:00","status":500,"error":"Internal Server Error","path":"/users/2"}]
    at feign.FeignException.serverErrorStatus(FeignException.java:250) ~[feign-core-11.10.jar:na]
    at feign.FeignException.errorStatus(FeignException.java:197) ~[feign-core-11.10.jar:na]
    at feign.FeignException.errorStatus(FeignException.java:185) ~[feign-core-11.10.jar:na]
    at feign.codec.ErrorDecoder$Default.decode(ErrorDecoder.java:92) ~[feign-core-11.10.jar:na]
    at feign.AsyncResponseHandler.handleResponse(AsyncResponseHandler.java:98) ~
 

openfeign请求代码:

@FeignClient("USERS")
public interface UserOpenfig {

    @GetMapping("/users/{id}")
    public UserDto queryByUserId(@PathVariable("id") Integer id,String token);

}
@FeignClient("USERS")
public interface UserOpenfig {

    @GetMapping("/users/{id}")
    public UserDto queryByUserId(@PathVariable("id") Integer id);

}

接收代码

 

问题描述:

在使用openfeign传多个参数时,不加@RequestParam或者少写参数就会出现此类错误!

解决:

多参时参数加@RequestParam