Yourkit UI 抛出 "There's no application running at localhost with profiler agent configured to listen on port" 异常

Yourkit UI throwing "There's no application running at localhost with profiler agent configured to listen on port" exception

我正在尝试分析 Jboss 中部署的远程应用程序。到目前为止,我可以连接到远程服务器并查看我的应用程序,我也可以连接到应用程序。但是当我点击 "Start CPU profiling" 时,它需要很长时间并且大多数时候会导致以下异常:

There's no application running at localhost with profiler agent configured to listen on port 59462
or profiler agent is incompatible with current version of profiler

虽然有时(很少)它确实会开始分析并给我想要的结果。但是我无法理解这种不一致的行为,我也不明白为什么它会给我一个错误,说 "no application running on localhost ..." 考虑到我正在尝试分析远程应用程序。

来自安装 UI 的机器的代码段:

18.04-61 8341.339: com.yourkit.k.jm: LC@7fc6aab9{localhost:59131,pid=23651}: com.yourkit.b.bb: Bad stream from profiled application
Technical detail: EOF
   at com.yourkit.b.o.a(a:211)
   at com.yourkit.b.o.b(a:53)
   at com.yourkit.b.q.a(a:3385)
   at com.yourkit.b.q.updateTables(a:320)
   at com.yourkit.api.ControllerImpl.perform(a:12)
   at com.yourkit.api.ControllerImpl.makeRequest(a:18)
   at com.yourkit.api.ControllerImpl.makeRequest(a:534)
   at com.yourkit.api.ControllerImpl.updateDatabaseTables(a:200)
   at com.yourkit.k.jd.b(a:119)
   at com.yourkit.k.jd.b(a:286)
   at com.yourkit.k.jm.a(a:150)
   at com.yourkit.api.ControllerImpl.perform(a:3)
   at com.yourkit.api.ControllerImpl.makeRequest(a:163)
   at com.yourkit.api.ControllerImpl.makeRequest(a:534)
   at com.yourkit.api.ControllerImpl.runBatch(a:544)
   at com.yourkit.k.jm.run(a:150)

18.04-61 8341.339: com.yourkit.k.jm: LC@924ccd1{localhost:59570,pid=23851}: com.yourkit.b.bb: Bad stream from profiled application
Technical detail: EOF
   at com.yourkit.b.o.a(a:211)
   at com.yourkit.b.o.b(a:60)
   at com.yourkit.b.q.a(a:1275)
   at com.yourkit.b.q.updateTables(a:320)
   at com.yourkit.api.ControllerImpl.perform(a:12)
   at com.yourkit.api.ControllerImpl.makeRequest(a:18)
   at com.yourkit.api.ControllerImpl.makeRequest(a:534)
   at com.yourkit.api.ControllerImpl.updateDatabaseTables(a:200)
   at com.yourkit.k.jd.b(a:119)
   at com.yourkit.k.jd.b(a:286)
   at com.yourkit.k.jm.a(a:150)
   at com.yourkit.api.ControllerImpl.perform(a:3)
   at com.yourkit.api.ControllerImpl.makeRequest(a:163)
   at com.yourkit.api.ControllerImpl.makeRequest(a:534)
   at com.yourkit.api.ControllerImpl.runBatch(a:544)
   at com.yourkit.k.jm.run(a:150)

