報錯信息如下:
***************************
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);
}
}