A jar package of springboot runs under Linux, and then there are scheduled tasks in the jar package. What about configuration modification

Alibaba cloud Q & A 2022-02-13 07:48:28 阅读数:430

jar package springboot runs linux

One springboot Of jar The package runs on linux Under , then jar There is a scheduled task modification configuration file in the package . But when you modify a file , There is

java.io.FileNotFoundException:filepath (permission denied)

Take the answer 1:

Hello! , It is recommended that the configuration file , Put it outside , To jar Package sibling Directory , Or in jar Create a package at the same level config Catalog , Put it in config Under the table of contents , It's possible that you've hit jar Package problem , As a result, it cannot be modified normally , Put it outside , When a normal file is read and written, try . After all jar Configuration priority is , The outside takes precedence over the inside . image.png

copyright:author[Alibaba cloud Q & A],Please bring the original link to reprint, thank you. https://en.javamana.com/2022/02/202202130748258960.html