SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]

I have seen exception like this in other topics, but generally nobody have explained how or what is reason for this exception. I’m working on simulation and my code is in many classes now. I don’t even know where the game stopped. Exception stack doesn’t point nowhere at my code. Does anybody know what should I look in my code?

INFO: Lwjgl 2.9.0 context running on thread LWJGL Renderer Thread
Apr 08, 2014 11:15:05 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: Adapter: igdumd64
Apr 08, 2014 11:15:05 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: Driver Version: 9.17.10.2932
Apr 08, 2014 11:15:05 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: Vendor: NVIDIA Corporation
Apr 08, 2014 11:15:05 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: OpenGL Version: 4.2.0
Apr 08, 2014 11:15:05 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: Renderer: GeForce GT 520MX/PCIe/SSE2
Apr 08, 2014 11:15:05 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: GLSL Ver: 4.20 NVIDIA via Cg compiler
Apr 08, 2014 11:15:06 PM com.jme3.asset.AssetConfig loadText
WARNING: Cannot find loader com.jme3.scene.plugins.blender.BlenderModelLoader
Apr 08, 2014 11:15:06 PM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
INFO: Audio Device: OpenAL Soft
Apr 08, 2014 11:15:06 PM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
INFO: Audio Vendor: OpenAL Community
Apr 08, 2014 11:15:06 PM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
INFO: Audio Renderer: OpenAL Soft
Apr 08, 2014 11:15:06 PM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
INFO: Audio Version: 1.1 ALSOFT 1.15.1
Apr 08, 2014 11:15:06 PM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
INFO: AudioRenderer supports 64 channels
Apr 08, 2014 11:15:06 PM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
INFO: Audio effect extension version: 1.0
Apr 08, 2014 11:15:06 PM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
INFO: Audio max auxilary sends: 4
Apr 08, 2014 11:15:06 PM com.jme3.app.Application handleError
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.NullPointerException
at com.jme3.scene.control.BillboardControl.rotateScreenAligned(BillboardControl.java:197)
at com.jme3.scene.control.BillboardControl.rotateBillboard(BillboardControl.java:133)
at com.jme3.scene.control.BillboardControl.controlRender(BillboardControl.java:103)
at com.jme3.scene.control.AbstractControl.render(AbstractControl.java:119)
at com.jme3.scene.Spatial.runControlRender(Spatial.java:590)
at com.jme3.renderer.RenderManager.renderSubScene(RenderManager.java:655)
at com.jme3.renderer.RenderManager.renderSubScene(RenderManager.java:665)
at com.jme3.renderer.RenderManager.renderSubScene(RenderManager.java:665)
at com.jme3.renderer.RenderManager.renderScene(RenderManager.java:640)
at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:974)
at com.jme3.renderer.RenderManager.render(RenderManager.java:1029)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:252)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:151)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:185)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:228)
at java.lang.Thread.run(Thread.java:722)

NullPointerExceptions can happen for any of 1000000 reasons and are generally the easiest exception to sort out for Java developers. Thanks for including the full stack trace.

If you’d clicked on the line number in the stack trace it probably could have taken you to the source but it was only two clicks away for me… so I looked it up.

Seems like your billboard control is somehow attached to a spatial with no parent. Have you done something crazy like attach it to a root node or something?

1 Like

That is exactly what I have done. I have done games with attaching them to rootNode like this, but it didn’t complain. What could I have done now to get this exception, and what is good practice to avoid exception like this?

The exception indicates that you’ve attached a BillboardControl to the actual rootNode. I can’t see why one would ever want to do that. Your whole scene would be billboarded then. Might as well just not even move the camera.