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

Thread dumps don't work in profiler #8039

Open
namedgraph opened this issue Dec 11, 2024 · 2 comments
Open

Thread dumps don't work in profiler #8039

namedgraph opened this issue Dec 11, 2024 · 2 comments
Labels
Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) kind:bug Bug report or fix needs:triage Requires attention from one of the committers profiler

Comments

@namedgraph
Copy link

namedgraph commented Dec 11, 2024

Apache NetBeans version

Apache NetBeans 23

What happened

Clicked "Take thread dump from the profiled process" button, got this error:

Exception in thread "*** Profiler Agent Communication Thread" java.lang.RuntimeException: java.lang.IllegalAccessException: class org.netbeans.lib.profiler.server.system.ThreadDump cannot access class sun.management.ThreadInfoCompositeData (in module java.management) because module java.management does not export sun.management to unnamed module @6b884d57
  at org.netbeans.lib.profiler.server.system.ThreadDump.toCompositeData(ThreadDump.java:85)
  at org.netbeans.lib.profiler.server.system.ThreadDump.takeThreadDump(ThreadDump.java:71)
  at org.netbeans.lib.profiler.server.ProfilerServer.handleClientCommand(ProfilerServer.java:1664)
  at org.netbeans.lib.profiler.server.ProfilerServer.listenToClient(ProfilerServer.java:1753)
  at org.netbeans.lib.profiler.server.ProfilerServer.run(ProfilerServer.java:676)
Caused by: java.lang.IllegalAccessException: class org.netbeans.lib.profiler.server.system.ThreadDump cannot access class sun.management.ThreadInfoCompositeData (in module java.management) because module java.management does not export sun.management to unnamed module @6b884d57
  at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:392)
  at java.base/java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:674)
  at java.base/java.lang.reflect.Method.invoke(Method.java:560)
  at org.netbeans.lib.profiler.server.system.ThreadDump.toCompositeData(ThreadDump.java:83)
  ... 4 more

Tried with NetBeans 18 as well, same result.

Language / Project Type / NetBeans Component

Java Maven project

How to reproduce

  1. Generated the calibration pack for Linux x64 on Netbeans Windows 10
  2. Placed the pack into an application running on Docker with a WSL 2 Ubuntu backend
  3. Profiler successfully connected to the application on localhost
  4. Tried to take a thread dump

Did this work correctly in an earlier version?

Apache NetBeans 16 or earlier

Operating System

WSL 2 Ubuntu / Win 10

JDK

17

Apache NetBeans packaging

Apache NetBeans provided installer

Anything else

No response

Are you willing to submit a pull request?

No

@namedgraph namedgraph added kind:bug Bug report or fix needs:triage Requires attention from one of the committers labels Dec 11, 2024
@namedgraph
Copy link
Author

This is from the webapp's Docker container that I was trying to take a thread dump of:

openjdk 17.0.5 2022-10-18
OpenJDK Runtime Environment Temurin-17.0.5+8 (build 17.0.5+8)
OpenJDK 64-Bit Server VM Temurin-17.0.5+8 (build 17.0.5+8, mixed mode, sharing)

@JoachimRohde
Copy link

I assume this is related to #7323

@mbien mbien added Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) profiler labels Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) kind:bug Bug report or fix needs:triage Requires attention from one of the committers profiler
Projects
None yet
Development

No branches or pull requests

3 participants