Sheepish Frog

I have a problem that I would have hoped not to make public, but a lesson in humility is always a good thing, so here goes:



I'm getting the following error in linux when I try to run anything in jME:


java.lang.UnsatisfiedLinkError: /programming/workspace/jme/lib/liblwjgl.so: /programming/workspace/jme/lib/liblwjgl.so: cannot open shared object file: No such file or directory
   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 org.lwjgl.opengl.Display.<clinit>(Display.java:104)
   at com.jme.system.lwjgl.LWJGLPropertiesDialog.<init>(LWJGLPropertiesDialog.java:148)
   at com.jme.app.AbstractGame.getAttributes(AbstractGame.java:191)
   at com.jme.app.BaseGame.start(BaseGame.java:59)
   at jmetest.base.TestSimpleGame.main(TestSimpleGame.java:50)



I can't figure out why this is happening as I've properly defined the java.library.path to point to /programming/workspace/jme/lib and it's obviously finding the file, and it is there, but this error is being thrown anyway.  Can anyone set me straight?

Thanks,

darkfrog

you have a /programming/workspace/jme/lib/ on your box?? Try removing the leading / or adding a .

Yes, the location of the library is /programming/workspace/jme/lib/liblwjgl.so and I specified:


-Djava.library.path=/programming/workspace/jme/lib



As my VM arguments.  I've tried setting the permissions on the files and even the folder to be 777 and it's still not going.

darkfrog

Okay, I think it might have to do with the fact that I'm mounting a FAT32 partition and it's having issues dealing with that.  I'm still looking into it, but I'm feeling less like a Sheep all the time. :-p



darkfrog

I should have explained that I'm trying to release Roll-A-Rama…that's why everything is breaking. :-p



Okay, I went ahead and built everything and dropped on my production server and now I'm getting this friendly error message:


SEVERE: Native code library failed to load: java.lang.UnsatisfiedLinkError: /home/mhicks/rr/lib/libodejava.so: libstdc++.so.5: cannot open shared object file: No such file or directory
Exception in thread "Thread-0" java.lang.UnsatisfiedLinkError: get_PARENTSPACEID_ZERO
        at org.odejava.ode.OdeJNI.get_PARENTSPACEID_ZERO(Native Method)
        at org.odejava.ode.Ode.getPARENTSPACEID_ZERO(Unknown Source)
        at org.odejava.Space.<clinit>(Unknown Source)
        at com.jmex.physics.PhysicsWorld.<init>(Unknown Source)
        at com.jmex.physics.PhysicsWorld.create(Unknown Source)
        at com.captiveimagination.jme.GameManager.initGame(GameManager.java:207)        at com.captiveimagination.jme.GameManager.run(GameManager.java:331)
        at java.lang.Thread.run(Thread.java:595)



Any insights would be much appreciated.

darkfrog

Isn't libstdc++.so.5 one of those standard libraries that differs with the version of GCC you use? Maybe it's too new for a typical server oriented linuc distro (and by that I mean Debian). Either that or it's in the wrong path…



Me, I gave up on this path buisness and just put whatever dll/so/jnilib it asks for in the same directory that I launch the jar from (might solve the problem on your local machine).

Hi darkfrog, I think some security restirictions strike you.



From the man page of mount:


              noexec Do not allow direct execution  of  any  binaries  on  the
                     mounted  file system.  (Until recently it was possible to
                     run binaries anyway  using  a  command  like  /lib/ld*.so
                     /mnt/binary.  This  trick  fails  since  Linux  2.4.25  /
                     2.6.0.)


This option is default for vfat, nfs and some others.

You can find out which shared libraries a binary or a shared library needs with something like:


> ldd libjinput-linux.so
ldd: warning: you do not have execution permission for `./libjinput-linux.so'
        linux-gate.so.1 =>  (0xffffe000)
        libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x4002a000)
        libm.so.6 => /lib/tls/libm.so.6 (0x400e8000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x4010e000)
        libc.so.6 => /lib/tls/libc.so.6 (0x40119000)
        /lib/ld-linux.so.2 (0x80000000)


If you're missing libstdc++.so most propably it shows unresolved with the command above and you have to find it in some package (I think there are some compatibility packages out there if you have a different version).

Thanks guys, that was the boost I needed to figure it out.  In the end I had to simply execute (on Fedora Core 4 that is):


yum install compat-libstdc++-3



That installed what I needed.  Apparently by default FC4 comes with libstdc++.so.6 and you have to install the compatability package to get 5.

Hope someone else finds this useful.

darkfrog

On a related note, my server is now runnable.  This evening I will get Roll-A-Rama client deployed out for people to try…I just pray it will work. :-p



darkfrog

I've got my server running great, but on my machine when I try to execute the application I'm still getting, "cannot open shared object file" and when I execute:



ldd liblwjgl.so



I get:


        linux-gate.so.1 =>  (0xffffe000)
        libm.so.6 => /lib/libm.so.6 (0xf7f82000)
        libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0xf7eae000)
        libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0xf7e9f000)
        libpthread.so.0 => /lib/libpthread.so.0 (0xf7e8d000)
        libjawt.so => not found
        libc.so.6 => /lib/libc.so.6 (0xf7d63000)
        /lib/ld-linux.so.2 (0x56555000)
        libdl.so.2 => /lib/libdl.so.2 (0xf7d5f000)



It would seem that libjawt.so is missing?  I can't seem to find that anywhere...

darkfrog

It's included in jre, for me this is

/usr/java/jdk1.5.0_06/jre/lib/i386/libjawt.so

and it should be somewhere where java can find it.



You can try to add the directory where this shared library is to /etc/ld.so.conf and execute ldconfig, but this is something the install program or a script to start the java vm should do. Find the library with:

find /usr -name libjawt.so

if java is installed somewhere in /usr.

If ldd doesn't find it, it's probably considered to be a private library by the installer, so it's not registered with anything.



Or better put: what Galun said :slight_smile:

I'm not so sure how jre finds this library, but I have the following variables in my environment:

[code}

JRE_HOME=/usr/lib/jvm/java/jre

JAVA_HOME=/usr/lib/jvm/java

SDK_HOME=/usr/lib/jvm/java

JDK_HOME=/usr/lib/jvm/java



My guess is, java takes the JRE_HOME and appends a /lib.