4 Replies Latest reply on Feb 9, 2010 3:23 AM by Bernd Koecke

    JBoss 6.0.0M1 Handling of system properties (-P)

    Bernd Koecke Novice
      I used the -P parameter with JBoss 4.2.3 to set system properties. For example, to set 'jboss.bind.address' these lines are working:


      run.sh -b10.0.0.2

      run-sh -P<propfile with jboss.bind.address>

      run.sh -Djboss.bind.address=

      export JAVA_OPTS="-Djboss.bind.address="; run.sh


      But with JBossAS 6 only these two lines are possible:


      run.sh -b10.0.0.2

      export JAVA_OPTS="-Djboss.bind.address="; run.sh


      I think I found the reason for this:


      In 4.2.3 the 'org.jboss.Main' class has a 'props' field of type 'java.util.Properties' which uses the SystemProperties for defaults.


      In 6.0.0 this field is a HashMap which gets a copy of all SystemProperties in the constructor. But only the handling of the -b parameter copies its value in the SystemProperties and in the 'props' field. The -D and -P parameter affect only the SystemProperties, but they don't affect the 'props' field. But the 'props' field is used for initialisation.


      The result is, not all properties from the -P parameter are used by the server. Is this supposed to be like this?


      Thanks a lot,