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)

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

  • 相关阅读:
    ActionScript 条件编译
    FLASH通讯小结
    关于ob_start()
    剖析PHP中的输出缓冲
    Ext.app.controller的refs
    php多线程解决之stream_socket_client
    谷歌的JQuery库
    PHP计划任务之关闭浏览器后仍然继续执行的函数
    关于php调用可执行程序,在后台运行而不让页面等待
    把预定义的字符串转化为html标签
  • 原文地址:https://www.cnblogs.com/mzlb520/p/12119382.html
Copyright © 2011-2022 走看看