zoukankan      html  css  js  c++  java
  • 关于本次【Unsatisfied dependency expressed through field 'iClientFeignEmployeeService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.oppo】

    关于本次springboot项目上线遇到的问题归纳:

    1.本地合适但是线上扫不到包,报错:【Unsatisfied dependency expressed through field 'iClientFeignEmployeeService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.oppo.csc.hrms.client.service.employee.IClientFeignEmployeeService】

      原因:扫不到manager里面的包、导致出现问题

      解决前:

    @SpringBootApplication(scanBasePackages = {"com.oppo.csc.sso", "com.xiniaoyun.external"}, exclude = {NacosConfigEndpointAutoConfiguration.class})    //就是此处扫描包的
    @EnableSpringDataWebSupport
    @EnableScheduling
    @EnableFeignClients({"com.xiniaoyun.external.client","com.xiniaoyun.shared", "com.oppo.csc.sso.api", "com.oppo.csc.hrms","com.xiniaoyun.helios"})
    @MapperScan(value = "com.xiniaoyun.external.dao", annotationClass = Mapper.class)
    @EnableDiscoveryClient
    public class SummerExternalApplication {
        private static ApplicationContext applicationContext;
    
        public static ApplicationContext getApplicationContext() {
            return applicationContext;
        }
    
        public static void main(String[] args) {
            applicationContext = SpringApplication.run(SummerExternalApplication.class, args);
        }
    }

    解决后:

    @SpringBootApplication(scanBasePackages = {"com.oppo.csc.sso", "com.xiniaoyun.external.manager","com.xiniaoyun.external"}, exclude = {NacosConfigEndpointAutoConfiguration.class}) //单独将manager的包扫描一次、后面再扫全局。
    @EnableSpringDataWebSupport
    @EnableScheduling
    @EnableFeignClients({"com.xiniaoyun.external.client","com.xiniaoyun.shared", "com.oppo.csc.sso.api", "com.oppo.csc.hrms","com.xiniaoyun.helios"})
    @MapperScan(value = "com.xiniaoyun.external.dao", annotationClass = Mapper.class)

    这样就能解决掉该问题、主要的原因就是没有扫描到包、导致出现的问题。

  • 相关阅读:
    视频高清直播RTMP视频推流组件EasyRTMP-IOS版如何使用wchar_t*类型参数?
    设计模式
    算法学习【第10篇】:算法之动态规划问题
    算法学习【第9篇】:算法之斐波那契数列
    算法学习【第8篇】:贪心算法找零问题
    算法学习【第7篇】:算法之迷宫问题
    算法学习【第6篇】:算法之数据结构
    算法学习【第5篇】:常用排序算法(*******)
    算法学习【第4篇】:算法之---堆的简单介绍
    算法学习【第3篇】:树和二叉树简介
  • 原文地址:https://www.cnblogs.com/mzlb520/p/12119382.html
Copyright © 2011-2022 走看看