Error creating bean with name 'cn.com.taiji.fzy.indidocxToken.feign.IndidocxTokenFeignClient': Unexpected exception during bean creation; nested exception is java.lang.IllegalStateException: Method has too many Body parameters: public abstract org.springframework.http.ResponseEntity cn.com.taiji.fzy.indidocxToken.service.IndidocxTokenClient.refreshToken(java.lang.String,javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) Warnings: - at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:555) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154) at com.xxl.job.core.executor.impl.XxlJobSpringExecutor.initJobHandlerMethodRepository(XxlJobSpringExecutor.java:87) at com.xxl.job.core.executor.impl.XxlJobSpringExecutor.afterSingletonsInstantiated(XxlJobSpringExecutor.java:38) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:972) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:740) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:415) at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1312) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) at cn.com.taiji.fzy.contract.ContractApplication.main(ContractApplication.java:36) Caused by: java.lang.IllegalStateException: Method has too many Body parameters: public abstract org.springframework.http.ResponseEntity cn.com.taiji.fzy.indidocxToken.service.IndidocxTokenClient.refreshToken(java.lang.String,javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) at org.springframework.cloud.openfeign.support.SpringMvcContract.parseAndValidateMetadata(SpringMvcContract.java:216) at org.springframework.cloud.openfeign.support.SpringMvcContract.parseAndValidatateMetadata(SpringMvcContract.java:201) at org.springframework.cloud.openfeign.support.SpringMvcContract.parseAndValidatateMetadata(SpringMvcContract.java:59) at feign.Contract$BaseContract.parseAndValidatateMetadata(Contract.java:111) at feign.reflect.ReflectiveFeign$ParseHandlersByName.targetToRequestHandlers(ReflectiveFeign.java:320) at feign.reflect.ReflectiveFeign.newInstance(ReflectiveFeign.java:61) at org.springframework.cloud.openfeign.FeignClientsRegistrar.getFeignClient(FeignClientsRegistrar.java:141) at org.springframework.cloud.openfeign.FeignClientsRegistrar.getObject(FeignClientsRegistrar.java:89) at org.springframework.cloud.openfeign.FeignClientsRegistrar.getIfAvailable(FeignClientsRegistrar.java:65) at org.springframework.cloud.openfeign.FeignClientsRegistrar.registerBeanDefinitions(FeignClientsRegistrar.java:58) at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.lambda$loadBeanDefinitionsFromRegistrars$1(ConfigurationClassBeanDefinitionReader.java:359) at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:684) at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromRegistrars(ConfigurationClassBeanDefinitionReader.java:358) at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:148) at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:124) at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:331) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:236) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:95) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:706) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:740) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:415) at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1312) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) at cn.com.taiji.fzy.contract.ContractApplication.main(ContractApplication.java:36) 此错误指在Feign接口中有限定了多个参数为@Body,解决办法: 1、将@Body注解去掉,原因是Feign接口不能同时包含多个@Body,只能存在一个@Body 2、移除HttpServletRequest、HttpServletResponse等参数,只使用@RequestParam等来传值就可以了
标签:lang,Body,java,support,SpringApplication,springframework,context,org From: https://www.cnblogs.com/dangwang/p/17008293.html