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());
目录
相关文章
|
4月前
|
IDE Java 编译器
Java The method compareTo(Integer) in the type解决方法
Java编程过程中,Integer对象(或其它继承自Number类的包装类对象)使用Number包装类内置的compareTo()方法来比较调用对象和参数之间的大小的时候,Java的集成开发环境IDE或编译器给出了提示:The method compareTo(Integer) in the type Integer is not applicable for the arguments (Float)
47 5
|
4月前
|
设计模式 Java 容器
【设计模式】JAVA Design Patterns——Async Method Invocation(异步方法调用模式)
【设计模式】JAVA Design Patterns——Async Method Invocation(异步方法调用模式)
|
1月前
java.lang.IllegalStateException: Could not find method onClickcrea(View) in a parent or ancestor Con
java.lang.IllegalStateException: Could not find method onClickcrea(View) in a parent or ancestor Con
29 1
|
2月前
|
存储 Java 编译器
Java面试题:描述方法区(Method Area)的作用以及它在JVM中的演变(从永久代到元空间)
Java面试题:描述方法区(Method Area)的作用以及它在JVM中的演变(从永久代到元空间)
38 3
|
3月前
|
Java 测试技术
Java反射之Method的invoke方法详解
Java反射之Method的invoke方法详解
|
4月前
|
Java Spring
java.lang.Exception: Method a() should be public
java.lang.Exception: Method a() should be public
51 0
|
4月前
Caused by: java.lang.IllegalStateException: Ambiguous mapping. Cannot map ‘quanZiController‘ method
Caused by: java.lang.IllegalStateException: Ambiguous mapping. Cannot map ‘quanZiController‘ method
38 0
|
4月前
java.lang.IllegalArgumentException: Invalid character found in method name
java.lang.IllegalArgumentException: Invalid character found in method name
132 0
|
4月前
|
Java Maven Spring
SpringBoot运行出现 Lookup method resolution failed; nested exception is java.lang.IllegalStateException
SpringBoot运行出现 Lookup method resolution failed; nested exception is java.lang.IllegalStateException
1007 0
|
4月前
|
JSON Java 数据格式
【Java报错】记录一次 sun.misc.Unsafe.park(Native Method) Conflicting setter definitions for property 导致的内存泄露
【Java报错】记录一次 sun.misc.Unsafe.park(Native Method) Conflicting setter definitions for property 导致的内存泄露
308 0