如何从 IDEA JProfiler 插件连接到 JVM,无需等待?

How can I connect from IDEA JProfiler plugin to a JVM started without nowait?

我正在尝试按如下方式分析 JBoss:

问题是 "Quick Attach" window 看不到 JBoss JVM,无论我做什么。

这是显示 JProfiler 已准备就绪的 JBoss 标准输出:

Calling "C:\src\ss-master\middle\runtime\jboss-as-7.1.1.Final\bin\standalone.conf.bat"
===============================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: C:\src\ss-master\middle\runtime\jboss-as-7.1.1.Final

  JAVA: C:\tools\java\bin\java

  JAVA_OPTS: -XX:+TieredCompilation -agentpath:C:\Progra~1\jprofiler8\bin\windows-x64\jprofilerti.dll -Dprogram.name=standalone_jprofiler.bat -Xms256m -Xmx8192m -XX:NewRatio=6 -XX:
PermSize=128m -XX:MaxPermSize=256m -Xss512K -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.war
ning=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djboss.server.default.config=standalone.xml -Dorg.jboss.server.bootstrap.maxThreads=8 -agentlib:jdwp=transport=dt_socket,se
rver=y,suspend=n,address=5001

===============================================================================

JProfiler> Protocol version 41
JProfiler> Using JVMTI
JProfiler> JVMTI version 1.1 detected.
JProfiler> 64-bit library
JProfiler> Listening on port: 8849.
JProfiler> Instrumenting native methods.
JProfiler> Can retransform classes.
JProfiler> Can retransform any class.
JProfiler> Native library initialized
JProfiler> VM initialized
JProfiler> Waiting for a connection from the JProfiler GUI ...

以下是我尝试过的一些方法:

最后一点是最耐人寻味的。保存的会话有哪些附加信息使其能够检测到 "waiting" JProfiler 代理?

以下是我的用例的限制条件:

profiling agent在启动时等待连接时,attach机制不起作用,因为启用attach的jvmstat系统还没有加载。事实上,没有 Java 类 被加载,所以在那个阶段没有任何需要 Java 代码的东西可以工作。

要分析此类等待中的 VM,您需要远程分析会话。在 JProfiler 8 中,IDE 集成不支持此功能。

这将在 JProfiler 9.0(即将发布)中成为可能。附加对话框将有两种模式,一种是列出所有本地 运行ning VM 的本地模式,另一种是远程附加选项,您可以在其中输入主机名和端口。

但是,您也可以直接从 IDEA 分析 JBoss 运行 配置。那就不用修改启动脚本了。