There seems to be a problem with jmephysics because when I run in headless mode my program hangs in the following line:
staticNode = physicsSpace.createStaticNode();
When I say that 'my program hangs' I mean that the problematic thread somehow fails. The debugger says it is running (or stepping, if I was debugging) but I cannot get the stacktrace. The lines following the problematic call don't get executed.
I think this is related to the fact that I'm running headless, because in graphical mode, the same code works fine. The problem could also be related to the fact that I'm calling that inside a Callable, but I don't think that's the problem and anyway, when running in graphics mode It works ok.
When I debug the application I can reach the place where the application actually hangs:
Thread [Thread-1] (Suspended (breakpoint at line 318 in OdePhysicsSpace))
OdePhysicsSpace.<init>() line: 318
OdePhysicsSpace$OdeFactory.create() line: 195
PhysicsSpace.create() line: 317
Level.<init>(String) line: 95
TestLevelLoader.loadLevel() line: 89
MapCommand.call() line: 49
GameTask<V>.invoke() line: 91
GameTaskQueue.execute() line: 113
StandardGame.update(float) line: 261
StandardGame.run() line: 169
Thread.run() line: not available
I guess that it is hanging in the static initialization phase of the Odejava class, but in some way I think that the class is even not entering its static constructor. But I know nothing about JNI.
Any help on this or at least on how to debug something as strange would be welcome.