I have a Spring boot application, the code should access the file in the resources folder. here is my application.properties file:
cert.file=classpath:/resources/cert.p12
however, he always complained:
java.io.FileNotFoundException: classpath:/resources/cert.p12 (No such file or directory)
I double checked the folder my_project / target / classes so that the cert.p12 file comes out of it.
and in the code I tried to access the file:
@Value("${cert.file}") private String certFile; .... @Bean public Sender sender() { return new Sender(certFile); }
what is this class? and why can't he find the file? Thanks!
source share