下面是我正在运行的命令
hadoop jar <path>/<some jar> -Dext.properties.dir=path of properties file>
我的 spring 配置有以下条目...
context:property-placeholder location="classpath:main/resources/properties/app.properties,file:${ext.properties.dir}/app-qa.properties"
但是当我运行它时,我看到下面的错误
Could not load properties; nested exception is java.io.FileNotFoundException: ${ext.properties.dir}/app-qa.properties (No such file or directory)
下面的虽然有效
java jar <path>/<some jar> -Dext.properties.dir=path of properties file
有人可以帮我调试吗?
最佳答案
不要混淆使用 GenericOptionsParser 的 -D property=value 选项设置 Hadoop 属性与使用 -Dproperty=value 设置 JVM 系统属性。
JVM 不允许任何空格,而 GenericOptionsParser 需要。
关于spring - -D 参数在 hadoop jar 命令中无法识别(使用 spring),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22277885/