Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Problems with a project exported to Jar

Help
Anonymous
2011-12-19
2012-12-26

  • Anonymous
    2011-12-19

    Hello! I am using the GSVideo library in my application to capture webcam input. Everything is ok and works perfectly from Eclipse. However, when I export the application into jar, I get the following error upon launching the jar:

    GSVideo version: 1.0.0
    Exception in thread "Animation Thread" java.lang.UnsatisfiedLinkError: can't loa
    d library gio-2.0 (gio-2.0|libgio-2.0|libgio-2.0-0) with -Djna.library.path=\gst
    reamer\windows32. Last error:java.lang.UnsatisfiedLinkError: Unable to load libr
    ary 'gio-2.0': The specified module could not be found.

            at codeanticode.gsvideo.GSLibraryLoader.loadLibrary(Unknown Source)
            at codeanticode.gsvideo.GSLibraryLoader.load(Unknown Source)
            at codeanticode.gsvideo.GSLibraryLoader.preLoadLibs(Unknown Source)
            at codeanticode.gsvideo.GSLibraryLoader.getInstance(Unknown Source)
            at codeanticode.gsvideo.GSVideo.initImpl(Unknown Source)
            at codeanticode.gsvideo.GSVideo.init(Unknown Source)
            at codeanticode.gsvideo.GSCapture.initGStreamer(Unknown Source)
            at codeanticode.gsvideo.GSCapture.<init>(Unknown Source)
            at webcam.GSVideoCamera.<init>(GSVideoCamera.java:31)
            at virtual.Composer.<init>(Composer.java:33)
            at fittingroom.Shell.<init>(Shell.java:31)
            at fittingroom.FittingRoom.setup(FittingRoom.java:24)
            at processing.core.PApplet.handleDraw(Unknown Source)
            at processing.core.PApplet.run(Unknown Source)
            at java.lang.Thread.run(Unknown Source)

    Please know that I am aware of the strangeness of jar resource and dependencies management and have tried building the project with JarClassLoader implemented too without any luck. So there must be something else that Elipse does in order for the library to work. However, I was able to reproduce the error not only with the exported jar but inside Eclipse also. I have done it by removing the GSVideo jar from project libraries and using the source instead. There must be some dead-simple confusion with paths somewhere. However, I have tried to fix the problem by modifying the sources and was unable to do this because of the overwhelmingly complex structure for multiplatform load of the dlls.

    Could you please provide ay hints to how can the problem be solved? Maybe I am doing something wrong?

     
  • Andres Colubri
    Andres Colubri
    2012-01-12

    In this case I'd recommend using the GSVideo.localGStreamerPath static variable to indicate a hard-coded location of the gstreamer libs.