I need to define some properties in the weblogic enviroment to be used for an application on the startup process. I put the properties directly in the file setDomainEnv but the application doesn't get the property with this line:
public static final String SYSVAR_ENVIROMENT = System
.getProperty(Constants.ENVIROMENT);
I'm not sure if I declared the property correctly, can anybody help me? In others application servers this type of properties could be set by the web console, but I didn't find this way in weblogic.
In Weblogic you can achieve this in two ways:
Modify startWebLogic.sh and add your properties as -D arguments along with the others that weblogic already uses like:
JAVA_OPTIONS: ${SAVE_JAVE_OPTIONS} -Dmy.property=something
Modify your server start argument via the admin console. Login to the console and:
Servers link -> <server name> -> Configuration tab -> Server Start tab
Then you can add your -D properties to the Arguments:
area.
If you want to verify your java properties/options are present you can either do a ps -ef and look at the server process, you can verify in the log file that the properties are present when the server starts, or you can connect to the server via jconsole <pid>
and check the VM arguments tab.