System property not taking effect even though it is listed on the JAVA_OPTS / process listing, etc in JBoss EAP 7 / 6

Solution Verified - Updated

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 7
    • 6

Issue

  • System property not taking effect even though it is listed on the JAVA_OPTS / process listing, etc in JBoss EAP 7 / 6

Resolution

Check the JBoss profile (standalone*.xml / domain.xml) and see if the same system property is being set in the profile xml.
If the system property is passed on the command line or JAVA_OPTS and is also specified in the profile xml, then the profile xml value will override it.

    <system-properties>
        <property name="my.system.property" value="value2"/> 
   </system-properties>

What is the loading order of the System Properties in JBoss EAP 7

Root Cause

  • Setting the system property via the JAVA_OPTS, -D, etc and also in the JBoss profile xml will show the VM args set to one value but that value will be overridden later via the JBoss profile xml

Diagnostic Steps

Check

  • JBoss profile xml (standalone*.xml / domain.xml) for
  • Check the standalone.conf
  • Check the environment variable $JAVA_OPTS
  • Check the startup command / startup script being used to start the JBoss instance
  • Enable DEBUG on org.jboss.as.config in the logging subsystem and check the server.log to see the VM Arguments confirming the value is set and also check the profile xml to make sure it is not setting the same property.
            <logger category="org.jboss.as.config">
                <level name="DEBUG"/>
            </logger>
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.