尝试将jvisualvm连接到eclipse本地进程时出现UTFDataFormatException

时间:2018-04-03 07:26:18

标签: java exception profiling sampling jvisualvm

我正在尝试分析本地java应用程序。它通过Eclipse运行。我正在使用jvisualvm对应我的jdk安装。它会在启动时看到进程,它可以示例而没有问题但是当我尝试启动 profiler 时,eclipse控制台会显示此错误:

Profiler Agent: Waiting for connection on port 5140 (Protocol version: 15)
Profiler Agent: Established connection with the tool
Profiler Agent Error: Exception when trying to send response or command to client:
java.io.UTFDataFormatException
java.io.UTFDataFormatException
    at java.io.ObjectOutputStream$BlockDataOutputStream.writeUTF(ObjectOutputStream.java:2164)
    at java.io.ObjectOutputStream$BlockDataOutputStream.writeUTF(ObjectOutputStream.java:2007)
    at java.io.ObjectOutputStream.writeUTF(ObjectOutputStream.java:869)
    at org.netbeans.lib.profiler.wireprotocol.VMPropertiesResponse.writeObject(VMPropertiesResponse.java:156)
    at org.netbeans.lib.profiler.wireprotocol.WireIO.sendComplexResponse(WireIO.java:286)
    at org.netbeans.lib.profiler.server.ProfilerServer.sendComplexResponseToClient(ProfilerServer.java:678)
    at org.netbeans.lib.profiler.server.ProfilerServer.handleClientCommand(ProfilerServer.java:1559)
    at org.netbeans.lib.profiler.server.ProfilerServer.listenToClient(ProfilerServer.java:1698)
    at org.netbeans.lib.profiler.server.ProfilerServer.run(ProfilerServer.java:655)
Profiler Agent: Connection with agent closed
Profiler Agent: Connection with agent closed

查看代码时,writeUTF函数会在响应太长时抛出此异常......

 void writeUTF(String s, long utflen) throws IOException {
            if (utflen > 0xFFFFL) {
                throw new UTFDataFormatException();
            }
...
}

有人会对这里发生的事情有所了解吗?

感谢。

0 个答案:

没有答案