GRIP icon indicating copy to clipboard operation
GRIP copied to clipboard

Generate Code Feature Crashes

Open iyeravyukt opened this issue 5 months ago • 5 comments

Every single time i try to generate the code for a certain image after applying a hsl feature, i try to switch it to python and it crashes with the error:

Thread[JavaFX Application Thread,5,main] threw an exception

Stack Trace:

java.lang.NullPointerException
	at com.sun.javafx.scene.control.skin.ComboBoxListViewSkin.queryAccessibleAttribute(ComboBoxListViewSkin.java:593)
	at javafx.scene.control.Control.queryAccessibleAttribute(Control.java:917)
	at javafx.scene.control.ComboBoxBase.queryAccessibleAttribute(ComboBoxBase.java:459)
	at javafx.scene.control.ComboBox.queryAccessibleAttribute(ComboBox.java:616)
	at javafx.scene.Node$19.getAttribute(Node.java:9646)
	at com.sun.glass.ui.Accessible$GetAttribute.run(Accessible.java:142)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.glass.ui.Accessible.lambda$getAttribute$4(Accessible.java:169)
	at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389)
	at com.sun.glass.ui.Accessible.getAttribute(Accessible.java:166)
	at com.sun.glass.ui.mac.MacAccessible.accessibilityAttributeValue(MacAccessible.java:1261)
	at com.sun.glass.ui.mac.MacApplication._enterNestedEventLoopImpl(Native Method)
	at com.sun.glass.ui.mac.MacApplication._enterNestedEventLoop(MacApplication.java:109)
	at com.sun.glass.ui.Application.enterNestedEventLoop(Application.java:511)
	at com.sun.glass.ui.EventLoop.enter(EventLoop.java:107)
	at com.sun.javafx.tk.quantum.QuantumToolkit.enterNestedEventLoop(QuantumToolkit.java:583)
	at javafx.stage.Stage.showAndWait(Stage.java:474)
	at javafx.scene.control.HeavyweightDialog.showAndWait(HeavyweightDialog.java:162)
	at javafx.scene.control.Dialog.showAndWait(Dialog.java:341)
	at edu.wpi.grip.ui.MainWindowController.generate(MainWindowController.java:328)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
	at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275)
	at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1771)
	at javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1657)
	at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
	at javafx.event.Event.fireEvent(Event.java:198)
	at javafx.scene.control.MenuItem.fire(MenuItem.java:462)
	at com.sun.javafx.scene.control.ControlAcceleratorSupport.lambda$doAcceleratorInstall$12(ControlAcceleratorSupport.java:165)
	at com.sun.javafx.scene.KeyboardShortcutsHandler.processAccelerators(KeyboardShortcutsHandler.java:347)
	at com.sun.javafx.scene.KeyboardShortcutsHandler.dispatchBubblingEvent(KeyboardShortcutsHandler.java:163)
	at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
	at javafx.event.Event.fireEvent(Event.java:198)
	at javafx.scene.Scene$KeyHandler.process(Scene.java:3964)
	at javafx.scene.Scene$KeyHandler.access$1800(Scene.java:3910)
	at javafx.scene.Scene.impl_processKeyEvent(Scene.java:2040)
	at javafx.scene.Scene$ScenePeerListener.keyEvent(Scene.java:2501)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler$KeyEventNotification.run(GlassViewEventHandler.java:216)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler$KeyEventNotification.run(GlassViewEventHandler.java:148)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleKeyEvent$353(GlassViewEventHandler.java:247)
	at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleKeyEvent(GlassViewEventHandler.java:246)
	at com.sun.glass.ui.View.handleKeyEvent(View.java:546)
	at com.sun.glass.ui.View.notifyKey(View.java:966)

System Info:

Property Name Property
GRIP Version v1.5.2
java.version 1.8.0_92
javafx.version 8.0.92
os.name Mac OS X
os.version 10.16
os.arch x86_64

Please let me know how I can fix this. Thanks!

iyeravyukt avatar Jul 23 '25 20:07 iyeravyukt

Unfortunately, this project hasn't been maintained in a while and I personally have no idea what's going on here. I haven't touched this code in years. @SamCarlberg any thoughts?

JLLeitschuh avatar Jul 23 '25 21:07 JLLeitschuh

Same here. From the stacktrace, it looks like the mac runtime wants to read some attribute from the language combobox, but something internal there is hitting a NPE. Maybe it's a bug in JavaFX on macOS; there's nothing we can really do about there

SamCarlberg avatar Jul 23 '25 23:07 SamCarlberg

A few years ago there was a javafx bug that was broken on newer releases of macos. There was a fix released in newer versions of javafx, but that would require updating which is unlikely to occur.

ThadHouse avatar Jul 23 '25 23:07 ThadHouse

https://bugs.openjdk.org/browse/JDK-8184270

Seems like it was fixed? But only in java 10? https://hg.openjdk.org/openjfx/10-dev/rt/rev/b29e458bb99c

ArchdukeTim avatar Jul 24 '25 03:07 ArchdukeTim

@iyeravyukt Looks like you're running into this javafx bug: https://bugs.openjdk.org/browse/JDK-8184270

As Jonathan said, GRIP isn't actively maintained any more. Using GRIP on a different operating system (windows, linux) should avoid this issue.

SamCarlberg avatar Jul 24 '25 03:07 SamCarlberg