How to connect to remote WildFly using JMC?

2019-08-27 12:12发布

问题:

I have a Linux server where I'm running WildFly 10. I work on a Windows machine and I want to profile the remote application server. I've checked that port 9990 is enabled for access via http by accessing http://<ip>:9990/console and via JMX access from the JConsole client that comes in WildFly. For the latter, I downloaded WildFly to my machine, went to %WILDFLY_PATH%\bin\jconsole.bat, accesed through service:jmx:http-remoting-jmx://<ip>:9990 and used my credentials, it works properly. Now I want to access vía JMC, but I cannot achieve it. I tried the following:

  • Copied jboss-client.jar libraries from %WILDFLY_PATH%\bin\client to %JDK_HOME%\lib\missioncontrol\dropins and start JMC.
  • Executed JMC from cmd and added -cp:a <location of jboss-client.jar> param, like this:

    jmc.exe -cp:a "C:\Program Files\Java\jdk1.8.0_72\lib\missioncontrol\dropins\jboss-client.jar"
    

    None of these worked.

I tried access with VisualVM and worked using the last approach but replaced jmc.exe by jvisualvm.exe and I connected to the external VM with no issues. I wonder if there's any way to achieve this using JMC.

回答1:

Since jmc doesn't accept the -cp flag, you have to run like this:

jmc.exe -vmargs -Xbootclasspath/a:<location of jboss-client.jar>

Some more clues might be here: https://community.oracle.com/thread/2592885?tstart=0



标签: java wildfly jmc