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

NoClassDefFoundError: org/lwjglx/debug/RT #31

Closed
tsmock opened this issue Mar 31, 2022 · 1 comment · Fixed by #32
Closed

NoClassDefFoundError: org/lwjglx/debug/RT #31

tsmock opened this issue Mar 31, 2022 · 1 comment · Fixed by #32

Comments

@tsmock
Copy link
Contributor

tsmock commented Mar 31, 2022

I’m trying to troubleshoot a LWJGL application using lwjglx-debug.

When running the application, I get a java.lang.NoClassDefFoundError: org/lwjglx/debug/RT exception.
Command line I’m using to run the application: JAVA_HOME="$(/usr/libexec/java_home -v 1.8)" java -javaagent:"${HOME}/Downloads/lwjglx-debug-1.0.0.jar" -cp "${HOME}/workspace/josm/core/dist/josm-custom.jar:${HOME}/.ivy2/cache/org.lwjgl/lwjgl/jars/lwjgl-3.3.1.jar:${HOME}/Downloads/lwjglx-debug-1.0.0.jar" org.openstreetmap.josm.gui.MainApplication
I’ve also tried some variations (with and without the lwjglx-debug-1.0.0.jar in classpath, an uber jar with all the LWJGL jars packed into it, Java 8 and Java 11)

Source code locations:

System information:

  • System: MacBook Pro (15-inch, 2017)
  • OS: Mac OS X 12.3
  • Java: 8, 11, 17 (all are Eclipse Temurin distributions)
  • GPU: Radeon Pro 555 2GB, Intel ID Graphics 630 1536 MB

Simple bash script to reproduce (note: you will be swamped with exceptions, and this does not download the plugin files that I actually want to debug)

$ curl -LO https://josm.openstreetmap.de/josm-tested.jar
$ curl -LO https://build.lwjgl.org/addons/lwjglx-debug/lwjglx-debug-1.0.0.jar
$ curl -LO https://build.lwjgl.org/release/latest/bin/lwjgl/lwjgl.jar
$ java -javaagent:"$(pwd)/lwjglx-debug-1.0.0.jar" -cp "$(pwd)/lwjgl.jar:$(pwd)/josm-tested.jar" org.openstreetmap.josm.gui.MainApplication

Additional notes:
adding =t to the agent doesn’t make a difference
I have to use the workaround from #29 (I'm constrained to Swing for UI).
Everything works properly in a Fedora 35 Silverblue VM (with java-1.8.0-openjdk layered on top).

Stacktrace:

2022-03-31 13:42:30.787 SEVERE: Handled by bug report queue: java.lang.NoClassDefFoundError: org/lwjglx/debug/RT
java.lang.NoClassDefFoundError: org/lwjglx/debug/RT
	at apple.laf.JRSUIControl.loadBufferWithChanges(JRSUIControl.java:140)
	at apple.laf.JRSUIControl.paintImage(JRSUIControl.java:219)
	at apple.laf.JRSUIControl.paint(JRSUIControl.java:208)
	at com.apple.laf.AquaPainter$AquaSingleImagePainter.createImage(AquaPainter.java:200)
	at com.apple.laf.AquaPainter$AquaSingleImagePainter.lambda$paintFromSingleCachedImage$0(AquaPainter.java:178)
	at sun.awt.image.MultiResolutionCachedImage.getResolutionVariant(MultiResolutionCachedImage.java:66)
	at sun.awt.image.MultiResolutionCachedImage.getBaseImage(MultiResolutionCachedImage.java:106)
	at sun.awt.image.AbstractMultiResolutionImage.getWidth(AbstractMultiResolutionImage.java:82)
	at sun.awt.image.MultiResolutionCachedImage.getWidth(MultiResolutionCachedImage.java:89)
	at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:3269)
	at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:3221)
	at com.apple.laf.AquaPainter$AquaSingleImagePainter.paintFromSingleCachedImage(AquaPainter.java:186)
	at com.apple.laf.AquaPainter$AquaSingleImagePainter.paint(AquaPainter.java:141)
	at com.apple.laf.AquaPainter.paint(AquaPainter.java:90)
	at com.apple.laf.AquaProgressBarUI.paint(AquaProgressBarUI.java:187)
	at com.apple.laf.AquaProgressBarUI.paint(AquaProgressBarUI.java:168)
	at javax.swing.plaf.ComponentUI.update(ComponentUI.java:161)
	at javax.swing.JComponent.paintComponent(JComponent.java:780)
	at javax.swing.JComponent.paint(JComponent.java:1056)
	at javax.swing.JComponent.paintChildren(JComponent.java:889)
	at javax.swing.JComponent.paint(JComponent.java:1065)
	at javax.swing.JComponent.paintChildren(JComponent.java:889)
	at javax.swing.JComponent.paint(JComponent.java:1065)
	at javax.swing.JComponent.paintChildren(JComponent.java:889)
	at javax.swing.JComponent.paint(JComponent.java:1065)
	at javax.swing.JComponent.paintChildren(JComponent.java:889)
	at javax.swing.JComponent.paint(JComponent.java:1065)
	at javax.swing.JLayeredPane.paint(JLayeredPane.java:586)
	at javax.swing.JComponent.paintChildren(JComponent.java:889)
	at javax.swing.JComponent.paintToOffscreen(JComponent.java:5217)
	at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1579)
	at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1502)
	at javax.swing.RepaintManager.paint(RepaintManager.java:1272)
	at javax.swing.JComponent.paint(JComponent.java:1042)
	at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:39)
	at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:79)
	at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:116)
	at java.awt.Container.paint(Container.java:1978)
	at java.awt.Window.paint(Window.java:3906)
	at javax.swing.RepaintManager$4.run(RepaintManager.java:842)
	at javax.swing.RepaintManager$4.run(RepaintManager.java:814)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:814)
	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:789)
	at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:738)
	at javax.swing.RepaintManager.access$1200(RepaintManager.java:64)
	at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1732)
	at java.awt.event.InvocationEvent.dispatch$$$capture(InvocationEvent.java:311)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
@tsmock
Copy link
Contributor Author

tsmock commented Apr 8, 2022

Workaround for people who find this issue:

diff --git a/src/org/lwjglx/debug/Agent.java b/src/org/lwjglx/debug/Agent.java
index 42cbe08..eac5577 100644
--- a/src/org/lwjglx/debug/Agent.java
+++ b/src/org/lwjglx/debug/Agent.java
@@ -112,6 +112,7 @@ public class Agent implements ClassFileTransformer, Opcodes {
     }
 
     private static final List<String> excludedPackagePrefixes = Arrays.asList(
+               "apple/laf/JRSUI",
                "com.ecwid.consul/",
                "com/sun/",
                "io/netty/",

(Also, for those reading this, the minimum Java compile requirement is Java 13).

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

Successfully merging a pull request may close this issue.

1 participant