4

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?

Chris Snow
  • 23,813
  • 35
  • 144
  • 309
  • 1
    Please note the comment from @MarcosZolnowski below. This is a bug (**[GLASSFISH-18961](https://java.net/jira/browse/GLASSFISH-18961)** ) which has been fixed in GF v. 4.0_b50_ms4 – Ashutosh Jindal Apr 30 '15 at 10:17
  • Here is the fix : https://java.net/projects/glassfish/sources/svn/revision/55379 – Ashutosh Jindal Apr 30 '15 at 10:26

1 Answers1

3

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

Marcos Zolnowski
  • 2,751
  • 1
  • 24
  • 29