Search code examples
javaweblogicweblogic12cwlst

how to set JVM arguments with quota for a Managed Server started by Node Manager


I have a WebLogic domain with multiple Managed Servers. Everything runs on separated hosts. The managed servers are started by Node Manager.

According to the Oracle WL documentation if the Managed Server is started by Node Manager then I need to use the Environments > Servers > MANAGED-SERVER-1 > Server Start > Arguments to add extra JVM parameters. That is great, works fine. If I add something here then this appears properly on the server.

But now I need to add some -D param that contain quotas:

-Dhttps.protocols="TLSv1.2" -Djdk.tls.client.protocols="TLSv1.2"

The WL console complains about the quotas and does not allow me to save/activate the settings with quota.

When I use WLST this error appears:

javax.management.InvalidAttributeValueException: javax.management.InvalidAttributeValueException: 
Arguments may not contain '"'

Here:

cd('/Servers/' + _managed_server_name + '/ServerStart/' + _managed_server_name)
cmo.setClassPath(_managed_server_classpath)
cmo.setArguments(_managed_server_arguments) <--- here

My question is how to add -D arguments to the Managed Server if the server is only started by Node Manager and the start.....sh scripts are never used?

Operating system: Linux


Solution

  • One way to introduce jvm arguements is the nodemanager and the console, but its not the only one. You can add your jvm arguements in the scripts located under $DOMAIN_HOME/bin. For example setDomainEnv.sh there is a variable JAVA_OPTIONS you can add your arguements there. If you have the StartScriptEnabled=true and StartScriptName=startWebLogic.sh set in your nodemanager.properties the jvm options will be even added when you use your nodemanager to start your servers. Another tip is if you use your setDomainEnv.sh script to set your jvm arguements you can also write an if statement and check the $SERVER_NAME which is set depending on which server you start, and for example write the if statement to only add specific jvm arguements to the managed server or AdminServer. If you search the setDomainEnv.sh you will find examples on how this if statement that checks the server name should be written. The $SERVER_NAME is the exact name you see for your servers in the weblogic console.

    Finally, do not use the double quotes just set your arguements without those. If you want to use wlst you shoud set the arguements like this

    cmo.setArguments("-Dhttps.protocols=TLSv1.2 -Djdk.tls.client.protocols=TLSv1.2") the quotes enolse all the arguements

    Althought this is for 11g and for SOA a lot of the points are WebLogic specific and are still valid for 12c as well. https://www.ateam-oracle.com/post/where-and-how-to-set-jvm-parameters-in-oracle-soa-11g