问题描述
我有一台运行 WildFly 10 的 Linux 服务器.我在一台 Windows 机器上工作,我想分析远程应用程序服务器.我已经通过访问 http://<ip>:9990/console
并通过来自 WildFly 中的 JConsole 客户端的 JMX 访问来检查端口 9990 是否已启用通过 http 访问.对于后者,我将 WildFly 下载到我的机器上,转到 %WILDFLY_PATH%\bin\jconsole.bat
,通过 service:jmx:http-remoting-jmx:// 访问;:9990
并使用我的凭据,它可以正常工作.现在我想通过 JMC 访问,但我无法实现.我尝试了以下方法:
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:
- 将 jboss-client.jar 库从
%WILDFLY_PATH%\bin\client
复制到%JDK_HOME%\lib\missioncontrol\dropins
并启动 JMC. 从 cmd 执行 JMC 并添加
-cp:a
参数,如下所示:
- 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"
这些都没有用.
我尝试使用 VisualVM 访问并使用最后一种方法工作,但将 jmc.exe
替换为 jvisualvm.exe
并且我没有问题地连接到外部 VM.我想知道是否有任何方法可以使用 JMC 来实现这一点.
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.
推荐答案
由于 jmc 不接受 -cp 标志,你必须像这样运行:
Since jmc doesn't accept the -cp flag, you have to run like this:
jmc.exe -vmargs -Xbootclasspath/a:
jmc.exe -vmargs -Xbootclasspath/a:<location of jboss-client.jar>
这里可能有更多线索:https://community.oracle.com/thread/2592885?tstart=0
这篇关于如何使用 JMC 连接到远程 WildFly?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!