Oh the humanity!

Okay, so I went to launch the first beta of Roll-A-Rama on my awesome new server and now I'm getting the following error:


Exception in thread "Thread-0" java.lang.UnsatisfiedLinkError: /var/www/html/rollarama/webstart/liblwjgl.so: /usr/java/jdk1.5.0_06/jre/lib/i386/libjawt.so: symbol awt_FreeDrawingSurface, version SUNWprivate_1.1 not defined in file libmawt.so with link time reference
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1676)
        at java.lang.Runtime.loadLibrary0(Runtime.java:822)
        at java.lang.System.loadLibrary(System.java:992)
        at org.lwjgl.Sys$1.run(Sys.java:67)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.lwjgl.Sys.<clinit>(Sys.java:65)
        at com.jme.util.lwjgl.LWJGLTimer.<clinit>(Unknown Source)
        at com.jme.util.Timer.getTimer(Unknown Source)
        at com.captiveimagination.jme.GameManager.run(GameManager.java:333)
        at java.lang.Thread.run(Thread.java:595)


Which I googled and found this reference to it:

https://sourceforge.net/project/shownotes.php?release_id=316738

It seems as though because of the AWT dependency that exists in LWJGL I can't run LWJGL in a headless environment. Anyone know a way around this?

Because of the evils of LWJGL (just venting, I'll be over it tomorrow and love LWJGL again) we'll have to wait one more day for Roll-A-Rama Soccer. :-p

darkfrog

So what will you do about it?

Cry bitterly…then tomorrow I shall hopefully come up with a better solution. :-p



darkfrog

What about using Xvfb? I use it for running tests that need AWT/Swing gui on server side. Or simply don't use LWJGL on server side :wink:

Is there any way to not use LWJGL for a jME game?  I'm using DummyDisplay for the server component…is there another way to go that wouldn't need LWJGL at all?



darkfrog

Dummy display is fine, be sure to replace input with dummies also (or don't call any *Input.get() any time).

Okay, so it looks as though I’m going to have to do a rebuild of my game after making a few minor source code changes.  That means it will this evening before it’s available to play. :frowning:



However, if you want to see my little launch page for the game and play around with my cool menus then feel free to take a look (btw, it appears if you press the multiplayer button it throws an exception and navigation no longer works (because of the fact it can’t connect to the server registry), that’s a bug I’ll have to address very soon):



http://www.captiveimagination.com:7777/rollarama/



Sorry for the slowness, it’s running on my amazing new server, but unfortunately the server is running through my DSL connection until I get everything squared away to ship it out.



darkfrog

Okay, the biggest problem I've found that I've been having has to do with using the LWJGLTimer, so I wrote my own DummyTimer since I have many operations even in server mode that depend on it.  I have included the source code below in case anyone else might want to use it or it might like to be adopted into jME.  I don't do any smoothing (since for me it's for the server and I don't care about that) but it should be pretty easily added if it's useful to others:


/*
 * Created on Feb 22, 2006
 */

import com.jme.util.*;

/**
 * @author Matthew D. Hicks
 */
public class DummyTimer extends Timer {
    private static final long TIMER_RESOLUTION = 1000000000;
   
    private long startTime;
    private long previousTime;
    private float tpf;
    private float fps;
   
    public DummyTimer() {
        startTime = System.nanoTime();
    }
   
    public long getTime() {
        return System.nanoTime() - startTime;
    }

    public long getResolution() {
        return TIMER_RESOLUTION;
    }

    public float getFrameRate() {
        return fps;
    }

    public float getTimePerFrame() {
        return tpf;
    }

    public void update() {
        tpf = (getTime() - previousTime) * (1.0f / TIMER_RESOLUTION);
        fps = 1.0f / tpf;
        previousTime = getTime();
    }
}



darkfrog

glad you solved it for you :slight_smile:



jME still is JRE1.4 compatible - so System.nanoTime() is not available :expressionless:

Plus it apperently has issues with HyperThreading if I remember correctly.

He meant Hyper Threading with System.nanoTime(), which is used in the code I posted.



The server I'm running this on is Hyper Threaded and didn't notice any problems, although the time could have been moderately off and I still not really notice. :o



BTW, I got the server up and running last night for Roll-A-Rama but my firewall is hassling me about the ports. If I ever stop running into problems I'll post another message to say it's up and functional. :o



darkfrog