Getting “No message available” error with Spring Boot + REST application

后端 未结 10 2409
感动是毒
感动是毒 2020-12-30 02:02

I have created demo Spring Boot project and implemented Restful services as shown here

@RestController
public class GreetingsController {
    @RequestMappin         


        
10条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-30 02:18

    In my case I called the wrong path via ribbon.

    @FeignClient(name = "currency-exchange")
    @RibbonClient(name = "currency-exchange")
    public interface CurrencyExchangeProxy {
    
        @GetMapping("/exchange/{from}/to/{to}")
        PairRateDto callForExchangeValue(@PathVariable("from") String fromValue, @PathVariable("to") String toValue);
    
    }
    

    Remote currency-exchange service didn't have handlers for /exchange/{from}/to/{to} path.

    So for nonexistent URL I've got 404 which is fair with "No message available" which is strange.

提交回复
热议问题