报错信息如下:



***************************

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);
    }

}

相关文章:

  • 2021-05-22
  • 2021-05-07
  • 2021-08-25
  • 2021-07-07
  • 2022-01-08
  • 2022-02-12
  • 2021-04-13
  • 2021-11-14
猜你喜欢
  • 2022-12-23
  • 2021-05-22
  • 2021-11-20
  • 2022-12-23
  • 2021-12-29
  • 2021-06-14
  • 2021-12-29
相关资源
相似解决方案