用Feign调用远程服务时,出现以下异常:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name '**Controller': Unsatisfied dependency expressed through field '**Feign'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.****': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: Method search not annotated with HTTP method type (ex. GET, POST)

Caused by: java.lang.IllegalStateException: Method search not annotated with HTTP method type (ex. GET, POST)

仔细检查后发现,是在feign接口中对应的方法中忘记添加对应的HTTP注解。

微服务采用Feign调用远程服务报错:Caused by: java.lang.IllegalStateException: Method search not annotated with HTTP

加上以后便能正常启动。

相关文章:

  • 2021-09-22
  • 2022-02-03
  • 2022-12-23
  • 2017-12-10
  • 2021-09-08
  • 2021-12-05
  • 2021-06-02
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-21
  • 2021-12-01
  • 2021-04-02
相关资源
相似解决方案