Spring FeignClient 遇到的参数问题(RequestParam.value() was empty on parameter 0)
2018-01-24 16:43
591 查看
先看下源码
@PostMapping(value = "url") public Envelop create(@RequestParam String jsonData);下面是启动报错日志Caused by: java.lang.IllegalStateException: RequestParam.value() was empty on parameter 0看提示很明显是参数问题,RequestParam注解的第一个参数是不能为空简单粗暴的把RequestParam注解去掉,启动成功。再试试加上注解的描述修改成:
@PostMapping(value = "url")
public Envelop create(@RequestParam(value = "jsonData", required = true) String jsonData);
这样启动成功,ok解决了。
回顾下照常这个错误的原因,刚开始写接口时参数的注解是RequestBody,RequestBody不需要注解的描述。
后来入参方式改成RequestParam,就导致这个错误了。
其他错误请参考:spring cloud-Feign使用中遇到的问题总结
相关文章推荐
- RequestParam.value() was empty on parameter 0
- spring cloud feign 调用微服务转发不了request请求头和参数问题解决方案
- 搭建ssm框架遇到的问题:The request sent by the client was syntactically incorrect
- A potentially dangerous Request.Form value was detected from the client问题处理
- MVC 请求参数中带有HTML会引发Validation异常 ("A potentially dangerous Request.Form value was detected from the client")
- SPRING IN ACTION 第4版笔记-第五章BUILDING SPRING WEB APPLICATIONS-004-以query parameters的形式给action传参数(@RequestParam、defaultValue)
- SpringMVC @RequestParam参数乱码的问题
- Attribute value request.getParameter("param") 问题
- HTTP Status 403 - Invalid CSRF Token 'null' was found on the request parameter '_csrf' or header
- A potentially dangerous Request.Form value was detected from the client
- Parameter 'source' not found. Available parameters are [0, 1, param1, param2],json输出接口遇到的问题
- A potentially dangerous Request.Form value was detected from the client
- spring 配置文件中datasource 从properties文件中获取mysql数据库连接参数遇到的问题
- A potentially dangerous Request.Form value was detected from the client
- spring cloud 的启动Eureka client报错--Cannot execute request on any known server
- 异常处理Spring MVC "The request sent by the client was syntactically incorrect ()"
- A potentially dangerous Request.Path value was detected from the client 异常
- The request sent by the client was syntactically incorrect ().问题排查
- A potentially dangerous Request.Path value was detected from the client 异常
- 遇到动态调用Parameters .AddWithValue()参数类型问题的解决方法