原文:项目windows运行正常,而Linux上运行报错: class path resource [kwhRules.json] cannot be resolved to absolute file path because it does not reside in the file system

更改前代码: 更改后代码: 错误原因: ResourceUtils.getFile classpath:config.json 这 个方法只能从类路径下获取文件,无法从jar包中获取.打成jar包后发布到linuxs系统,就报错找不到文件了. ClassPathResource classPathResource new ClassPathResource config.json 可以从jar包 ...

2020-02-25 11:04 0 1746 推荐指数:

查看详情

 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM