Quantcast

UnsatisfiedLinkError

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

UnsatisfiedLinkError

jf2qm
Hello,

I wrote a program using Processing(which uses jogl and gluegen), and am using PApplet to run it in a java application in NetBeans.

I am unable to run my program (by running the jar) outside the IDE - neither on my local windows 64-bit machine using command line, nor on a external linux server (which is where I would like to run the program) using X11 forwarding


This is the error I receive from the linux machine:
Exception in thread "Animation Thread" java.lang.UnsatisfiedLinkError: jogamp.common.jvm.JVMUtil.initialize(Ljava/nio/ByteBuffer;)Z
        at jogamp.common.jvm.JVMUtil.initialize(Native Method)
        at jogamp.common.jvm.JVMUtil.<clinit>(JVMUtil.java:58)
        at com.jogamp.common.os.Platform$1.run(Platform.java:212)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.jogamp.common.os.Platform.<clinit>(Platform.java:179)
        at javax.media.opengl.GLProfile.<clinit>(GLProfile.java:82)
        at processing.opengl.PJOGL.initSurface(PJOGL.java:250)
        at processing.opengl.PGraphicsOpenGL.initPrimary(PGraphicsOpenGL.java:6310)
        at processing.opengl.PGraphicsOpenGL.requestDraw(PGraphicsOpenGL.java:1653)
        at processing.core.PApplet.run(PApplet.java:2256)
        at java.lang.Thread.run(Thread.java:724)



this is the error I get from trying to run the jar on my machine using command line:

Exception in thread "Animation Thread" java.lang.UnsatisfiedLinkError: C:\Users\
M30043\AppData\Local\Temp\jogamp_0000\file_cache\jln5173289022091140639\jln27661
81922398212841\gluegen-rt.dll: Can't find dependent libraries
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary1(Unknown Source)
        at java.lang.ClassLoader.loadLibrary0(Unknown Source)
        at java.lang.ClassLoader.loadLibrary(Unknown Source)
        at java.lang.Runtime.load0(Unknown Source)
        at java.lang.System.load(Unknown Source)
        at com.jogamp.common.jvm.JNILibLoaderBase.loadLibraryInternal(JNILibLoaderBase.java:575)
        at com.jogamp.common.jvm.JNILibLoaderBase.access$000(JNILibLoaderBase.java:64)
        at com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNILibLoaderBase.java:96)
        at com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary(JNILibLoaderBase.java:459)
        at com.jogamp.common.os.DynamicLibraryBundle$GlueJNILibLoader.loadLibrary(DynamicLibraryBundle.java:388)
        at com.jogamp.common.os.Platform$1.run(Platform.java:209)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.jogamp.common.os.Platform.<clinit>(Platform.java:179)
        at javax.media.opengl.GLProfile.<clinit>(GLProfile.java:82)
        at processing.opengl.PJOGL.initSurface(PJOGL.java:250)
        at processing.opengl.PGraphicsOpenGL.initPrimary(PGraphicsOpenGL.java:6310)
        at processing.opengl.PGraphicsOpenGL.requestDraw(PGraphicsOpenGL.java:1653)
        at processing.core.PApplet.run(PApplet.java:2256)
        at java.lang.Thread.run(Unknown Source)




Any idea about why I can run it in the IDE but not outside? or any way to package it so that it can run outside the IDE?

thanks
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: UnsatisfiedLinkError

Wade Walker
Administrator
If you use Dependency Walker on gluegen-rt.dll, you can see that it depends on kernel32.dll and msvcrt.dll, which are usually both in c:\windows\system32. Perhaps you're missing one of these dependencies, or c:\windows\system32 isn't on your %PATH% when you run from the command line?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: UnsatisfiedLinkError

jf2qm
In reply to this post by jf2qm
UPDATE/EDIT

I previously was able to run the program via command line on my windows machine, but ran into trouble after testing on the linux server.    I think there may have been some issues with paths or something after I downloaded the linux versions of the same jars.  after consolidating some of the files i have a new error:

