Set system properties in standalone-full.xml in wildfly 8.2

28.2k views Asked by At

I have added system-properties tag in standalone-full.xml, but its not working in standalone mode. However, if I add the same tag in domain.xml it's working for domain mode.

<?xml version='1.0' encoding='UTF-8'?>

<server xmlns="urn:jboss:domain:2.2">

    <extensions>
    ....
    </extensions>

    <system-properties>
        <property name="java.util.Arrays.useLegacyMergeSort" value="true"/>
    </system-properties>
</server>

According to this article on jBoss General configuration concepts

System property values can be set in a number of places in domain.xml, host.xml and standalone.xml.

Then what about standalone-full.xml?

I don't want to set it through command line and not even in java code.

3

There are 3 answers

0
James R. Perkins On BEST ANSWER

In standalone it's probably too late to set it in the configuration files. You'll need to add it to the standalone.conf or standalone.conf.bat in the JAVA_OPTS environment variable. A global property like that needs to be set before anything else attempts to use java.util.Arrays.

0
zhrist On

If you have started the Wildfly server with standalone-full.xml instead of standalone.xml(the default) than this should be reflected in the start of the server:

standalone.sh -b <hostIP> -c standalone-full.xml -Dorg...

Then this will have effect on first start.

If you change something in this config file, you will need to reload Wildfly(configuration) from jboss cli:

[standalone@localhost:9990 /] :reload 
0
J. Doe On

For Wildfly 10 it's working nontheless. I was able to read the property for an instance started with the standalone-full.xml containing some properties.

The manual must be outdated then I guess? Because even Wildfly itself inserts a new property in the standalone-full.xml when using the Wildfly admin webinterface: http://localhost:9990 > Configuration > System Properties (Wildfly will add the property of course to the xml config which was used to start the instance). That's enough proof for me.