引入feign注入报错 org.springframework.beans.factory.NoSuchBeanDefinitionException解决

[172.16.22.215] out: Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException:
No qualifying bean of type 'com.test.mydock.api.FeignRemoteTestService' available: expected at least 1 bean which qualifies as autowire candidate.
Dependency annotations: {@javax.annotation.Resource(shareable=true, lookup=, name=, description=, authenticationType=CONTAINER, type=class java.lang.Object, mappedName=)}
//需要加入注册扫描   加入 com.test.mydock 扫描路径
@SpringBootApplication(scanBasePackages = {"com.order.photo","com.order","com.test.mydock"})
@MapperScan({"com.order"})
public class PhotoServerSpringBoot extends SpringBootServletInitializer { //同时还需要加上这个
@EnableFeignClients({"com.order"})
@EnableEurekaClient //最终的注解
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.feign.EnableFeignClients; @EnableFeignClients({"com.order"})
@EnableEurekaClient
@SpringBootApplication(scanBasePackages = {"com.order.photo","com.order","com.test.mydock"})
@MapperScan({"com.order"})
public class PhotoServerSpringBoot extends SpringBootServletInitializer { public static void main(String[] args) {
SpringApplication.run(PhotoServerSpringBoot.class, args);
} @Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(PhotoServerSpringBoot.class);
}
}

引入feign注入报错 org.springframework.beans.factory.NoSuchBeanDefinitionException解决的更多相关文章

  1. springboot 报错 org.springframework.beans.factory.NoSuchBeanDefinitionException:No qualifying bean of type 'com.example.service.HrService' available: 有没有大佬出个主意,我找了一天,刚入门springboot

    话不多说先上图,这是启动类的配置,这里配置了@ComponentScan("我的mapper的接口") 接下来是我的项目结构截图 然后是service 的截图,我在这里加了注解@S ...

  2. Tomcat 启动时项目报错 org.springframework.beans.factory.BeanCreationException

    事情是这样的,最近我们公司需要将开发环境和测试环境分开,所以就需要把所有的项目部署一套新的开发环境. 我们都是通过 Jenkins 进行部署的,先说一下两个环境的配置: 测试环境配置(旧):jdk1. ...

  3. Spring AOP 报错org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'XXXXXX' defined in class path resource..........

    完整报错如下: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'befo ...

  4. SSM整合报错org.springframework.beans.factory.UnsatisfiedDependencyException

    我解决的办法是把.m2仓库所有文件删除,重新maven project就可以了. 但是在做这一步之前,报错如下: ①org.springframework.beans.factory.Unsatisf ...

  5. 【spring boot】使用注解@ConfigurationProperties读取配置文件时候 报错 org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'rocketmqAutoConfiguration': Unsatisfied dependenc

    如题,配置文件如下: #注册中心配置 eureka: instance: instanceId: ${spring.application.name}:${random.int} hostname: ...

  6. 报错org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [bean.xml]

    报这种错的原因基本上是applicationContext.xml文件中bean配置错误,错误如下: org.springframework.beans.factory.BeanCreationExc ...

  7. tomcat启动报错:org.springframework.beans.factory.BeanCreationException

    Web容器在启动时加载 spring 配置文件时解析xml失败常常引起容器启动失败.这次配置文件是 ibatis的sql脚本出了问题: Context initialization failed or ...

  8. java项目报错: org.springframework.beans.factory.BeanCreationException找不到mapper.xml文件

    错误代码 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userSer ...

  9. 报错org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [org.mybatis.spring.SqlSessionFactoryBean]

    超级大坑 org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [org.mybati ...

  10. spring装载配置文件失败报错:org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException

    Tomcat容器启动失败,找到 debug日志一看: Context initialization failed org.springframework. beans.factory.xml.XmlB ...

随机推荐

  1. KubeVela 1.0 :开启可编程式应用平台的未来

    简介: 如果你对云原生领域不太关注,可能对 KubeVela 还没有做过太深入的了解.别着急,本文就借着 v1.0 发布之际,为你详细的梳理一次 KubeVela 项目的发展脉络,解读它的核心思想和愿 ...

  2. DataWorks搬站方案:Airflow作业迁移至DataWorks

    简介: DataWorks提供任务搬站功能,支持将开源调度引擎Oozie.Azkaban.Airflow的任务快速迁移至DataWorks.本文主要介绍如何将开源Airflow工作流调度引擎中的作业迁 ...

  3. [FAQ] Windows 终端 `git diff` 出现 LF 空格 ^M 符号, 处理方式

      可能是终端内的换行配置和 IDE 当中的不一致. 比如 PHPStorm 的: Git 终端使用 git config core.autocrlf 查看是 true 还是 false. 是 tru ...

  4. WPF 如何知道当前有多少个 DispatcherTime 在运行

    在 WPF 调试中,对于 DispatcherTimer 定时器的执行,没有直观的调试方法.本文来告诉大家如何在 WPF 中调试当前主线程有多少个 DispatcherTimer 在运行 在 WPF ...

  5. dotnet 读 WPF 源代码笔记 了解 WPF 已知问题 用户设备上不存在 Arial 字体将导致应用闪退

    本文来告诉大家 WPF 已知问题,在用户的设备上,如果不存在 Arial 字体,同时安装了一些诡异的字体,那么也许就会让应用在使用到诡异的字体的时候,软件闪退 在 WPF 的 FontFamily.c ...

  6. SqlServer使用总结

    -- 新增主键,系统随机取名 ALTER TABLE "T_CS1" ADD PRIMARY KEY CLUSTERED ("ID1", "ID2&q ...

  7. ITIL4中的关键概念

    1.价值和价值共创 什么是价值 通俗表达:这有啥用? 正式表达:这能带来什么益处或起什么作用? 反问式求证: 假如没有的话,会有什么后果? 具体情境提问:如果缺少IT运维人员,业务系统会面临怎样的状况 ...

  8. 前端使用 Konva 实现可视化设计器(9)- 另存为SVG

    请大家动动小手,给我一个免费的 Star 吧~ 大家如果发现了 Bug,欢迎来提 Issue 哟~ github源码 gitee源码 示例地址 另存为SVG 这一章增强了另存为的能力,实现" ...

  9. JS的异步加载

    异步加载 先看一张整体的异步加载对渲染的阻塞情况图,图片如下: 从这张图里我们可以看到如下4点: 默认情况HTML解析,然后加载JS,此时HTML解析中断,然后执行JS,最后JS执行完成恢复HTML解 ...

  10. Ubuntu实现与主机Windows复制粘贴(安装VMware Tools)

    若不能实现主机与客户机间粘贴复制执行以下命令 sudo apt-get autoremove open-vm-tools sudo apt-get install open-vm-tools sudo ...