【发布时间】:2010-10-19 00:45:46
【问题描述】:
我正在编写一个作为服务运行的代码。基本上它会监听输入并相应地产生输出。
我正在尝试使用 jrat 分析一个包。 [我们没有 Jprofiler 的许可证,我无法设置试用版以正常工作]。
我按照这里的说明进行操作: http://transferer.blogspot.com/2009/12/how-to-use-jrat-in-eclipse.html 和 http://digiassn.blogspot.com/2008/01/java-using-jrat-under-eclipse.html
我正在获取 .jrat 输出文件,但我看到的只是:
001_JRat-LOG.jrat 桌面%猫 001_JRat-LOG.jrat 查看器="org.shiftone.jrat.ui.viewer.SimpleTextOutputViewBuilder" JRat:INFO(10 月 18 日 17:15:32,769)(主要) RuntimeContextImpl - 创建的日志文件 JRat:INFO(10 月 18 日 17:15:32,769)(主要) RuntimeContextImpl - 运行 JRat 版本 1-alpha2 - 建于 7 月 31 日 2006 JRat:INFO (10 月 18 日 17:15:32,770) (主)设置 - 字符串 'jrat.factory' = 'org.shiftone.jrat.provider.silent.SilentMethodHandler' JRat:INFO(10 月 18 日 17:15:32,771)(主要) RootFactory - JRat 创建根 处理厂... JRat:INFO (Oct/18 17:15:42,451)(JRat-JMX-轮询) WaitingJmxRegistry - 注册 6 mbean(s) JRat:INFO(10 月 18 日) 17:15:42,451)(JRat-JMX-轮询) ServerJmxRegistry - registerMBean org.shiftone.jrat.core.jmx.info.JRatInfo@c5e9c shiftone.jrat:service=org.shiftone.jrat.core.jmx.info.JRatInfo JRat:INFO (10 月 18 日 17:15:42,453) (JRat-JMX-Poller) ServerJmxRegistry - 注册MBean org.shiftone.jrat.util.log.LoggingManager@11756a4 shiftone.jrat:service=org.shiftone.jrat.util.log.LoggingManager JRat:INFO (10 月 18 日 17:15:42,453) (JRat-JMX-Poller) ServerJmxRegistry - 注册MBean org.shiftone.jrat.core.jmx.benchmark.Benchmark@b301f2 shiftone.jrat:service=org.shiftone.jrat.core.jmx.benchmark.Benchmark JRat:INFO (10 月 18 日 17:15:42,453) (JRat-JMX-Poller) ServerJmxRegistry - 注册MBean 变压器[AsmInjectorStrategy(使用 http://asm.objectweb.org)] shiftone.jrat:service=org.shiftone.jrat.inject.bytecode.Transformer JRat:INFO (10 月 18 日 17:15:42,454) (JRat-JMX-Poller) ServerJmxRegistry - 注册MBean org.shiftone.jrat.core.shutdown.ShutdownRegistry@4be2cc shiftone.jrat:service=org.shiftone.jrat.core.shutdown.ShutdownRegistry JRat:INFO (10 月 18 日 17:15:42,454) (JRat-JMX-Poller) ServerJmxRegistry - 注册MBean FileOutputRegistry[PrintWriter[001_JRat-LOG.jrat]] shiftone.jrat:service=org.shiftone.jrat.core.output.FileOutputRegistry JRat:INFO (10 月 18 日 17:15:48,825) (JRat-Shutdown) ShutdownRegistry - 关闭 下... [变压器[AsmInjectorStrategy(使用 http://asm.objectweb.org)], FileOutputRegistry[PrintWriter[001_JRat-LOG.jrat]]] JRat:INFO (10 月 18 日 17:15:48,826) (JRat-Shutdown) ShutdownRegistry - 关闭 FileOutputRegistry[PrintWriter[001_JRat-LOG.jrat]]... JRat:INFO (10 月 18 日 17:15:48,826) (JRat-Shutdown) FileOutputRegistry - 关闭文件输出 [PrintWriter[001_JRat-LOG.jrat]] JRat:INFO (10 月 18 日 17:15:48,826) (JRat-Shutdown) FileOutputRegistry - 关闭: PrintWriter[001_JRat-LOG.jrat] JRat:INFO (10 月 18 日 17:15:48,826) (JRat-Shutdown) FileOutputPrintWriter - 关闭 JRat:INFO (Oct/18 17:15:48,826) (JRat-Shutdown) FileOutputRegistry - 删除 PrintWriter[001_JRat-LOG.jrat]
以前有人在 linux 上使用过它吗?我在想,因为我将其作为服务运行..在运行我的应用程序后,我点击终止按钮来停止我的应用程序[与其他可能在工作完成后自行终止的应用程序相反]..这可能不会使应用程序正常退出因此 jrat 不会产生转储?这只是一个盲目的猜测。
谢谢
附注: 我正在使用日食 Java 版本 1.6.0_13
编辑: 无法使其正常工作,但尝试使用 Visualvm 代替它可以正常工作。 但是需要分析远程应用程序,[因为我想分析我的服务的一部分,并且强调这部分代码并获取其编号来自服务器本身的简单方法]所以会寻找易于远程使用的东西.
【问题讨论】:
-
你考虑过使用 JVisualVM 吗?它带有 JDK。
-
Thnx .. 我试过 JVisualVM 效果很好。但是,它不能与远程应用程序一起使用。该文档说“您无法分析在远程主机上运行的应用程序”。 visualvm.dev.java.net/gettingstarted.html?Java_VisualVM