سؤال

I am trying to run Xuggle 5.4 on a server, and have an exception I do not know how to deal with. The same code works fine on two other server, and also on the same server under another application (Playframework). The fact that it run under another application makes me suggest that that might be the fault.

The root of the error seems to be that Xuggle tries to create a temp file and the access is denied. How can I figure out where this is? As mentioned, possibly this is a location th other install has already used, and which is running under another user account.

This is the stack trace:

2012-05-04 08:49:01,985 ERROR ~ could not create temp file: {}
java.io.IOException: Permission denied
    at java.io.UnixFileSystem.createFileExclusively(Native Method) ~[na:1.6.0_26]
    at java.io.File.checkAndCreate(File.java:1704) ~[na:1.6.0_26]
    at java.io.File.createTempFile(File.java:1792) ~[na:1.6.0_26]
    at com.xuggle.ferry.JNILibrary.unpackLibrary(JNILibrary.java:274) [xuggle-xuggler-5.4.jar:5.4.0]
    at com.xuggle.ferry.JNILibrary.loadFromClasspath(JNILibrary.java:195) [xuggle-xuggler-5.4.jar:5.4.0]
    at com.xuggle.ferry.JNILibrary.load(JNILibrary.java:176) [xuggle-xuggler-5.4.jar:5.4.0]
    at com.xuggle.ferry.JNILibrary.load(JNILibrary.java:158) [xuggle-xuggler-5.4.jar:5.4.0]
    at com.xuggle.ferry.FerryJNI.<clinit>(FerryJNI.java:16) [xuggle-xuggler-5.4.jar:5.4.0]
    at com.xuggle.ferry.Ferry.<clinit>(Ferry.java:25) [xuggle-xuggler-5.4.jar:5.4.0]
    at com.xuggle.xuggler.XugglerJNI.<clinit>(XugglerJNI.java:19) [xuggle-xuggler-5.4.jar:5.4.0]
    at com.xuggle.xuggler.IContainer.<clinit>(IContainer.java:1622) [xuggle-xuggler-5.4.jar:5.4.0]
    at com.xuggle.mediatool.MediaReader.<init>(MediaReader.java:137) [xuggle-xuggler-5.4.jar:5.4.0]
    at com.xuggle.mediatool.ToolFactory.makeReader(ToolFactory.java:77) [xuggle-xuggler-5.4.jar:5.4.0]
    at logic.server.MediaCoder.createEncodingJobs(MediaCoder.java:39) [idoms-server:na]
    at controllers.FileCopyJob$ProgressListener.actionPerformed(FileCopyJob.java:127) [idoms-server:na]
    at controllers.FileCopyJob$DownloadCountingOutputStream.afterWrite(FileCopyJob.java:84) [idoms-server:na]
    at org.apache.commons.io.output.ProxyOutputStream.write(ProxyOutputStream.java:92) [commons-io-2.0.1.jar:2.0.1]
    at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1263) [commons-io-2.0.1.jar:2.0.1]
    at org.apache.commons.io.IOUtils.copy(IOUtils.java:1236) [commons-io-2.0.1.jar:2.0.1]
    at controllers.FileCopyJob.doJob(FileCopyJob.java:58) [idoms-server:na]
    at play.jobs.Job.doJobWithResult(Job.java:50) [play-1.2.4.jar:na]
    at play.jobs.Job.call(Job.java:146) [play-1.2.4.jar:na]
    at play.jobs.Job$1.call(Job.java:66) [play-1.2.4.jar:na]
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [na:1.6.0_26]
    at java.util.concurrent.FutureTask.run(FutureTask.java:138) [na:1.6.0_26]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98) [na:1.6.0_26]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206) [na:1.6.0_26]
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [na:1.6.0_26]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [na:1.6.0_26]
    at java.lang.Thread.run(Thread.java:662) [na:1.6.0_26]
