Hi Tomas
I'm not sure exactly when or why this exception occurs but it seems to appear quite often in my user's logs in production. I think it happens when a view is closed and removed from the scene ?
The actual exception seems to be thrown by FX though in Node.screenToLocal. Is there some way to prevent this from happening ?
Edit: Ok, so I've been able to reproduce it now .... if a user selects some text and then clicks and drags it outside the control (preferably out of the app), then releases the click, and closes the view (like a tab) containing the RichText box then the NPE is repeatedly thrown over & over continuously.
It would seem then that drag "canceled" is not properly detected (in StyledTextAreaBehavior?) because the mouse click was released outside of the control ?
Thanks, regards
Jurgen
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
at javafx.scene.Node.screenToLocal(Unknown Source)
at org.fxmisc.richtext.skin.ParagraphBox.hit(ParagraphBox.java:134)
at org.fxmisc.richtext.skin.ParagraphBox.hit(ParagraphBox.java:129)
at org.fxmisc.richtext.skin.StyledTextAreaView.hit(StyledTextAreaVisual.java:361)
at org.fxmisc.richtext.skin.StyledTextAreaBehavior.dragTo(StyledTextAreaBehavior.java:477)
at org.reactfx.value.Val.ifPresent(Val.java:142)
at org.fxmisc.richtext.skin.StyledTextAreaBehavior.lambda$new$113(StyledTextAreaBehavior.java:255)
at org.reactfx.util.NonAccumulativeStreamNotifications.lambda$head$272(NotificationAccumulator.java:134)
at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:68)
at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:57)
at org.reactfx.ProperEventStream.emit(ProperEventStream.java:18)
at org.reactfx.util.NonAccumulativeStreamNotifications.lambda$head$272(NotificationAccumulator.java:134)
at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:68)
at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:57)
at org.reactfx.ProperEventStream.emit(ProperEventStream.java:18)
at org.reactfx.MappedStream.lambda$observeInputs$201(MappedStream.java:22)
at org.reactfx.util.NonAccumulativeStreamNotifications.lambda$head$272(NotificationAccumulator.java:134)
at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:68)
at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:57)
at org.reactfx.ProperEventStream.emit(ProperEventStream.java:18)
at org.reactfx.EmitBothOnEachStream.lambda$observeInputs$182(EmitBothOnEachStream.java:28)
at org.reactfx.util.NonAccumulativeStreamNotifications.lambda$head$272(NotificationAccumulator.java:134)
at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:68)
at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:57)
at org.reactfx.ProperEventStream.emit(ProperEventStream.java:18)
at org.reactfx.MappedStream.lambda$observeInputs$201(MappedStream.java:22)
at org.reactfx.util.NonAccumulativeStreamNotifications.lambda$head$272(NotificationAccumulator.java:134)
at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:68)
at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:57)
at org.reactfx.ProperEventStream.emit(ProperEventStream.java:18)
at org.reactfx.AccumulatingStream.lambda$observeInputs$157(AccumulatingStream.java:31)
at org.reactfx.util.NonAccumulativeStreamNotifications.lambda$head$272(NotificationAccumulator.java:134)
at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:68)
at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:57)
at org.reactfx.ProperEventStream.emit(ProperEventStream.java:18)
at org.reactfx.EventStreams$16$1.handle(EventStreams.java:340)
at javafx.animation.AnimationTimer$AnimationTimerReceiver.lambda$handle$485(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at javafx.animation.AnimationTimer$AnimationTimerReceiver.handle(Unknown Source)
at com.sun.scenario.animation.AbstractMasterTimer.timePulseImpl(Unknown Source)
at com.sun.scenario.animation.AbstractMasterTimer$MainLoop.run(Unknown Source)
at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(Unknown Source)
at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(Unknown Source)
at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$405(Unknown Source)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$149(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Hi Tomas
I'm not sure exactly when or why this exception occurs but it seems to appear quite often in my user's logs in production. I think it happens when a view is closed and removed from the scene ?
The actual exception seems to be thrown by FX though in Node.screenToLocal. Is there some way to prevent this from happening ?
Edit: Ok, so I've been able to reproduce it now .... if a user selects some text and then clicks and drags it outside the control (preferably out of the app), then releases the click, and closes the view (like a tab) containing the RichText box then the NPE is repeatedly thrown over & over continuously.
It would seem then that drag "canceled" is not properly detected (in StyledTextAreaBehavior?) because the mouse click was released outside of the control ?
Thanks, regards
Jurgen
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
at javafx.scene.Node.screenToLocal(Unknown Source)
at org.fxmisc.richtext.skin.ParagraphBox.hit(ParagraphBox.java:134)
at org.fxmisc.richtext.skin.ParagraphBox.hit(ParagraphBox.java:129)
at org.fxmisc.richtext.skin.StyledTextAreaView.hit(StyledTextAreaVisual.java:361)
at org.fxmisc.richtext.skin.StyledTextAreaBehavior.dragTo(StyledTextAreaBehavior.java:477)
at org.reactfx.value.Val.ifPresent(Val.java:142)
at org.fxmisc.richtext.skin.StyledTextAreaBehavior.lambda$new$113(StyledTextAreaBehavior.java:255)
at org.reactfx.util.NonAccumulativeStreamNotifications.lambda$head$272(NotificationAccumulator.java:134)
at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:68)
at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:57)
at org.reactfx.ProperEventStream.emit(ProperEventStream.java:18)
at org.reactfx.util.NonAccumulativeStreamNotifications.lambda$head$272(NotificationAccumulator.java:134)
at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:68)
at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:57)
at org.reactfx.ProperEventStream.emit(ProperEventStream.java:18)
at org.reactfx.MappedStream.lambda$observeInputs$201(MappedStream.java:22)
at org.reactfx.util.NonAccumulativeStreamNotifications.lambda$head$272(NotificationAccumulator.java:134)
at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:68)
at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:57)
at org.reactfx.ProperEventStream.emit(ProperEventStream.java:18)
at org.reactfx.EmitBothOnEachStream.lambda$observeInputs$182(EmitBothOnEachStream.java:28)
at org.reactfx.util.NonAccumulativeStreamNotifications.lambda$head$272(NotificationAccumulator.java:134)
at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:68)
at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:57)
at org.reactfx.ProperEventStream.emit(ProperEventStream.java:18)
at org.reactfx.MappedStream.lambda$observeInputs$201(MappedStream.java:22)
at org.reactfx.util.NonAccumulativeStreamNotifications.lambda$head$272(NotificationAccumulator.java:134)
at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:68)
at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:57)
at org.reactfx.ProperEventStream.emit(ProperEventStream.java:18)
at org.reactfx.AccumulatingStream.lambda$observeInputs$157(AccumulatingStream.java:31)
at org.reactfx.util.NonAccumulativeStreamNotifications.lambda$head$272(NotificationAccumulator.java:134)
at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:68)
at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:57)
at org.reactfx.ProperEventStream.emit(ProperEventStream.java:18)
at org.reactfx.EventStreams$16$1.handle(EventStreams.java:340)
at javafx.animation.AnimationTimer$AnimationTimerReceiver.lambda$handle$485(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at javafx.animation.AnimationTimer$AnimationTimerReceiver.handle(Unknown Source)
at com.sun.scenario.animation.AbstractMasterTimer.timePulseImpl(Unknown Source)
at com.sun.scenario.animation.AbstractMasterTimer$MainLoop.run(Unknown Source)
at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(Unknown Source)
at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(Unknown Source)
at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$405(Unknown Source)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$149(Unknown Source)
at java.lang.Thread.run(Unknown Source)