我正在使用nohup命令从命令行运行的后台Spring服务。jar文件中的Java FileNotFoundException
我打了以下错误:
java.io.FileNotFoundException: class path resource [templates/] cannot be resolved to absolute file path because it does not reside in the file system: jar:file:/Users/gestes/Documents/workspace/bge/bge-proj/myProcess/target/myProcess-0.2.2.jar!/templates/
正在创建的JAR文件,并在确实存在:
/Users/gestes/Documents/workspace/bge/bge-proj/myProcess/target/myProcess-0.2.2.jar
当我解压JAR文件的内容,有一个/模板/ 目录。
看着这个例外,有一个“! “在jar文件名后面,我认为这说明了它无法找到的东西,但很明显,它在那里。
我错过了什么?
检查是否模板文件夹被添加到正在执行的jar的类路径 –
'jar:file:/'应该提到与jar根相关的文件名。不过你的文件名是绝对路径 –
这个!字符用于表示jar内文件路径的开始。这不是一个文字!字符被解释。检查你引用/ template目录的路径。你能把这个添加到你的问题吗? – SmileIT