New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Library not installed properly" error message inconsistent in P2D/P3D vs. JAVA2D #3453

Closed
shiffman opened this Issue Jul 3, 2015 · 3 comments

Comments

Projects
None yet
3 participants
@shiffman
Member

shiffman commented Jul 3, 2015

I discovered this while developing a library that requires native files. If my library is not configured properly and I run an example in JAVA2D, the result is:

screen shot 2015-07-03 at 10 31 41 am

If I change the example to P2D or P3D, the result is the scarier looking:

screen shot 2015-07-03 at 10 31 54 am

I believe the JAVA2D behavior is the one we want for P2D as well, however, I do find seeing that the libfreenect.dylib file is not loaded useful in development/testing/bug reporting so might be worth considering adding if it's simple enough.

A library relies on native code that's not available. The file libfreenect.dylib could not be found.

@benfry benfry added this to the 3.0 final milestone Jul 3, 2015

@codeanticode codeanticode added the opengl label Aug 11, 2015

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Aug 13, 2015

Member

Full stack trace:

java.lang.RuntimeException: com.jogamp.opengl.GLException: Caught UnsatisfiedLinkError: /Users/fry/coconut/sketchbook/libraries/openkinect/library/libKinect.jnilib: dlopen(/Users/fry/coconut/sketchbook/libraries/openkinect/library/libKinect.jnilib, 1): no suitable image found.  Did find:
    /Users/fry/coconut/sketchbook/libraries/openkinect/library/libKinect.jnilib: mach-o, but wrong architecture on thread main-Display-.macosx_nil-1-EDT-1
    at jogamp.newt.DefaultEDTUtil.invokeImpl(DefaultEDTUtil.java:249)
    at jogamp.newt.DefaultEDTUtil.invoke(DefaultEDTUtil.java:163)
    at jogamp.newt.DisplayImpl.runOnEDTIfAvail(DisplayImpl.java:427)
    at jogamp.newt.WindowImpl.runOnEDTIfAvail(WindowImpl.java:2133)
    at jogamp.newt.WindowImpl.setVisible(WindowImpl.java:1024)
    at jogamp.newt.WindowImpl.setVisible(WindowImpl.java:1029)
    at com.jogamp.newt.opengl.GLWindow.setVisible(GLWindow.java:499)
    at processing.opengl.PSurfaceJOGL.setVisible(PSurfaceJOGL.java:393)
    at processing.core.PApplet.showSurface(PApplet.java:10242)
    at processing.core.PApplet.runSketch(PApplet.java:10226)
    at processing.core.PApplet.main(PApplet.java:9958)
Caused by: com.jogamp.opengl.GLException: Caught UnsatisfiedLinkError: /Users/fry/coconut/sketchbook/libraries/openkinect/library/libKinect.jnilib: dlopen(/Users/fry/coconut/sketchbook/libraries/openkinect/library/libKinect.jnilib, 1): no suitable image found.  Did find:
    /Users/fry/coconut/sketchbook/libraries/openkinect/library/libKinect.jnilib: mach-o, but wrong architecture on thread main-Display-.macosx_nil-1-EDT-1
    at com.jogamp.opengl.GLException.newGLException(GLException.java:76)
    at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1311)
    at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1131)
    at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:680)
    at jogamp.opengl.GLAutoDrawableBase.defaultWindowResizedOp(GLAutoDrawableBase.java:259)
    at com.jogamp.newt.opengl.GLWindow.access$200(GLWindow.java:119)
    at com.jogamp.newt.opengl.GLWindow$2.windowResized(GLWindow.java:141)
    at jogamp.newt.WindowImpl.consumeWindowEvent(WindowImpl.java:3682)
    at jogamp.newt.WindowImpl.sendWindowEvent(WindowImpl.java:3616)
    at jogamp.newt.WindowImpl.setVisibleActionImpl(WindowImpl.java:1003)
    at jogamp.newt.WindowImpl$VisibleAction.run(WindowImpl.java:1015)
    at com.jogamp.common.util.RunnableTask.run(RunnableTask.java:150)
    at jogamp.newt.DefaultEDTUtil$NEDT.run(DefaultEDTUtil.java:372)
Caused by: java.lang.UnsatisfiedLinkError: /Users/fry/coconut/sketchbook/libraries/openkinect/library/libKinect.jnilib: dlopen(/Users/fry/coconut/sketchbook/libraries/openkinect/library/libKinect.jnilib, 1): no suitable image found.  Did find:
    /Users/fry/coconut/sketchbook/libraries/openkinect/library/libKinect.jnilib: mach-o, but wrong architecture
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1937)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1859)
    at java.lang.Runtime.loadLibrary0(Runtime.java:870)
    at java.lang.System.loadLibrary(System.java:1122)
    at org.openkinect.Context.<clinit>(Context.java:43)
    at org.openkinect.processing.Kinect.start(Kinect.java:40)
    at RGBDepthTest.setup(RGBDepthTest.java:38)
    at processing.core.PApplet.handleDraw(PApplet.java:2371)
    at processing.opengl.PSurfaceJOGL$DrawListener.display(PSurfaceJOGL.java:660)
    at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:691)
    at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:673)
    at jogamp.opengl.GLAutoDrawableBase$2.run(GLAutoDrawableBase.java:442)
    at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1277)
    ... 11 more
Member

benfry commented Aug 13, 2015

Full stack trace:

java.lang.RuntimeException: com.jogamp.opengl.GLException: Caught UnsatisfiedLinkError: /Users/fry/coconut/sketchbook/libraries/openkinect/library/libKinect.jnilib: dlopen(/Users/fry/coconut/sketchbook/libraries/openkinect/library/libKinect.jnilib, 1): no suitable image found.  Did find:
    /Users/fry/coconut/sketchbook/libraries/openkinect/library/libKinect.jnilib: mach-o, but wrong architecture on thread main-Display-.macosx_nil-1-EDT-1
    at jogamp.newt.DefaultEDTUtil.invokeImpl(DefaultEDTUtil.java:249)
    at jogamp.newt.DefaultEDTUtil.invoke(DefaultEDTUtil.java:163)
    at jogamp.newt.DisplayImpl.runOnEDTIfAvail(DisplayImpl.java:427)
    at jogamp.newt.WindowImpl.runOnEDTIfAvail(WindowImpl.java:2133)
    at jogamp.newt.WindowImpl.setVisible(WindowImpl.java:1024)
    at jogamp.newt.WindowImpl.setVisible(WindowImpl.java:1029)
    at com.jogamp.newt.opengl.GLWindow.setVisible(GLWindow.java:499)
    at processing.opengl.PSurfaceJOGL.setVisible(PSurfaceJOGL.java:393)
    at processing.core.PApplet.showSurface(PApplet.java:10242)
    at processing.core.PApplet.runSketch(PApplet.java:10226)
    at processing.core.PApplet.main(PApplet.java:9958)
Caused by: com.jogamp.opengl.GLException: Caught UnsatisfiedLinkError: /Users/fry/coconut/sketchbook/libraries/openkinect/library/libKinect.jnilib: dlopen(/Users/fry/coconut/sketchbook/libraries/openkinect/library/libKinect.jnilib, 1): no suitable image found.  Did find:
    /Users/fry/coconut/sketchbook/libraries/openkinect/library/libKinect.jnilib: mach-o, but wrong architecture on thread main-Display-.macosx_nil-1-EDT-1
    at com.jogamp.opengl.GLException.newGLException(GLException.java:76)
    at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1311)
    at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1131)
    at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:680)
    at jogamp.opengl.GLAutoDrawableBase.defaultWindowResizedOp(GLAutoDrawableBase.java:259)
    at com.jogamp.newt.opengl.GLWindow.access$200(GLWindow.java:119)
    at com.jogamp.newt.opengl.GLWindow$2.windowResized(GLWindow.java:141)
    at jogamp.newt.WindowImpl.consumeWindowEvent(WindowImpl.java:3682)
    at jogamp.newt.WindowImpl.sendWindowEvent(WindowImpl.java:3616)
    at jogamp.newt.WindowImpl.setVisibleActionImpl(WindowImpl.java:1003)
    at jogamp.newt.WindowImpl$VisibleAction.run(WindowImpl.java:1015)
    at com.jogamp.common.util.RunnableTask.run(RunnableTask.java:150)
    at jogamp.newt.DefaultEDTUtil$NEDT.run(DefaultEDTUtil.java:372)
Caused by: java.lang.UnsatisfiedLinkError: /Users/fry/coconut/sketchbook/libraries/openkinect/library/libKinect.jnilib: dlopen(/Users/fry/coconut/sketchbook/libraries/openkinect/library/libKinect.jnilib, 1): no suitable image found.  Did find:
    /Users/fry/coconut/sketchbook/libraries/openkinect/library/libKinect.jnilib: mach-o, but wrong architecture
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1937)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1859)
    at java.lang.Runtime.loadLibrary0(Runtime.java:870)
    at java.lang.System.loadLibrary(System.java:1122)
    at org.openkinect.Context.<clinit>(Context.java:43)
    at org.openkinect.processing.Kinect.start(Kinect.java:40)
    at RGBDepthTest.setup(RGBDepthTest.java:38)
    at processing.core.PApplet.handleDraw(PApplet.java:2371)
    at processing.opengl.PSurfaceJOGL$DrawListener.display(PSurfaceJOGL.java:660)
    at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:691)
    at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:673)
    at jogamp.opengl.GLAutoDrawableBase$2.run(GLAutoDrawableBase.java:442)
    at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1277)
    ... 11 more
@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Aug 13, 2015

Member

Looks like when handleDraw() is called in the display listener, there's not an obvious way to pass that exception over.

Member

benfry commented Aug 13, 2015

Looks like when handleDraw() is called in the display listener, there's not an obvious way to pass that exception over.

@codeanticode

This comment has been minimized.

Show comment
Hide comment
@codeanticode

codeanticode Sep 7, 2015

Member

the UnsatisfiedLinkError is thrown before starting the animation thread and setting JOGL's setUncaughtExceptionHandler. But this cannot be done until the window is set as visible, so I added error handling code in setVisible() which fixes it 61a41b0

Member

codeanticode commented Sep 7, 2015

the UnsatisfiedLinkError is thrown before starting the animation thread and setting JOGL's setUncaughtExceptionHandler. But this cannot be done until the window is set as visible, so I added error handling code in setVisible() which fixes it 61a41b0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment