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)

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

  • 相关阅读:
    如何修补软件、系统漏洞?
    轻松学习Linux之本地安装系统
    看程序体验缓冲区溢出漏洞
    企业网管软件实战之SolarWinds LANsurveyor
    Android项目开发遇到的问题(64K的错误)的解决之路,从入坑到出坑
    史上最佳 Mac+PhpStorm+XAMPP+Xdebug 集成开发和断点调试环境的配置
    [noip2011]计算系数+二项式定理证明
    [nowcoder5668H]Sort the Strings Revision
    (动态规划)导弹防御
    nyoj 79 拦截导弹
  • 原文地址:https://www.cnblogs.com/mzlb520/p/12119382.html
Copyright © 2011-2022 走看看