不研究原因只记录错
实现预先加载接口的时候commandlinerunner,运行后会报错failed to execute commandlinerunner;
所以加个for循环
@Component
@Order(value = 1)
public class YxRunner implements CommandLineRunner {
@Value("${file.jtwjlj}")
private String jtwjlj;
@Autowired
private ISourceService sourceService;
@Override
public void run(String... args) throws Exception {
//这里加了个for循环,加上就不报错了
int a = 10;
for (int a1 = 0; a1 < a; a1++) {
while (true) {
//这里做处理流程即可
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
}
}
}
964

被折叠的 条评论
为什么被折叠?



