4 Replies Latest reply on Dec 6, 2011 7:20 AM by jaikiran

    JBoss AS 5 -D versus --properties and 'jboss.platform.mbeanserver'

    alanwevans

      One of my pet peeves about java is how long the command line can get with a bunch of -D options and so on.  It can make the output of commands like 'ps aux' exceptionally difficult to read.  Some properties, namely those that control the JVM must be set with -D but many it would seem can be set using the --properties (or -P) argument to run.sh.

       

      In my testing I have had good luck with putting any jboss.* and other properties in a file and using the --properties switch to get them loaded during bootstrap.  This is excellent for things that have to be set before conf/props/ is read like properties pertaining to RARs.

       

      Are there any properties that are JBoss related that MUST be set using -D, in particular is it sufficient to set 'jboss.platform.mbeanserver' in a properties file rather than using a -D option?

      Question bolded for the impatient like me...

       

      In my testing it appears that putting 'jboss.platform.mbeanserver' in a properties file seems to work.  I am able to see the java.lang domain in jmx-console as expected.

       

      I ask though because I am also using RHQ 4.2.0 which requires 'jboss.platform.mbeanserver' in order to be able to get JVM statistics but even with 'jboss.platform.mbeanserver' in a properties file I am unable to get RHQ to discover the JBoss JVM.

       

      I have asked this question additionally of the rhq-users list.  Though I have phrased it a bit more specifically to RHQ.

       

      It is of interest to me to find out what the behavior of the --properties switch is and if it is a good solution for helping to minimize the size of my java commandlines.

       

      Now if there was just a switch for java that would behave similarly that would work for JVM related properties.  i.e. com.sun.management.*.

       

      Regards,

       

      -Alan