Hi.
I would like to enable JMX with the Jenkins Java process but I seem to
get errors such as the following when I add any of the JMX options to
the "$JENKINS_ARGS" on a Linux machine startup:
Running from: /usr/lib/jenkins/jenkins.war
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:622)
at Main._main(Main.java:293)
at Main.main(Main.java:98)
Caused by: java.lang.IllegalArgumentException: Multiple command line argument specified: -Dcom.sun.management.jmxremote.port=9010
at winstone.cmdline.CmdLineParser.parse(CmdLineParser.java:68)
at winstone.Launcher.getArgsFromCommandLine(Launcher.java:361)
at winstone.Launcher.main(Launcher.java:334)
... 6 more
Ultimately my Jenkins java command line ends up being:
/etc/alternatives/java -Dcom.sun.akuma.Daemon=daemonized -Xmx3G
-Dhttp.proxyHost=
proxy.rr.intel.com -Dhttp.proxyPort=911
-DJENKINS_HOME=/var/lib/jenkins -jar /usr/lib/jenkins/jenkins.war
--logfile=/var/log/jenkins/jenkins.log --webroot=/var/cache/jenkins/war
--daemon -Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=9010
-Dcom.sun.management.jmxremote.local.only=false
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false --webroot=/var/lib/jenkins/war
--httpsPort=8080 --httpPort=-1 --ajp13Port=-1
But that then dies pretty quickly with the above error. The errors will
happen with any of the "-Dcom.sun.management.jmxremote arguments", not
just the "port" one.
Even if you might not know why the above is going wrong, if you have a
recipe for enabling JMX, I'd appreciate hearing about it.
Cheers,
b.