IllegalStateException: Method has too many Body parameters
See original GitHub issueRequest method:
@RequestMapping(method = RequestMethod.POST, value = "/backend/tokenCheck")
@Headers({HeaderConstants.REQUEST_ID + " {requestId}"})
AuthResponseDto checkToken(AuthRequestDto authRequestDto, @Param("requestId") String requestId);
Can you please tell me how to use request body and dynamic headers at the same time?
Thanks a lot.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
SpringBoot FeignClient Method has too many paramters
If you have multiple arguments with one request body and more params. Specify the argument types using exact annotations:
Read more >[Solved]-Spring Boot OpenFeign: java.lang.IllegalStateException
Coding example for the question Spring Boot OpenFeign: java.lang.IllegalStateException: Method has too many Body parameters-Springboot.
Read more >OpenFeign/feign - Gitter
IllegalStateException : Method has too many Body parameters: public abstract rx.Observable com.picpay.api.consumer.client.ConsumerClient.
Read more >Feign整合报错:java.lang.IllegalStateException: Method has ...
IllegalStateException : Method has too many Body parameters: public abstract com.mayikt.core.base.BaseResponse com.mayikt.goods.service.PayContextService.
Read more >Developers - Running @FeignClient with application/x-www ...
Running @FeignClient with application/x-www-form-urlencoded throws IllegalStateException: Method has too many Body parameters.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
A few things here you may want to double check.
First, you are mixing Feign and Spring annotations. I suggest
@Param
for@RequestParam
, this is the most likely cause for that exception.Next, annotation values must be literals. Your use of a constant in the
@Headers
will not work. The value will not be resolved and will result in the header not being constructed appropriately. An alternative way to accomplish this is to use the@RequestHeader
annotation. Give those a try.I had this issue because I was mixing Feign annotations with Spring annotations. In the particular case, I was using
@HeadersMap
, which I replaced with@RequestHeader
to make it work.