4
votes

I'm trying to use an aliased password as a jvm arg, but the aliased password does not seem to be provided to the web app. Here is my domain.xml config:

<jvm-options>-Dmy_password=${ALIAS=my_password_alias}</jvm-options>

However, trying to retrieve the password just returns null

String password = System.getEnv("my_password"); // returns null

and

String password = System.getProperty("my_password"); // returns "${ALIAS=my_password_alias}"

I've tried on: GlassFish Server Open Source Edition 3.1.2.2 (build 5)

Searching online it seems someone else has run into a similar issue

Question: does glassfish support password aliases for jvm args?

1
Please note the comment from @MarcosZolnowski below. This is a bug (GLASSFISH-18961 ) which has been fixed in GF v. 4.0_b50_ms4Ashutosh Jindal

1 Answers

3
votes

It works, just use System.getProperty("my_password").