gpt4 book ai didi

java - Netbeans 配置文件 Wildfly 选定的方法

转载 作者:行者123 更新时间:2023-11-30 02:30:17 25 4
gpt4 key购买 nike

我想分析在 Wildfly 服务器中运行的项目中选定的方法。当设置分析器并调用该方法时,控制台将给出以下异常: java.lang.NoClassDefFoundError: org/netbeans/lib/profiler/server/ProfilerRuntimeCPUFullInstr

重现此问题的步骤如下:

  • 通过 Netbeans > 服务 > 服务器 > 启动 Wildfly 启动 Wildfly 服务器
  • 配置文件 > 附加到项目
  • 设置附加到项目 > 选择进程 (jboss-modules.jar)
  • 选择分析方法
  • 选择内部方法来分析“选定方法”
  • 从自己的项目添加方法并应用
  • run 方法,将抛出异常并断开分析器的连接

我正在使用 Netbeans 8.1 和 Wildfly 8.2。

到目前为止我尝试过的:

  • 添加-Djboss.modules.system.pkgs=org.jboss.byteman,org.netbeans.lib.profiler.server
  • http://i-proving.com/2011/07/07/how-to-get-visualvm-to-profile-jboss-without-crashing/但这给了我以下错误:
    /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/lib/visualvm/profiler/lib/jfluid-server-15.jar: line 1: PK: command not found
    /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/lib/visualvm/profiler/lib/jfluid-server-15.jar: line 2:,�*E: command not found
    /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/lib/visualvm/profiler/lib/jfluid-server-15.jar: line 3:+�*E���+BBMETA-INF/MANIFEST.MFManifest-Version:: No such file or directory
    /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/lib/visualvm/profiler/lib/jfluid-server-15.jar: line 4: Ant-Version:: command not found
    /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/lib/visualvm/profiler/lib/jfluid-server-15.jar: line 5: syntax error near unexpected token <code>('
    /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/lib/visualvm/profiler/lib/jfluid-server-15.jar: line 5:</code>Created-By: 1.7.0_45-b18 (Oracle Corporation)
  • 我还尝试在配置文件模式下启动 Wildfly,但此后挂起: Profiler Agent: Waiting for connection on port 5140 (Protocol version: 16)

最佳答案

这个问题应该很快会在夜间构建中得到修复。否则,如果您不想使用夜间模式,则需要在 WildFly 实例上执行以下操作,以便能够将分析器连接到它并分析您的方法。在standalone.sh中,您需要更新某些选项:

  • 将 jfluid-server.jar 附加到 bootclasspath(或者您可以更改命令行以使用 -classpath jboss-modules.jar:jfluid-server.jar org.jboss.modules.Main -jar jboss-modules.jar)
  • 将 jfluid 包添加到 system.pkgs 中,如下所示:jboss.modules.system.pkgs=org.jboss.byteman,org.jboss.logmanager,org.netbeans.lib.profiler.server
  • 添加-Xverify:none以避免出现错误消息

关于java - Netbeans 配置文件 Wildfly 选定的方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44453445/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com