Skip to main content
gamedev.net
🔒 Locked

[java] SceneGraphIO: nullPointerException

Started by pudge 1 reply 250+ views
Original Post
pudge
pudge
I''m trying to read a simple SceneGraph using SceneGraphFileReader but i receive the following exception when trying to read a simple Morph node: NullPointerException at com.sun.j3d.utils.scenegraph.io.retained.SymbolTable.getJ3dNode(Symbo lTable.java:610) at com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d.MorphState.buil dGraph(MorphState.java:112) at com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d.GroupState.buil dGraph(GroupState.java:116) at com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d.GroupState.buil Any help would be much appreciated...
ManiacMac
ManiacMac
You get nullpointers when you try to use something that isnt. Such as I go like "JButton button;" then try to "setBounds()" or something on it without doing "button = new JButton("Button");" It could be that youre just trying to access something that isnt made yet, so just put what does try to (seems to be line 112-116 roughly), into an "if(suchandso != null){}" and see if that helps.

[edited by - ManiacMac on January 28, 2004 7:51:39 AM]
Aldacron
Aldacron
Since the exception is occuring in Java3D, then it is likely that you are requesting something that you haven''t set up. I don''t know what getJ3DNode is accessing, but obviously it is trying to access an object that doesn''t exist. What you need to do is look down the stack trace to find the first java3D method you called. Verify that the arguments to that method are not null. If all is well, then perhaps you are missing another step (i.e., maybe you need to call another method first).

Posting the complete stacktrace would help a bit more, as the little bit you did post doesn''t give enough information.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.