Error Injecting FeignClient from another Project

后端 未结 3 954
刺人心
刺人心 2020-12-25 11:16

I am having trouble auto wiring a feign client from another project. It appears that the implementation of the feign client is not being generated and injected.

This

相关标签:
3条回答
  • 2020-12-25 11:53

    Direct Class/Interface name can be given like below

    @EnableFeignClients(basePackageClasses=com.abc.xxx.client.XXFeignClient.class)
    

    This parameter accept single or multiple class name

    0 讨论(0)
  • 2020-12-25 11:56

    You need to tell the Feign scanner where to locate the interfaces.

    You can use @EnableFeignClients(basePackages = {"my.external.feign.client.package", "my.local.package"}).

    0 讨论(0)
  • 2020-12-25 12:03

    My main class was in package "com.abc.myservicename" and my main class name was "myservicename.java". I was using @SpringBootApplication(scanBasePackages="com.abc") annotation in my main class.

    Changing the main class package name to "com.abc" has resolved the issue for me.

    0 讨论(0)
提交回复
热议问题