2012-05-04 08:49:02,003 ERROR ~ could not create temp file: {}
java.io.IOException: Permission denied
    at java.io.UnixFileSystem.createFileExclusively(Native Method) ~[na:1.6.0_26]
    at java.io.File.checkAndCreate(File.java:1704) ~[na:1.6.0_26]
    at java.io.File.createTempFile(File.java:1792) ~[na:1.6.0_26]
    at com.xuggle.ferry.JNILibrary.unpackLibrary(JNILibrary.java:274) [xuggle-xuggler-5.4.jar:5.4.0]
    at com.xuggle.ferry.JNILibrary.loadFromClasspath(JNILibrary.java:195) [xuggle-xuggler-5.4.jar:5.4.0]
    at com.xuggle.ferry.JNILibrary.load(JNILibrary.java:176) [xuggle-xuggler-5.4.jar:5.4.0]
    at com.xuggle.ferry.JNILibrary.load(JNILibrary.java:158) [xuggle-xuggler-5.4.jar:5.4.0]
    at com.xuggle.ferry.FerryJNI.<clinit>(FerryJNI.java:16) [xuggle-xuggler-5.4.jar:5.4.0]
    at com.xuggle.ferry.Ferry.<clinit>(Ferry.java:25) [xuggle-xuggler-5.4.jar:5.4.0]
    at com.xuggle.xuggler.XugglerJNI.<clinit>(XugglerJNI.java:19) [xuggle-xuggler-5.4.jar:5.4.0]
    at com.xuggle.xuggler.IContainer.<clinit>(IContainer.java:1622) [xuggle-xuggler-5.4.jar:5.4.0]
    at com.xuggle.mediatool.MediaReader.<init>(MediaReader.java:137) [xuggle-xuggler-5.4.jar:5.4.0]
    at com.xuggle.mediatool.ToolFactory.makeReader(ToolFactory.java:77) [xuggle-xuggler-5.4.jar:5.4.0]
    at logic.server.MediaCoder.createEncodingJobs(MediaCoder.java:39) [idoms-server:na]
    at controllers.FileCopyJob$ProgressListener.actionPerformed(FileCopyJob.java:127) [idoms-server:na]
    at controllers.FileCopyJob$DownloadCountingOutputStream.afterWrite(FileCopyJob.java:84) [idoms-server:na]
    at org.apache.commons.io.output.ProxyOutputStream.write(ProxyOutputStream.java:92) [commons-io-2.0.1.jar:2.0.1]
    at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1263) [commons-io-2.0.1.jar:2.0.1]
    at org.apache.commons.io.IOUtils.copy(IOUtils.java:1236) [commons-io-2.0.1.jar:2.0.1]
    at controllers.FileCopyJob.doJob(FileCopyJob.java:58) [idoms-server:na]
    at play.jobs.Job.doJobWithResult(Job.java:50) [play-1.2.4.jar:na]
    at play.jobs.Job.call(Job.java:146) [play-1.2.4.jar:na]
    at play.jobs.Job$1.call(Job.java:66) [play-1.2.4.jar:na]
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [na:1.6.0_26]
    at java.util.concurrent.FutureTask.run(FutureTask.java:138) [na:1.6.0_26]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98) [na:1.6.0_26]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206) [na:1.6.0_26]
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [na:1.6.0_26]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [na:1.6.0_26]
    at java.lang.Thread.run(Thread.java:662) [na:1.6.0_26]
2012-05-04 08:49:02,015 ERROR ~ Could not load library: xuggle; version: 5; Visit http://www.xuggle.com/xuggler/faq/ to find common solutions to this problem
08:49:02,115 ERROR ~ 

@6a91glkdf
Error during job execution (controllers.FileCopyJob)

Oops: UnsatisfiedLinkError
An unexpected error occured caused by exception UnsatisfiedLinkError: no xuggle in java.library.path

play.exceptions.UnexpectedException: Unexpected Error
    at play.Invoker$Invocation.onException(Invoker.java:244)
    at play.jobs.Job.onException(Job.java:124)
    at play.jobs.Job.call(Job.java:163)
    at play.jobs.Job$1.call(Job.java:66)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.UnsatisfiedLinkError: no xuggle in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1738)
    at java.lang.Runtime.loadLibrary0(Runtime.java:823)
    at java.lang.System.loadLibrary(System.java:1028)
    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.IContainer.<clinit>(IContainer.java:1622)
    at com.xuggle.mediatool.MediaReader.<init>(MediaReader.java:137)
    at com.xuggle.mediatool.ToolFactory.makeReader(ToolFactory.java:77)
    at logic.server.MediaCoder.createEncodingJobs(MediaCoder.java:39)
    at controllers.FileCopyJob$ProgressListener.actionPerformed(FileCopyJob.java:127)
    at controllers.FileCopyJob$DownloadCountingOutputStream.afterWrite(FileCopyJob.java:84)
    at org.apache.commons.io.output.ProxyOutputStream.write(ProxyOutputStream.java:92)
    at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1263)
    at org.apache.commons.io.IOUtils.copy(IOUtils.java:1236)
    at controllers.FileCopyJob.doJob(FileCopyJob.java:58)
    at play.jobs.Job.doJobWithResult(Job.java:50)
    at play.jobs.Job.call(Job.java:146)
    ... 8 more
هل كانت مفيدة؟

المحلول

Then problem is the temporary directory used to store the binaries. As the other instance created this temp location, the second process under a different user name didn't have access right. The developers arevnow aware of the issue. Removing the temp directory or granting rights solves the issue

نصائح أخرى

Although this question is quite old and xuggle has been deprecated, I thought I'd still show others how I solved this problem after looking at the comments here.

One can set the java.io.tmpdir property instead of deleting the folder or changing its permissions.

Like this for example:

java -Djava.io.tmpdir="~/custom/tempdir/" HelloWorld

Background:

As suggested by a comment from another answer, tracing the root of the problem back to the function that creates the temporary folder in question, shows that java uses a default location that can be customized.

public static File createTempFile(String prefix,
                                  String suffix,
                                  File directory)
                           throws IOException

Creates a new empty file in the specified directory, using the given prefix and suffix strings to generate its name. If this method returns successfully then it is guaranteed that:

  1. The file denoted by the returned abstract pathname did not exist before this method was invoked, and
  2. Neither this method nor any of its variants will return the same abstract pathname again in the current invocation of the virtual machine.

[...]

If the directory argument is null then the system-dependent default temporary-file directory will be used. The default temporary-file directory is specified by the system property java.io.tmpdir. On UNIX systems the default value of this property is typically "/tmp" or "/var/tmp"; on Microsoft Windows systems it is typically "C:\WINNT\TEMP". A different value may be given to this system property when the Java virtual machine is invoked, but programmatic changes to this property are not guaranteed to have any effect upon the temporary directory used by this method.

See:

  1. JavaDoc createTempFile(String, String, File)
  2. Old Google Groups discussion
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top