Profiler doesn't work with large classpath
- Dominant language
- Java
- Stars
- 3.1k
- Forks
- 935
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 17
Description
### Apache NetBeans version
Apache NetBeans 24
### What happened
Large project with gradle, connect profiler to application raises exception:
```
Profiler Agent Error: Exception when trying to send response or command to client:
java.io.UTFDataFormatException
java.io.UTFDataFormatException
at java.base/java.io.ObjectOutputStream$BlockDataOutputStream.writeUTF(ObjectOutputStream.java:2188)
at java.base/java.io.ObjectOutputStream$BlockDataOutputStream.writeUTF(ObjectOutputStream.java:2029)
at java.base/java.io.ObjectOutputStream.writeUTF(ObjectOutputStream.java:887)
at org.netbeans.lib.profiler.wireprotocol.VMPropertiesResponse.writeObject(VMPropertiesResponse.java:179)
at org.netbeans.lib.profiler.wireprotocol.WireIO.sendComplexResponse(WireIO.java:312)
at org.netbeans.lib.profiler.server.ProfilerServer.sendComplexResponseToClient(ProfilerServer.java:700)
at org.netbeans.lib.profiler.server.ProfilerServer.handleClientCommand(ProfilerServer.java:1590)
at org.netbeans.lib.profiler.server.ProfilerServer.listenToClient(ProfilerServer.java:1753)
at org.netbeans.lib.profiler.server.ProfilerServer.run(ProfilerServer.java:676)
```
It is same problem as https://github.com/oracle/visualvm/issues/81
### Language / Project Type / NetBeans Component
JVM Profiler
### How to reproduce
Large project with gradle, connect profiler to application raises exception:
```
Profiler Agent Error: Exception when trying to send response or command to client:
java.io.UTFDataFormatException
java.io.UTFDataFormatException
at java.base/java.io.ObjectOutputStream$BlockDataOutputStream.writeUTF(ObjectOutputStream.java:2188)
at java.base/java.io.ObjectOutputStream$BlockDataOutputStream.writeUTF(ObjectOutputStream.java:2029)
at java.base/java.io.ObjectOutputStream.writeUTF(ObjectOutputStream.java:887)
at org.netbeans.lib.profiler.wireprotocol.VMPropertiesResponse.writeObject(VMPropertiesResponse.java:179)
at org.netbeans.lib.profiler.wireprotocol.WireIO.sendComplexResponse(WireIO.java:312)
at org.netbeans.lib.profiler.server.ProfilerServer.sendComplexResponseToClient(ProfilerServer.java:700)
at org.netbeans.lib.profiler.server.ProfilerServer.handleClientCommand(ProfilerServer.java:1590)
at org.netbeans.lib.profiler.server.ProfilerServer.listenToClient(ProfilerServer.java:1753)
at org.netbeans.lib.profiler.server.ProfilerServer.run(ProfilerServer.java:676)
```
### Did this work correctly in an earlier version?
No / Don't know
### Operating System
Linux, Ubuntu 22.04
### JDK
21
### Apache NetBeans packaging
Apache NetBeans provided installer
### Anything else
_No response_
### Are you willing to submit a pull request?
Yes
Contributor guide
Research direction
Reproduce the failure with a large Gradle project, then inspect VMPropertiesResponse.java at writeObject and the surrounding WireIO.java and ProfilerServer.java call path. Trace how the large classpath is encoded and verify that connecting the profiler completes without the reported UTFDataFormatException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- performance, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100