18.04-61 8341.339: com.yourkit.k.jm: LC@1fe95a4b{localhost:59991,pid=23983}: com.yourkit.b.bb: Bad stream from profiled application
Technical detail: EOF
   at com.yourkit.b.o.a(a:211)
   at com.yourkit.b.o.b(a:74)
   at com.yourkit.b.q.a(a:1854)
   at com.yourkit.b.q.updateTables(a:320)
   at com.yourkit.api.ControllerImpl.perform(a:12)
   at com.yourkit.api.ControllerImpl.makeRequest(a:18)
   at com.yourkit.api.ControllerImpl.makeRequest(a:534)
   at com.yourkit.api.ControllerImpl.updateDatabaseTables(a:200)
   at com.yourkit.k.jd.b(a:119)
   at com.yourkit.k.jd.b(a:286)
   at com.yourkit.k.jm.a(a:150)
   at com.yourkit.api.ControllerImpl.perform(a:3)
   at com.yourkit.api.ControllerImpl.makeRequest(a:163)
   at com.yourkit.api.ControllerImpl.makeRequest(a:534)
   at com.yourkit.api.ControllerImpl.runBatch(a:544)
   at com.yourkit.k.jm.run(a:150)

18.04-61 8344.342: com.yourkit.k.jm: LC@1fe95a4b{localhost:59991,pid=23983}: com.yourkit.util.bs: There's no application running at localhost with profiler agent configured to listen on port 59991
   at com.yourkit.api.ControllerImpl.transformException(a:273)
   at com.yourkit.api.ControllerImpl.makeRequest(a:293)
   at com.yourkit.api.ControllerImpl.makeRequest(a:534)
   at com.yourkit.api.ControllerImpl.runBatch(a:544)
   at com.yourkit.k.jm.run(a:150)

18.04-61 8346.665: com.yourkit.b.bh: LC@74c29709{localhost:60361,pid=23651}: created; local=false
18.04-61 8347.545: com.yourkit.b.q: snapshot_outer: starting: null
18.04-61 8347.545: com.yourkit.k.jm: LC@1fe95a4b{localhost:59991,pid=23983}: com.yourkit.util.bs: There's no application running at localhost with profiler agent configured to listen on port 59991
   at com.yourkit.api.ControllerImpl.transformException(a:273)
   at com.yourkit.api.ControllerImpl.makeRequest(a:293)
   at com.yourkit.api.ControllerImpl.makeRequest(a:534)
   at com.yourkit.api.ControllerImpl.runBatch(a:544)
   at com.yourkit.k.jm.run(a:150)

18.04-61 8347.545: com.yourkit.k.jm: LC@1fe95a4b{localhost:59991,pid=23983}: disconnected
18.04-61 8347.545: com.yourkit.b.q: controller telemetry limit: 3600
18.04-61 8347.545: com.yourkit.b.q: snapshot_outer: done in 0 sec: null
18.04-61 8379.660: com.yourkit.k.my: error: com.yourkit.util.bs: There's no application running at localhost with profiler agent configured to listen on port 60361
or profiler agent is incompatible with current version of profiler
   at com.yourkit.api.ControllerImpl.transformException(a:278)
   at com.yourkit.api.ControllerImpl.makeRequest(a:293)
   at com.yourkit.api.ControllerImpl.makeRequest(a:534)
   at com.yourkit.api.ControllerImpl.startCpuProfiling(a:154)
   at com.yourkit.k.kt.a(a:92)
   at com.yourkit.k.jo.b(a:60)
   at com.yourkit.k.d.al.a(a:183)
   at com.yourkit.k.dz.run(a:16)
Caused by: java.net.SocketTimeoutException: Read timed out
   at java.net.SocketInputStream.socketRead0(Native Method)
   at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
   at java.net.SocketInputStream.read(SocketInputStream.java:171)
   at java.net.SocketInputStream.read(SocketInputStream.java:141)
   at com.yourkit.b.bj.read(a:21)
   at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
   at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
   at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
   at java.io.DataInputStream.readFully(DataInputStream.java:195)
   at java.io.DataInputStream.readLong(DataInputStream.java:416)
   at com.yourkit.runtime.Packet.readHeader(a:3)
   at com.yourkit.runtime.Packet.readHeader(a:51)
   at com.yourkit.runtime.Packet.readHeaderWithStandardResponse(a:17)
   at com.yourkit.api.ControllerImpl.readHeaderWithStandardResponse(a:10)
   at com.yourkit.api.ControllerImpl.access0(a:558)
   at com.yourkit.api.ControllerImpl.perform(a:8)
   at com.yourkit.api.ControllerImpl.makeRequest(a:163)
   ... 6 more

18.04-61 9097.534: com.yourkit.k.my: error: com.yourkit.util.bs: There's no application running at localhost with profiler agent configured to listen on port 60361
or profiler agent is incompatible with current version of profiler
   at com.yourkit.api.ControllerImpl.transformException(a:278)
   at com.yourkit.api.ControllerImpl.makeRequest(a:293)
   at com.yourkit.api.ControllerImpl.makeRequest(a:534)
   at com.yourkit.api.ControllerImpl.startCpuProfiling(a:154)
   at com.yourkit.k.kt.a(a:92)
   at com.yourkit.k.jo.b(a:60)
   at com.yourkit.k.d.al.a(a:183)
   at com.yourkit.k.dz.run(a:16)
Caused by: java.net.SocketTimeoutException: Read timed out
   at java.net.SocketInputStream.socketRead0(Native Method)
   at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
   at java.net.SocketInputStream.read(SocketInputStream.java:171)
   at java.net.SocketInputStream.read(SocketInputStream.java:141)
   at com.yourkit.b.bj.read(a:21)
   at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
   at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
   at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
   at java.io.DataInputStream.readFully(DataInputStream.java:195)
   at java.io.DataInputStream.readLong(DataInputStream.java:416)
   at com.yourkit.runtime.Packet.readHeader(a:3)
   at com.yourkit.runtime.Packet.readHeader(a:51)
   at com.yourkit.runtime.Packet.readHeaderWithStandardResponse(a:17)
   at com.yourkit.api.ControllerImpl.readHeaderWithStandardResponse(a:10)
   at com.yourkit.api.ControllerImpl.access0(a:558)
   at com.yourkit.api.ControllerImpl.perform(a:8)
   at com.yourkit.api.ControllerImpl.makeRequest(a:163)
   ... 6 more

18.04-61 9191.727: com.yourkit.k.jm: LC@74c29709{localhost:60361,pid=23651}: com.yourkit.util.bs: There's no application running at localhost with profiler agent configured to listen on port 60361
or profiler agent is incompatible with current version of profiler
   at com.yourkit.api.ControllerImpl.transformException(a:278)
   at com.yourkit.api.ControllerImpl.makeRequest(a:293)
   at com.yourkit.api.ControllerImpl.makeRequest(a:534)
   at com.yourkit.api.ControllerImpl.getStatus(a:308)
   at com.yourkit.api.ControllerImpl.cacheStatuses(a:175)
   at com.yourkit.k.jd.b(a:130)
   at com.yourkit.k.jd.b(a:286)
   at com.yourkit.k.jm.a(a:150)
   at com.yourkit.api.ControllerImpl.perform(a:3)
   at com.yourkit.api.ControllerImpl.makeRequest(a:163)
   at com.yourkit.api.ControllerImpl.makeRequest(a:534)
   at com.yourkit.api.ControllerImpl.runBatch(a:544)
   at com.yourkit.k.jm.run(a:150)
Caused by: java.io.EOFException
   at java.io.DataInputStream.readFully(DataInputStream.java:197)
   at java.io.DataInputStream.readLong(DataInputStream.java:416)
   at com.yourkit.runtime.Packet.readHeader(a:3)
   at com.yourkit.runtime.Packet.readHeader(a:51)
   at com.yourkit.runtime.Packet.readHeaderWithStandardResponse(a:17)
   at com.yourkit.api.ControllerImpl.readHeaderWithStandardResponse(a:10)
   at com.yourkit.api.ControllerImpl.access0(a:558)
   at com.yourkit.api.ControllerImpl.perform(a:5)
   at com.yourkit.api.ControllerImpl.makeRequest(a:18)
   ... 11 more

