question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IllegalStateException: Method has too many Body parameters

See original GitHub issue

Request 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:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

9reactions
kdavisk6commented, Sep 24, 2018

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.

0reactions
jefferson-limacommented, Dec 23, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found