NullPointer in TreeDom localetoRoot
Original report by Marcel Vo (Bitbucket: kogs, GitHub: kogs).
I tried to test the new Threedom funktions. I started an JavaFx application and in the console ony this error is shown:
#!java
java.lang.NullPointerException
at org.scenicview.view.threedom.Tile3D.localetoRoot(Tile3D.java:148)
at org.scenicview.view.threedom.Tile3D.<init>(Tile3D.java:60)
at org.scenicview.view.threedom.ThreeDOM.nodeToTile3D(ThreeDOM.java:292)
at org.scenicview.view.threedom.ThreeDOM.from2Dto3D(ThreeDOM.java:262)
at org.scenicview.view.threedom.ThreeDOM.init3D(ThreeDOM.java:249)
at org.scenicview.view.threedom.ThreeDOM._reload(ThreeDOM.java:339)
at org.scenicview.view.threedom.ThreeDOM.reload(ThreeDOM.java:334)
at org.scenicview.view.tabs.ThreeDOMTab.reload(ThreeDOMTab.java:110)
at org.scenicview.view.ScenicViewGui.doDispatchEvent(ScenicViewGui.java:1076)
at org.scenicview.view.ScenicViewGui.lambda$new$35(ScenicViewGui.java:226)
at org.scenicview.view.ScenicViewGui$$Lambda$176/1953352189.handle(Unknown Source)
at com.sun.scenario.animation.shared.TimelineClipCore.visitKeyFrame(Unknown Source)
at com.sun.scenario.animation.shared.TimelineClipCore.playTo(Unknown Source)
at javafx.animation.Timeline.impl_playTo(Unknown Source)
at javafx.animation.AnimationAccessorImpl.playTo(Unknown Source)
at com.sun.scenario.animation.shared.InfiniteClipEnvelope.timePulse(Unknown Source)
at javafx.animation.Animation.impl_timePulse(Unknown Source)
at javafx.animation.Animation$1.lambda$timePulse$25(Unknown Source)
at javafx.animation.Animation$1$$Lambda$418/1118514211.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at javafx.animation.Animation$1.timePulse(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$363(Unknown Source)
at com.sun.javafx.tk.quantum.QuantumToolkit$$Lambda$41/1149485092.run(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$141(Unknown Source)
at com.sun.glass.ui.win.WinApplication$$Lambda$37/96639997.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Original comment by Jonathan Giles (Bitbucket: JonathanGiles, GitHub: JonathanGiles).
Another option is to add additional API in to SVNode that can return serialized data back to the SV app for the things you need - node bounds, etc.
Original comment by Jonathan Giles (Bitbucket: JonathanGiles, GitHub: JonathanGiles).
The basic problem is that getting the Node back to the Scenic View app is not always possible. It might be necessary to change how it works so that the FXConnector component (which is what is injected inside the running application) instead pops open a new window to display the 3D view, rather than try to relay it back to Scenic View where it shows inside the main application.
Original comment by Jonathan Giles (Bitbucket: JonathanGiles, GitHub: JonathanGiles).
Because SVRemoteNodeAdapter is run within the users application, and it cannot serialize the Node back into Scenic View. SVRealNodeAdapter is run inside Scenic View when the agent approach isn't being used, so we have direct access to the Node.
Original comment by arnaud nouard (Bitbucket: insideFX, GitHub: Unknown).
In SVRemoteNodeAdapter you are right! But not SVRealNodeAdapter ;-). Do you know why SVRemoteNodeAdapter doesn't keep the node like SVRealNodeAdapter does? Thanks.
Original comment by Jonathan Giles (Bitbucket: JonathanGiles, GitHub: JonathanGiles).
The thing is - this method has always returned null! :-)
Original comment by arnaud nouard (Bitbucket: insideFX, GitHub: Unknown).
Ok, I got it, SVRemoteNodeAdapter now returns:
#!java
@Override @Deprecated public Node getImpl() {
return **null**;
}
Jonathan, the SVRemoteNodeAdapter now only keeps the id but no longer the Node itself. From here, how can I access to the Nodes from their SVNode? Any helper?
Thanks
Original comment by Marcel Vo (Bitbucket: kogs, GitHub: kogs).
On monday i will try to repeuduce the exception and report you how to couse it.
Original comment by Jonathan Giles (Bitbucket: JonathanGiles, GitHub: JonathanGiles).
How are you running Scenic View? I am running it using just 'gradle run' from the command line, and still run into this issue. I only have one stage in my test application.
Original comment by Jonathan Giles (Bitbucket: JonathanGiles, GitHub: JonathanGiles).
accidentally closed.
Original comment by arnaud nouard (Bitbucket: insideFX, GitHub: Unknown).
Hi, Traces show that everything seem to be well initialized. Then a NODE_ADDED event occurrs in ScenicViewGui and the root node is no longer valid. The previous SVNode root now returns null on SVNode.getImpl().
I see one possible root cause: Does your application use several Stages? Could you confirm?
On my side I found and fixed an issue related to that use case. Thanks
Original comment by Jonathan Giles (Bitbucket: JonathanGiles, GitHub: JonathanGiles).
I have emailed Arnaud to see if he can help to resolve this issue.