Unknown error

Hello.

I’ve got an error that occurs on its own mood.

Simply, when I do this

[java]

bulletState.getPhysicsSpace().remove(this);

[/java]



its exception is this

[java]

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

java.lang.NullPointerException

at java.util.concurrent.ConcurrentHashMap.remove(Unknown Source)

at com.jme3.bullet.PhysicsSpace.removeGhostNode(PhysicsSpace.java:588)

at com.jme3.bullet.PhysicsSpace.remove(PhysicsSpace.java:490)

at battle.gameplay.Tank.setVisible(Tank.java:111)

at battle.gameplay.Tank.dead(Tank.java:252)

at battle.players.ServerPlayer.update(ServerPlayer.java:73)

at battle.Battle.simpleUpdate(Battle.java:173)

at com.jme3.app.SimpleApplication.update(SimpleApplication.java:208)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:144)

at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:133)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:198)

at java.lang.Thread.run(Unknown Source)

[/java]



This code in class Tank that extends PhysicsGhostNode.

What are possible reasons of this happening?

Please help.

What do you mean by “on its own mood” if its happening randomly then are you sure you are doing this from the physics thread? Do you use detached physics maybe?