Feign 采坑之 Expected authority at index 7: http://

背景

在写feignclient时,由于一个不注意的小细节的错误致使抛出一个奇葩异常而找了半天,本次记录下来,避免下次再犯!java

问题描述

在编写feign客户端接口时,因为将@RequestMapping(value="/test")写成了@RequestMapping(name="/test")而致使feign在调用时没有带上@RequestMapping的URI,所以feign在底层调用API时,会致使抛出以下异常,表示缺乏URI信息git

java.net.URISyntaxException: Expected authority at index 7: http:// feign

解决

@RequestMapping注解使用value来声明URI而且URI不能为空github

参考

https://github.com/spring-cloud/spring-cloud-openfeign/issues/9spring

相关文章
相关标签/搜索