java.lang.IllegalStateException: Method has too many Body parameters

简介: java.lang.IllegalStateException: Method has too many Body parameters

feign调用异常:Method has too many Body parameters

解决方法:所有参数必须加上注解

Java

复制代码

1

@RequestMapping(value="/spCommodity/commodityPage", method=RequestMethod.POST)

2

RgoodsList(Pagepage, @RequestBodyCommodityListQOcommodityListQO);// 会报错


get请求:参数要加上注解@RequestParam

post请求:只能有一个@RequestBody,Page属于一个对象,可删除,其余的参数需要加上@RequestParam

feign调用的接口处可修改:

@PostMapping("/commodityPage")
publicRgoodsList(@RequestBodyCommodityListQOcommodityListQO){
Page<SpServiceCommodity>page=newPage<>();
// 页数page.setCurrent(commodityListQO.getCurrent());
// 每页显示条数page.setSize(commodityListQO.getSize());
目录
相关文章
|
9天前
|
Java Spring
java.lang.Exception: Method a() should be public
java.lang.Exception: Method a() should be public
5 0
|
23天前
Caused by: java.lang.IllegalStateException: Ambiguous mapping. Cannot map ‘quanZiController‘ method
Caused by: java.lang.IllegalStateException: Ambiguous mapping. Cannot map ‘quanZiController‘ method
14 0
|
26天前
java.lang.IllegalArgumentException: Invalid character found in method name
java.lang.IllegalArgumentException: Invalid character found in method name
18 0
|
6月前
|
Java Docker 微服务
【Java异常】Caused by: java.lang.IllegalArgumentException: method GET must not have a request body
【Java异常】Caused by: java.lang.IllegalArgumentException: method GET must not have a request body
58 1
|
6月前
SpringCloud Feign报错:java.lang.IllegalStateException: Method has too many Body parameters
SpringCloud Feign报错:java.lang.IllegalStateException: Method has too many Body parameters
67 0
|
6月前
java.lang.IllegalArgumentException: Invalid character found in method name. HTTP method names must b
java.lang.IllegalArgumentException: Invalid character found in method name. HTTP method names must b
81 0
|
6月前
|
Java Spring
【Java异常】Caused by: java.lang.IllegalStateException: Method has too many Body parameters
【Java异常】Caused by: java.lang.IllegalStateException: Method has too many Body parameters
14 0
|
6月前
|
Java
【Java异常】java.lang.IllegalStateException: Ambiguous mapping. Cannot map ‘xxx‘ method
【Java异常】java.lang.IllegalStateException: Ambiguous mapping. Cannot map ‘xxx‘ method
57 0
|
11月前
|
Java Spring
java异常之-Caused by: java.lang.IllegalStateException: Method has too many Body parameters
java异常之-Caused by: java.lang.IllegalStateException: Method has too many Body parameters
256 0
|
Java 应用服务中间件 Maven
nested exception is java.lang.IncompatibleClassChangeError: Implementing class(已解决)
nested exception is java.lang.IncompatibleClassChangeError: Implementing class(已解决)
281 0
nested exception is java.lang.IncompatibleClassChangeError: Implementing class(已解决)