java.lang.NoSuchMethodError: com.jogamp.common.nio.Buffers.slice2Float(Ljava/nio
/Buffer;[FII)Ljava/nio/FloatBuffer;
        at jogamp.opengl.ProjectFloat.<init>(ProjectFloat.java:181)
        at jogamp.opengl.ProjectFloat.<init>(ProjectFloat.java:167)
        at jogamp.opengl.ProjectFloat.<init>(ProjectFloat.java:163)
        at javax.media.opengl.glu.GLU.<init>(GLU.java:164)
        at processing.opengl.PJOGL.<init>(PJOGL.java:218)
        at processing.opengl.PGraphicsOpenGL.createPGL(PGraphicsOpenGL.java:1744
)
        at processing.opengl.PGraphicsOpenGL.<init>(PGraphicsOpenGL.java:518)
        at processing.opengl.PGraphics3D.<init>(PGraphics3D.java:37)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

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

        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at processing.core.PApplet.makeGraphics(PApplet.java:1919)
        at processing.core.PApplet.size(PApplet.java:1771)
        at processing.core.PApplet.size(PApplet.java:1742)
        at noblis.farag.MySketch.setup(MySketch.java:132)
        at processing.core.PApplet.handleDraw(PApplet.java:2361)
        at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:240)

        at processing.core.PApplet.run(PApplet.java:2256)
        at java.lang.Thread.run(Unknown Source)
Exception in thread "Animation Thread" java.lang.RuntimeException: com.jogamp.co
mmon.nio.Buffers.slice2Float(Ljava/nio/Buffer;[FII)Ljava/nio/FloatBuffer;
        at processing.core.PApplet.makeGraphics(PApplet.java:1944)
        at processing.core.PApplet.size(PApplet.java:1771)
        at processing.core.PApplet.size(PApplet.java:1742)
        at noblis.farag.MySketch.setup(MySketch.java:132)
        at processing.core.PApplet.handleDraw(PApplet.java:2361)
        at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:240)

        at processing.core.PApplet.run(PApplet.java:2256)
        at java.lang.Thread.run(Unknown Source)



Both the linux and windows have something about the buffers within jogamp,  

- any ideas about the significance of: (LJava/nio/Buffer) ?


Thanks wade, I'll look into that and let you know if anything changes based on that info

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: UnsatisfiedLinkError

jf2qm
In reply to this post by Wade Walker
Thanks wade, I'll look into that and let you know if anything changes based on that info.   Would your suggestion change based on the new error I'm getting? (listed in the reply to the original message)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: UnsatisfiedLinkError

Wade Walker
Administrator
The NoSuchMethodError sounds like there's a version mismatch between the JAR files that make up JOGL. The gluegen-rt.jar, jogl-all.jar, gluegen-rt-natives-*-*.jar and jogl-all-natives-*-*.jar files all must be from the same JOGL version, or there will be problems  The gluegen-rt.jar and jogl-all.jar files must be in your classpath, then JOGL looks in the same directory at runtime to find the gluegen-rt-natives-*-*.jar and jogl-all-natives-*-*.jar files, which it unzips to a temp directory.

The JAR files should be the same on both Linux and Windows, it's only the natives files that differ. And since the native files are named different on each platform, there's no conflict, they can all coexist in the same directory.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: UnsatisfiedLinkError

Sven Gothel
Administrator
In reply to this post by jf2qm
On 07/14/2014 09:57 PM, jf2qm [via jogamp] wrote:

> UPDATE/EDIT
>
> I previously was able to run the program via command line on my windows
> machine, but ran into trouble after testing on the linux server.    I think
> there may have been some issues with paths or something after I downloaded the
> linux versions of the same jars.  after consolidating some of the files i have
> a new error:
>
> java.lang.NoSuchMethodError: com.jogamp.common.nio.Buffers.slice2Float(Ljava/nio
> /Buffer;[FII)Ljava/nio/FloatBuffer;
>         at jogamp.opengl.ProjectFloat.<init>(ProjectFloat.java:181)
>         at jogamp.opengl.ProjectFloat.<init>(ProjectFloat.java:167)
Looks like GlueGen has been updated, but not JOGL ?

currently in Buffers:

  public static final FloatBuffer slice2Float(final Buffer buf, final int
floatStartPos, final int floatSize)

  public static final FloatBuffer slice2Float(final float[] backing, final int
floatStartPos, final int floatSize)

Note: This change happened in commits

GlueGen 3bfc1e484ae247214d47f25fcc9b9da223f51fe1
Date:   Fri Jun 27 10:26:25 2014 +0200

JOGL 0bded476868c5fdfe44502bfd55957469d0d72bb
Date:   Fri Jun 27 18:16:43 2014 +0200

~Sven


signature.asc (894 bytes) Download Attachment
Loading...