JConsole command line credentials

2DH picture 2DH · Jun 14, 2011 · Viewed 9k times · Source

Is it possible to pass credentials for monitored resource to JConsole while starting it via command line. I've got the command like that right now.

${jdk.home}/bin/jconsole.exe
    -J-Djava.class.path=${jdk.home}/lib/jconsole.jar;
        ${jdk.home}/lib/tools.jar;${weblogic.home}/server/lib/wljmxclient.jar
    -J-Djmx.remote.protocol.provider.pkgs=weblogic.management.remote
    service:jmx:iiop://127.0.0.1:7510/jndi/weblogic.management.mbeanservers.runtime

Does anyone know if that's possible and where should those credentials be placed.

Thanks.

Answer

Nicholas picture Nicholas · Jul 19, 2011

I don't think there is a command line access option to do this. It's a sensible approach since it would reveal credentials in the process signature which might be visible to others.

However, you can specify a password file using the system property com.sun.management.jmxremote.password.file.

These options are documented here.