문제

In my Java .properties file I have this line:

KEYSTORE_PATH=${jboss.server.data.dir}/myapp/keys/keystore.jks

In all other files e.g. log4j.properties jboss.server.data.dir is changed to C:\\jboss\server\default\log and it's ok.

But here I get this exception:

java.io.FileNotFoundException: ${jboss.server.data.dir}\myapp\keys\keystore.jks (The system cannot find the path specified)

It looks like JBoss does not change its property name to the dir name.

도움이 되었습니까?

해결책

If you are loading your properties file via the java.util.Properties type, there is no special handling of value placeholders. There are several third party libraries that provide such capabilities. Spring being one of them.

Another option is to use the -C command line option when starting JBoss 4.x to specify a custom properties file. When loaded, JBoss will resolve the value placeholders correctly. The loaded, fully resolved properties can then be accessed via the various System.getProperties and System.getProperty methods.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top