简体   繁体   中英

Spring @PropertySource location string declaration in JNLP files

We got a java web start program named BaseByBase and it has an external in-house library which has the the following spring property source tag @PropertySource("${appclient}") . The value of "${appclient}" is specified in the JNLP file of BaseByBase as <property name="appclient" value="url to location"/> .

When I run the BaseByBase through its jnlp file everything works fine. We also got an another jnlp program VOCs which can start its own BaseByBase. The JNLP file for VOCs also contains the <property name="appclient" value="url to location"/> and it can start BaseByBase without a problem.

Now we are trying to get our third program GATU to run BaseByBase as well. Gatu has the same code as VOCs to start BaseByBase and its JNLP file also contains the <property name="appclient" value="url to location"/> . If I run Gatu locally, everything works as expected. But when I run GATU from its JNLP and start BaseByBase from it, I get the the following error Failed to initialize application context: java.lang.IllegalArgumentException: Could not resolve placeholder 'appclient' in string value [${appclient}] .

I tried to set the String value using System.setProperty but that didn't fix it. Changed the library code so that the propertysource would point to the location of the properties file but that didn't do it either.

Any ideas on how to work around this problem? Our JNLP files are signed so I think that gets around where setting insecure system properties through JNLPs.

@PropertySource(value={"classpath:appclient.properties"})

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM