0

We have an application running on websphere 8.5 and we'd like to pull the value of a custom property created using the following method in websphere admin console: Servers->Application Servers->server1->Process Definition->Java Virtual Machine->Custom Properties -> (new)

In the code, we are trying System.getProperty("property_name") to retrieve the property but to no avail as the result is coming out null. We've seen examples online but they are only pulling websphere variables.

Has anyone encountered and fixed this issue before ? We are using this code in static block (though we don't think that it'll make a difference).

Thanks,

h8MyJob
  • 183
  • 2
  • 10
  • 1
    JVM "custom properties" in the admin console are just system properties used to start the JVM, so System.getProperty should work, but you must restart the JVM for the system properties to be used. Have you done that? – Brett Kail May 19 '16 at 18:18
  • @BrettKail ha! It works! I've done multiple deployments with various solutions but never restarted the jvm. Thanks! – h8MyJob May 23 '16 at 02:20
  • Glad it worked. I've added the above as an answer, which you can accept it by clicking the checkmark to the left of the answer; that will increase my reputation, and it will increase your acceptance rate, which increases the chance people will answer your questions in the future. – Brett Kail May 23 '16 at 03:22

1 Answers1

1

JVM "custom properties" in the admin console are just system properties used to start the JVM, so System.getProperty should work, but you must restart the JVM for the system properties to be used.

Brett Kail
  • 33,593
  • 2
  • 85
  • 90