Question

I'm designing this Java web applet to stream video via RTSP from a video server. In order to render this video, the Xuggler 5.4 library (xuggle-xuggler.jar) will be used. Currently, video is rendered properly when I run it on Windows XP and Ubuntu 10.04 machines. When I try to run it on Windows 7, however, I get the following error:

10:10:13.370 [Thread-13] WARN  com.xuggle.ferry.JNILibrary - Failure: library load of library: xuggle; url: C:\Users\Justin\AppData\Local\Temp\xuggle\xuggle8376027568348573783.dll; error: java.lang.UnsatisfiedLinkError: C:\Users\Justin\AppData\Local\Temp\xuggle\xuggle8376027568348573783.dll: Can't find dependent libraries
10:10:13.448 [Thread-13] ERROR com.xuggle.ferry.JNILibraryLoader - Could not load library: xuggle; version: 5; Visit http://www.xuggle.com/xuggler/faq/ to find common solutions to this problem
Exception in thread "Thread-13" java.lang.UnsatisfiedLinkError: no xuggle in java.library.path
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.loadLibrary0(Unknown Source)
    at java.lang.System.loadLibrary(Unknown Source)
    at com.xuggle.ferry.JNILibraryLoader.loadLibrary0(JNILibraryLoader.java:268)
    at com.xuggle.ferry.JNILibraryLoader.loadLibrary(JNILibraryLoader.java:171)
    at com.xuggle.ferry.JNILibrary.load(JNILibrary.java:161)
    at com.xuggle.ferry.FerryJNI.<clinit>(FerryJNI.java:16)
    at com.xuggle.ferry.Ferry.<clinit>(Ferry.java:25)
    at com.xuggle.xuggler.XugglerJNI.<clinit>(XugglerJNI.java:19)
    at com.xuggle.xuggler.ICodec$ID.<clinit>(ICodec.java:760)
    at com.ioindustries.videoserver.RtpSession.run(RtpSession.java:86)
    at java.lang.Thread.run(Unknown Source)

I've tried extracting the xuggle-5.dll and placing it in my web directory, then linking it to Windows %PATH% and even Windows %CLASSPATH%, but video still does not render when I do so and the error disappears (at that point, I'm not sure what is happening). I've also tried running xuggle-5.dll through the dependency walker, although all I get is an error with IESHIM.dll as shown in the screenshot below:

enter image description here

Of course, the same error with IESHIM.dll occurs when I run it on the Windows XP and on the Ubuntu 10.04 machines.

I also have the xuggle-xuggler.jar file referenced in under the HTML document that is used to launch the web applet.

At this point, I'm really not sure why Xuggler fails to run on my Windows 7 (32-bit) machine specifically, which I use for development. Any help on the matter would be greatly appreciated.

As a note, I am trying to run with the GPL version of Xuggle 5.4 (which should not require any installation unlike previous versions of Xuggle) available on the Xuggle website.

Here is a snippet of my HTML document:

<div id="applet_box" class="applet box">
            <applet id="applet" code="com.videoserver.ClientApplet" 
                    archive="VideoServerClient.jar, xuggle-xuggler-5.4.jar, slf4j-api-1.6.4.jar, logback-classic-1.0.0.jar, logback-core-1.0.0.jar" MAYSCRIPT>
            </applet>
        </div>  
Was it helpful?

Solution

My coworker figured out why this java.lang.UnsatisfiedLinkErrorwas occurring, so all credit goes to him (I was merely an observer).

Refer to the first line of the error log above:

10:10:13.370 [Thread-13] WARN  com.xuggle.ferry.JNILibrary - Failure: library load of library: xuggle; url: C:\Users\Justin\AppData\Local\Temp\xuggle\xuggle8376027568348573783.dll; error: java.lang.UnsatisfiedLinkError: C:\Users\Justin\AppData\Local\Temp\xuggle\xuggle8376027568348573783.dll: Can't find dependent libraries

Basically, what was happening in my case was that the Java Runtime Environment had a cached copy of a Xuggle DLL file, which likely came from an old Xuggle JAR archive I had used to experiment with Java applet video output two months ago. We were able to arrive at this conclusion given the fact that the DLL file referenced in the temporary directory (C:\Users\Justin\AppData\Local\Temp\xuggle\xuggle8376027568348573783.dll) had different dependencies in comparison to the most recent xuggle DLL file that was extracted from the most recent xuggle-xuggler-5.4.jar when verified through the Dependency Walker application above.

As a result, when I tried to display video in my Java Web Applet, the Java Runtime Environment would try to access this aged Xuggle DLL file instead of loading the DLL file from within xuggle-xuggler-5.4.jar. Hence, the above java.lang.UnsatisfiedLinkError occurred.

In order to force the Java Runtime Environment to load the DLL file from within DLL file from within xuggle-xuggler-5.4.jar, the following steps were executed:

  1. Open up the Java Control Panel. In Windows, this is done by going to the Start menu and accessing the Control Panel. If the Java Runtime Environment is installed, Java should appear as an option in the Windows Control Panel. Click Java.

  2. Once you are in the Java Control Panel, under the General tab, under Temporary Internet Files, click the Settings... button.

  3. Uncheck the checkbox that says, "Keep temporary files on my computer."

  4. Then click the Delete Files button and delete all temporary files (select all checkboxes). Depending on what your preferences are, you may want to only select a subset of these checkboxes, although I selected them all.

  5. Click OK. Then click OK again. Then click OK a third time to close the Java Control Panel.

  6. Close your web browser if its open and try to relaunch your Java Web Applet. If this was the issue you were having, that java.lang.UnsatisfiedLinkError should no longer occur and video should be displayed properly assuming that your code is correct and that you have the correct Xuggle JARs, as well as Xuggle's dependencies, loaded. In my case, my web applet JAR was simply placed in the same directory as the HTML file that is used to embed it in a web browser, along with all the required Xuggle JARs and Xuggle dependency JARs.

It should be noted that the Java Runtime Environment in Ubuntu also has Java Control Panel that looks similar to the one in Windows and similar steps can be executed to resolve this issue in Ubuntu if the problem ever arises.

The above solution should work if you are simply opening the HTML file directly in a web browser. If you are using Apache Tomcat or Glassfish to deploy your web applet, this may not work - in this case, you may want to refer to this solution, although I haven't tested it thoroughly myself:

http://wiki.xuggle.com/Frequently_Asked_Questions#I_get_an_.22UnsatisfiedLinkError.22_when_I_run_Xuggler-based_Applications_in_Tomcat

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top