Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profiler Agent Error: Exception when trying to send response or command to client: UTFDataFormatException #81

Closed
nestorjb opened this issue Apr 26, 2018 · 7 comments
Assignees
Labels

Comments

@nestorjb
Copy link

Hi

I'm using the latest VisualVM 1.4.1 release on OpenJDK 1.8.0_131. When I try to run the Memory Profiling tool I get on the console of the Java process:

Profiler Agent: JNI OnLoad Initializing...
Profiler Agent: JNI OnLoad Initialized successfully
Profiler Agent: Waiting for connection on port 5140 (Protocol version: 18)
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:203)
at org.netbeans.lib.profiler.wireprotocol.WireIO.sendComplexResponse(WireIO.java:336)
at org.netbeans.lib.profiler.server.ProfilerServer.sendComplexResponseToClient(ProfilerServer.java:724)
at org.netbeans.lib.profiler.server.ProfilerServer.handleClientCommand(ProfilerServer.java:1614)
at org.netbeans.lib.profiler.server.ProfilerServer.listenToClient(ProfilerServer.java:1777)
at org.netbeans.lib.profiler.server.ProfilerServer.run(ProfilerServer.java:700)
Profiler Agent: Connection with agent closed
Profiler Agent: Connection with agent closed

Any ideas?

@thurka
Copy link
Member

thurka commented Apr 27, 2018

It looks like there are some strange characters on the classpath of your profiled application. Can you please create application snapshot from your application and attach it to this issue? The classpath should be visible in system properties tab.

@mirkoebert
Copy link

I have the same problem
Profiler Agent: Waiting for connection on port 5140 (Protocol version: 18)
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:203)
at org.netbeans.lib.profiler.wireprotocol.WireIO.sendComplexResponse(WireIO.java:336)
at org.netbeans.lib.profiler.server.ProfilerServer.sendComplexResponseToClient(ProfilerServer.java:724)
at org.netbeans.lib.profiler.server.ProfilerServer.handleClientCommand(ProfilerServer.java:1614)
at org.netbeans.lib.profiler.server.ProfilerServer.listenToClient(ProfilerServer.java:1777)
at org.netbeans.lib.profiler.server.ProfilerServer.run(ProfilerServer.java:700)
Profiler Agent: Connection with agent closed

From System properties:
java.version=1.8.0_152
java.vm.info=mixed mode
java.vm.name=Java HotSpot(TM) 64-Bit Server VM
java.vm.specification.name=Java Virtual Machine Specification
java.vm.specification.vendor=Oracle Corporation
java.vm.specification.version=1.8
java.vm.vendor=Oracle Corporation
java.vm.version=25.152-b16
line.separator=\n
....
os.arch=x86_64
os.name=Mac OS X
os.version=10.14.1
path.separator=:
socksNonProxyHosts=local|.local|169.254/16|.169.254/16
spring.beaninfo.ignore=true
sun.arch.data.model=64
sun.boot.class.path=/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/sunrsasign.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/classes
sun.boot.library.path=/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib

@thurka
Copy link
Member

thurka commented Nov 2, 2018

It looks like the problem is caused by extremely long classpath of your profiler application (system property java.class.path). Please take an Application Snapshot of the application you want to profile and attach it to this issue. This way we can verify this hypothesis.

@mirkoebert
Copy link

My problem is, thats not my application and I can't put a snapshot here, but I try a different app and hope to see the same problem.

@thurka
Copy link
Member

thurka commented Nov 13, 2018

My problem is, thats not my application and I can't put a snapshot here, but I try a different app and hope to see the same problem.

Any update?
BTW: I am not sure why the fact that it is not your application, prevents you to add an Application Snapshot to this issue.

@thurka thurka self-assigned this Nov 16, 2018
@thurka thurka added the bug label Nov 16, 2018
@thurka thurka changed the title Profiler Agent Error: Exception when trying to send response or command to client: Profiler Agent Error: Exception when trying to send response or command to client: UTFDataFormatException Nov 16, 2018
@flozano
Copy link

flozano commented Jan 8, 2020

I'm getting the same:

Profiler Agent: Established connection with the tool
Profiler Agent Error: Exception when trying to send response or command to client:
java.io.UTFDataFormatException
Profiler Agent: Connection with agent closed
Profiler Agent: Connection with agent closed
java.io.UTFDataFormatException
	at java.base/java.io.ObjectOutputStream$BlockDataOutputStream.writeUTF(ObjectOutputStream.java:2170)
	at java.base/java.io.ObjectOutputStream$BlockDataOutputStream.writeUTF(ObjectOutputStream.java:2013)
	at java.base/java.io.ObjectOutputStream.writeUTF(ObjectOutputStream.java:872)
	at org.netbeans.lib.profiler.wireprotocol.VMPropertiesResponse.writeObject(VMPropertiesResponse.java:203)
	at org.netbeans.lib.profiler.wireprotocol.WireIO.sendComplexResponse(WireIO.java:336)
	at org.netbeans.lib.profiler.server.ProfilerServer.sendComplexResponseToClient(ProfilerServer.java:724)
	at org.netbeans.lib.profiler.server.ProfilerServer.handleClientCommand(ProfilerServer.java:1614)
	at org.netbeans.lib.profiler.server.ProfilerServer.listenToClient(ProfilerServer.java:1777)
	at org.netbeans.lib.profiler.server.ProfilerServer.run(ProfilerServer.java:700)

and yes, my classpath is really big. I also can't put a snapshot, unfortunately...

@thurka
Copy link
Member

thurka commented Dec 22, 2020

Hopefully fixed in master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants