StandardGame and assertDisplayCreated for HEADLESS applications

I'm having this problem with StandardGame when I use GameType.HEADLESS (for my server mode):

com.jme.system.JmeException: Window must be created during initialization.



at Source)

I'll continue debugging, there are more exceptions…

More exceptions:

ADVERTENCIA: Problem during creation of Mouse.

java.lang.IllegalStateException: Display must be created prior to creating mouse

at org.lwjgl.input.Mouse.create(

at com.jme.input.lwjgl.LWJGLMouseInput.<init>(

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

at com.jme.input.MouseInput.get(


at Source)

I'll submit a patch when my server is working.

A patch for the aforesaid bugs.

EDIT: This patch is obsoleted by the DummyDisplaySystem timer issue (see: The patch providen there already contains this patch.

It is in Unified format and applies to the file.

RCS file: /cvs/jme/src/com/jmex/game/,v
retrieving revision 1.6
diff -u -r1.6
---   17 Jan 2007 21:35:09 -0000   1.6
+++   24 Jan 2007 18:44:24 -0000
@@ -45,6 +45,7 @@
 import com.jme.renderer.ColorRGBA;
 import com.jme.system.DisplaySystem;
 import com.jme.system.GameSettings;
+import com.jme.system.JmeException;
 import com.jme.system.PreferencesGameSettings;
 import com.jme.util.GameTaskQueue;
 import com.jme.util.GameTaskQueueManager;
@@ -129,7 +130,7 @@
    public void run() {
-      assertDisplayCreated();
+      if (type == GameType.GRAPHICAL) assertDisplayCreated();
       if (type == GameType.GRAPHICAL) {
          timer = Timer.getTimer();
@@ -148,7 +149,7 @@
       // Default the mouse cursor to off
-      MouseInput.get().setCursorVisible(false);
+      if (type == GameType.GRAPHICAL) MouseInput.get().setCursorVisible(false);
       // Main game loop
       float tpf;