我们目前在 Prepare for Profiling" 中使用 JProfiler 8.0.4我们的 Cent OS 机器上的模式与 Tomcat 6 和 Java 7 一起使用。我们使用具有 float 许可证的 JProfiler。我们在远程服务器上提取了 JProfiler Linux 存档。
Tomcat 由 Tanuki Wrapper 管理。这是我们的配置
wrapper.java.additional.101=-agentpath:${jprofiler.path}/bin/linux-x64/libjprofilerti.so=port=8849,nowait
这很好用,启动时我们会在日志中找到它
INFO | jvm 1 | main | 2014/03/04 10:06:41.872 | JProfiler> Don't wait for frontend to connect.
INFO | jvm 1 | main | 2014/03/04 10:06:41.872 | JProfiler> Protocol version 38
INFO | jvm 1 | main | 2014/03/04 10:06:41.872 | JProfiler> Using JVMTI
INFO | jvm 1 | main | 2014/03/04 10:06:41.872 | JProfiler> JVMTI version 1.1 detected.
INFO | jvm 1 | main | 2014/03/04 10:06:41.873 | JProfiler> 64-bit library
INFO | jvm 1 | main | 2014/03/04 10:06:41.873 | JProfiler> Starting up without initial configuration.
INFO | jvm 1 | main | 2014/03/04 10:06:41.873 | JProfiler> Listening on port: 8849.
INFO | jvm 1 | main | 2014/03/04 10:06:41.873 | JProfiler> Instrumenting native methods.
INFO | jvm 1 | main | 2014/03/04 10:06:41.873 | JProfiler> Can retransform classes.
INFO | jvm 1 | main | 2014/03/04 10:06:41.873 | JProfiler> Can retransform any class.
INFO | jvm 1 | main | 2014/03/04 10:06:41.873 | JProfiler> Native library initialized
INFO | jvm 1 | main | 2014/03/04 10:06:42.074 | JProfiler> VM initialized
最后,我们将 JProfiler 客户端连接到代理,一切正常。
如 1 中所述
, it's also possible to append ,config=[config file] and ,id=[id] parameters to instruct the profiling agent to take the profiling settings from a particular session in a particular config file. If you connect with the same profiling settings, no classes will have to be retransformed.
但是如果我们像这样添加配置和ID wrapper.java.additional.101=-agentpath:${jprofiler.path}/bin/linux-x64/libjprofilerti.so=port=8849,nowait,id=${jprofiler.id},config=${jprofiler.config .path} 虚拟机无法启动,因为 JProfiler 要求许可证。
INFO | jvm 5 | main | 2014/03/04 10:05:30.475 | JProfiler> Don't wait for frontend to connect.
INFO | jvm 5 | main | 2014/03/04 10:05:30.475 | JProfiler> Protocol version 38
INFO | jvm 5 | main | 2014/03/04 10:05:30.475 | JProfiler> Using JVMTI
INFO | jvm 5 | main | 2014/03/04 10:05:30.475 | JProfiler> JVMTI version 1.1 detected.
INFO | jvm 5 | main | 2014/03/04 10:05:30.475 | JProfiler> 64-bit library
INFO | jvm 5 | main | 2014/03/04 10:05:30.475 | JProfiler> Using config file /path/to/config/jprofiler-config.xml (id: 100)
INFO | jvm 5 | main | 2014/03/04 10:05:30.475 | JProfiler> Listening on port: 8849.
INFO | jvm 5 | main | 2014/03/04 10:05:30.475 | JProfiler> Instrumenting native methods.
INFO | jvm 5 | main | 2014/03/04 10:05:30.475 | JProfiler> Can retransform classes.
INFO | jvm 5 | main | 2014/03/04 10:05:30.475 | JProfiler> Can retransform any class.
INFO | jvm 5 | main | 2014/03/04 10:05:30.476 | JProfiler> Native library initialized
ERROR | wrapper | main | 2014/03/04 10:05:30.614 | JVM exited while loading the application.
INFO | jvm 5 | main | 2014/03/04 10:05:30.614 | JProfiler> VM initialized
INFO | jvm 5 | main | 2014/03/04 10:05:30.614 | JProfiler> Using dynamic instrumentation
INFO | jvm 5 | main | 2014/03/04 10:05:30.615 | JProfiler> Time measurement: elapsed time
INFO | jvm 5 | main | 2014/03/04 10:05:30.615 | JProfiler> CPU profiling enabled
INFO | jvm 5 | main | 2014/03/04 10:05:30.615 | JProfiler> ERROR: Invalid license key.
这是我的问题:
- 有谁知道如何将许可证的情况告知代理人?
- 有人在生产设置中使用过此设置吗?
问候,
安德烈亚斯
最佳答案
这个限制确实是不必要的,将在 JProfiler 8.1 中被移除。
从 8.0 开始,如果指定了配置参数,则许可证 key 必须位于配置文件中。您可以从 %USERPROFILER.jprofiler8\config.xml 或 $HOME/.jprofiler8/config.xml 复制整个配置文件而不是导出它,然后许可证 key 将可用于代理。
关于java - 带有 id 和配置参数的 JProfiler Agent 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22168752/