zoukankan      html  css  js  c++  java
  • springboot项目:扫描不到其他模块的包 Parameter 0 of constructor in com.zjxf.repository.UserRepository

    报错信息如下:
    
    
    
    ***************************
    
    APPLICATION FAILED TO START
    ***************************
    
    
    Description:
    Parameter 0 of constructor in com.zjxf.repository.UserRepository required a bean of type 'java.lang.String' that could not be found.
    
    Action:
    Consider defining a bean of type 'java.lang.String' in your configuration.
    

    疑问:springboot怎么扫描其他模块的bean

    解决:
    找不到哪的包就把路径写一下就行.这里是com.zjxf.repository.UserRepository这个找不到.
    @ComponentScan(basePackages = {"com.zjxf.repository"})

    /**
     * 票查保 运营平台启动类
     *
     * @author WeiQiang
     * @date 2020/9/17 9:31
     */
    @EnableSwagger2
    @ServletComponentScan
    @EnableCaching
    @EnableScheduling
    @ComponentScan(basePackages = {"com.zjxf.repository"})
    @SpringBootApplication(exclude = {RedisRepositoriesAutoConfiguration.class, MongoRepositoriesAutoConfiguration.class})
    public class PcbManageApplication {
    
        public static void main(String[] args) {
            SpringApplication springApplication = new SpringApplication(PcbManageApplication.class);
            springApplication.addListeners(new ApplicationStartup());
            springApplication.run(args);
        }
    
    }
    
  • 相关阅读:
    一个好的技术管理人员需要知道的几件事
    团队必经的五个阶段以及好团队的七个特征
    作为CTO如何做技术升级
    技术领导画像
    TF-IDF原理
    KNN和K-Means的区别
    图数据库入门
    Hbase和Hive的异同
    谈谈机器学习面试
    关于领导力的理解
  • 原文地址:https://www.cnblogs.com/wqkeep/p/13684662.html
Copyright © 2011-2022 走看看