18.04-61 9268.954: com.yourkit.h.c.k: SSH: delPortForwarding error: Task java.util.concurrent.FutureTask@3ea383e2 rejected from java.util.concurrent.ThreadPoolExecutor@60cb8835[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 55]
18.04-61 9271.891: com.yourkit.h.a.e: 
  cmd: /home/dpagmk/software/jdk1.7.0_45/jre/bin/java -cp .yjp/2018.04-b61/lib/yourkit.jar -Dfile.encoding=UTF-8 -Dyk.logger.stdErrOnly=true com.yourkit.Main -host-server
  request: getVmInfos
  exit code: -1
  stdout:
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f509d520ac0, pid=16167, tid=139984557885184
#
# JRE version: Java(TM) SE Runtime Environment (7.0_45-b18) (build 1.7.0_45-b18)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.45-b08 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [libyjpagent.so+0x14cac0]  Options::containsSubstring(YStringImpl<char> const&)+0x0
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/admin/hs_err_pid16167.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

18.04-61 9278.271: com.yourkit.b.bh: LC@3f153e3{localhost:61219,pid=23720}: created; local=false
18.04-61 9279.359: com.yourkit.b.q: snapshot_outer: starting: null
18.04-61 9279.359: com.yourkit.b.q: controller telemetry limit: 3600
18.04-61 9279.359: com.yourkit.b.q: snapshot_outer: done in 0 sec: null
18.04-61 9313.164: com.yourkit.k.my: error: com.yourkit.util.bs: There's no application running at localhost with profiler agent configured to listen on port 61219
or profiler agent is incompatible with current version of profiler
   at com.yourkit.api.ControllerImpl.transformException(a:278)
   at com.yourkit.api.ControllerImpl.makeRequest(a:293)
   at com.yourkit.api.ControllerImpl.makeRequest(a:534)
   at com.yourkit.api.ControllerImpl.startCpuProfiling(a:154)
   at com.yourkit.k.kt.a(a:92)
   at com.yourkit.k.jo.b(a:60)
   at com.yourkit.k.d.al.a(a:183)
   at com.yourkit.k.dz.run(a:16)
Caused by: java.net.SocketTimeoutException: Read timed out
   at java.net.SocketInputStream.socketRead0(Native Method)
   at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
   at java.net.SocketInputStream.read(SocketInputStream.java:171)
   at java.net.SocketInputStream.read(SocketInputStream.java:141)
   at com.yourkit.b.bj.read(a:21)
   at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
   at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
   at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
   at java.io.DataInputStream.readFully(DataInputStream.java:195)
   at java.io.DataInputStream.readLong(DataInputStream.java:416)
   at com.yourkit.runtime.Packet.readHeader(a:3)
   at com.yourkit.runtime.Packet.readHeader(a:51)
   at com.yourkit.runtime.Packet.readHeaderWithStandardResponse(a:17)
   at com.yourkit.api.ControllerImpl.readHeaderWithStandardResponse(a:10)
   at com.yourkit.api.ControllerImpl.access0(a:558)
   at com.yourkit.api.ControllerImpl.perform(a:8)
   at com.yourkit.api.ControllerImpl.makeRequest(a:163)
   ... 6 more

这件事如果有人能解释指导一下就好了

提前致谢!

我刚刚遇到了同样的奇怪行为。一天前,我设法远程分析了该应用程序,但今天不行。我通过 SSH 连接到远程 JVM 并且没有更改任何设置。

所以在 Yourkit 支持团队的帮助下,我终于能够解决我的问题。这是他们告诉我的:

Please try to increase socket timeouts of the profiler profiler UI by specifying -Dyk.controller.connect.timeout.ms= (default is 5000 ms = 5 s) and -Dyk.controller.read.timeout.ms= (default is 30000 ms = 30 s) in /.yjp/ui.ini

For example, set

-Dyk.controller.connect.timeout.ms=60000 -Dyk.controller.read.timeout.ms=60000

希望对遇到同样问题的其他人有所帮助。