I’m having this problem intermittently when attempting to switch to an app to fullscreen.
The only results for this error while searching google was the svn code in NativeObjectManager.java so I guess it must not be a common error…
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main] java.lang.IllegalArgumentException: This NativeObject is not registered in this NativeObjectManager at com.jme3.util.NativeObjectManager.deleteNativeObject(NativeObjectManager.java:136) at com.jme3.util.NativeObjectManager.deleteUnused(NativeObjectManager.java:188) at com.jme3.renderer.lwjgl.LwjglRenderer.onFrame(LwjglRenderer.java:759) at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:187) 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:724)
I’ve been struggling with this for hours attempting to find a way to reproduce this error consistently… but to no success.
Unfortunately I’ve also been unable to reproduce these results in a simple test case. Really, the only difference there could be is that within my game there is a few Picture spatials attached to the guiNode… so I’m not sure why I can’t reproduce it outside of my game (I’m not using an old .dll or something - already checked that).
This is the bare minimum amount of code (within my game) that I can use to reproduce the error… (but as mentioned, outside of my game I can’t reproduce it with this)
I MUST call toggleSettingsMenu(false) and I believe that I also need to turn AA on (very odd behavior… my best guess is some sort of threading issue??)
[java]
toggleSettingsMenu(false);
game.settings.setSamples(4);
game.settings.setFullscreen(true);
game.setSettings(game.settings);
game.restart();
[/java]
toggleSettingsMenu simply repositions and hides some spatials:
[java]
private void toggleSettingsMenu(boolean active){
if(active){
settingsMenu.setCullHint(CullHint.Never);
titleButton1.setText(“Apply”);
titleButton2.setText(“Cancel”);
titleButton1.setLocalTranslation((game.settings.getWidth() / 2) - (titleButton1.getWidth() / 2) - 80, (game.settings.getHeight() / 2) - 180, -1);
titleSeparator1.setLocalTranslation((game.settings.getWidth() / 2) - (titleSeparator1.getWidth() / 2) - 5, (game.settings.getHeight() / 2) - 180, -1);
titleButton2.setLocalTranslation((game.settings.getWidth() / 2) - (titleButton2.getWidth() / 2) + 80, (game.settings.getHeight() / 2) - 180, -1);
titleButton3.setCullHint(CullHint.Always);
titleSeparator2.setCullHint(CullHint.Always);
} else {
settingsMenu.setCullHint(CullHint.Always);
titleButton1.setText(“Start”);
titleButton2.setText(“Settings”);
titleButton1.setLocalTranslation((game.settings.getWidth() / 2) - (titleButton1.getWidth() / 2) - 160, (game.settings.getHeight() / 2) - 180, -1);
titleSeparator1.setLocalTranslation((game.settings.getWidth() / 2) - (titleSeparator1.getWidth() / 2) - 95, (game.settings.getHeight() / 2) - 180, -1);
titleButton2.setLocalTranslation((game.settings.getWidth() / 2) - (titleButton2.getWidth() / 2), (game.settings.getHeight() / 2) - 180, -1);
titleButton3.setCullHint(CullHint.Never);
titleSeparator2.setCullHint(CullHint.Never);
}
}
[/java]
The code is called within an AppState (the title menu for my game) I add a KeyTrigger mapping and execute the code from the ActionListener.
I understand that it is problematic that I can not reproduce this error consistently (or put together a small test app) and it doesn’t help you guys much… but I’ve been at this for hours and don’t really even have a lead as to what t he problem might be. So I’m hoping that somebody has some ideas as to what might cause this type of error (e.g. not being thread-safe or something)
If this is not enough information for somebody to help me then I’ll have to just keep testing and will post any new information here.