Correct Shutdown

Hello,



does someone know which methods I have to call and in which order to perform a correct shutdown? I use JME in Netbeans platform and want to close it in the closing method of an installer…

If you don’t know what this is, the method sequence would still help me a lot.

[java]



@Override

public boolean closing() {

super.closing();

LOG.info(“Shutting down JME3 renderer…”);//NOI18N

if (PraxitelesApplication.findInstance().getCanvas() != null) {

LOG.info(“Disable canvas…”);//NOI18N

PraxitelesApplication.findInstance().getCanvas().setEnabled(false);

if (PraxitelesApplication.findInstance().getJMEObject() != null) {

LOG.info(“Stop application…”);//NOI18N

PraxitelesApplication.findInstance().getJMEObject().stop(true);

LOG.info(“Destroy application…”);//NOI18N

PraxitelesApplication.findInstance().getJMEObject().destroy();

}

}

return true;

}



[/java]



Thanks.



Regards,

Equi

application.stop();

Hello,



thanks for fast reply.

This was also my first thought and I already tried this. The error that occurs is…



[java]

java.lang.NullPointerException

at sun.java2d.ScreenUpdateManager.createScreenSurface(ScreenUpdateManager.java:86)

at sun.java2d.d3d.D3DScreenUpdateManager.createScreenSurface(D3DScreenUpdateManager.java:161)

at sun.awt.windows.WComponentPeer.createScreenSurface(WComponentPeer.java:424)

at sun.awt.windows.WComponentPeer.replaceSurfaceData(WComponentPeer.java:448)

at sun.awt.windows.WComponentPeer.replaceSurfaceData(WComponentPeer.java:416)

at sun.awt.windows.WComponentPeer.updateGraphicsData(WComponentPeer.java:504)

at java.awt.Component.updateGraphicsData(Component.java:1165)

at java.awt.Container.updateGraphicsData(Container.java:1151)

at java.awt.Container.updateGraphicsData(Container.java:1151)

at java.awt.Container.updateGraphicsData(Container.java:1151)

at java.awt.Container.updateGraphicsData(Container.java:1151)

at java.awt.Container.updateGraphicsData(Container.java:1151)

at java.awt.Container.updateGraphicsData(Container.java:1151)

at java.awt.Container.updateGraphicsData(Container.java:1151)

at java.awt.Container.updateGraphicsData(Container.java:1151)

at java.awt.Container.updateGraphicsData(Container.java:1151)

at java.awt.Container.updateGraphicsData(Container.java:1151)

at java.awt.Container.updateGraphicsData(Container.java:1151)

at java.awt.Component.setGraphicsConfiguration(Component.java:1151)

at java.awt.Container.remove(Container.java:1213)

at java.awt.Container.remove(Container.java:1257)

at org.netbeans.core.windows.view.ui.DesktopImpl.setViewComponent(DesktopImpl.java:164)

at org.netbeans.core.windows.view.ui.DesktopImpl.setSplitRoot(DesktopImpl.java:144)

at org.netbeans.core.windows.view.ViewHierarchy.setSplitRootIntoDesktop(ViewHierarchy.java:649)

at org.netbeans.core.windows.view.ViewHierarchy.releaseAll(ViewHierarchy.java:564)

at org.netbeans.core.windows.view.DefaultView.hideWindowSystem(DefaultView.java:613)

at org.netbeans.core.windows.view.DefaultView.windowSystemVisibilityChanged(DefaultView.java:503)

at org.netbeans.core.windows.view.DefaultView.changeGUI(DefaultView.java:183)

at org.netbeans.core.windows.ViewRequestor.dispatchRequest(ViewRequestor.java:272)

at org.netbeans.core.windows.ViewRequestor.processVisibilityRequest(ViewRequestor.java:261)

at org.netbeans.core.windows.ViewRequestor.postVisibilityRequest(ViewRequestor.java:198)

at org.netbeans.core.windows.ViewRequestor.scheduleRequest(ViewRequestor.java:120)

at org.netbeans.core.windows.Central.setVisible(Central.java:122)

at org.netbeans.core.windows.WindowManagerImpl.setVisible(WindowManagerImpl.java:799)

at org.netbeans.core.windows.WindowSystemImpl.hide(WindowSystemImpl.java:92)

at org.netbeans.core.NbLifecycleManager$ExitActions.run(NbLifecycleManager.java:130)

at org.netbeans.core.startup.ModuleSystem$2.run(ModuleSystem.java:311)

[catch] at org.netbeans.ModuleManager.shutDown(ModuleManager.java:1745)

at org.netbeans.core.startup.ModuleSystem.shutDown(ModuleSystem.java:316)

at org.netbeans.core.NbLifecycleManager.doExit(NbLifecycleManager.java:167)

at org.netbeans.core.NbLifecycleManager.access$000(NbLifecycleManager.java:75)

at org.netbeans.core.NbLifecycleManager$ExitActions.run(NbLifecycleManager.java:123)

at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)

at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:705)

at java.awt.EventQueue.access$000(EventQueue.java:101)

at java.awt.EventQueue$3.run(EventQueue.java:666)

at java.awt.EventQueue$3.run(EventQueue.java:664)

at java.security.AccessController.doPrivileged(Native Method)

at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)

at java.awt.EventQueue.dispatchEvent(EventQueue.java:675)

at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:148)

at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211)

at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

[/java]



I know that this has nothing to do with JME directly. I have looked to your SDK platform code but couldn’t figure out how you shut down the platform correctly. The Exception itself wouln’d bother me but it seems as if it is responsible that my settings and window positions are not saved from Netbeans and this is not nice aftr restart.

Thanks.



Regards,

Equi

Heh, well I am not trying to hide anything from you, I would have told you if I did anything else ^^

This is the installer of the SDK:

http://code.google.com/p/jmonkeyengine/source/browse/trunk/sdk/jme3-core/src/com/jme3/gde/core/Installer.java