If that works, let me know. I cannot test it today because in a fit of intense stupidity I just spilled hot tea all over my development laptop :(
- Art
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?
Is it possibly this is a location the other install has already used, and which is running under another user account? If I run it as root it works fine, suggesting that it is just a permission issue, but I cannot find what to change as the working directory etc. is all owned by the user running it. I don't want the framework to run as root.
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 ~
--
You received this message because you are subscribed to the Google Groups "xuggler-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/xuggler-users/-/0eEc99A5fDsJ.
To post to this group, send email to xuggle...@googlegroups.com.
To unsubscribe from this group, send email to xuggler-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/xuggler-users?hl=en.
That's a good catch. It may explain another error happening for some users. In Xuggler 5.4 we create a temporary file on disk, using Java's File#createTempFile:
http://docs.oracle.com/javase/1.5.0/docs/api/java/io/File.html#createTempFile%28java.lang.String,%20java.lang.String%29
We then load that temporary file (which will have the contents of the correct libxuggle native object copied to it) as a dynamic library in Java.
For the prefix variable I pass in "xuggle" and rely on the createTempFile call to create a unique file. However my guess is Java ensures the file is unique PER PROCESS. In reality, we need to create a unique file per invocation of a load.
To try a workaround, modify src/com/xuggle/ferry/JNILibraryLoader.java line 275 to add a random string to the prefix and see if that helps the problem go away (it is left as an exercise for the reader to how to do this without recompiling all the native code, but if you like, a quick and dirty hack is:
- copy your current xuggle-xuggler.jar file somewhere
- make the edits and then run "ant stage-java" in your source tree; this will generate a new xuggle-xuggler.jar (although native code might not be staged)
- unzip dist/lib/xuggle-xuggle.jar and find the file com/xuggle/ferry/JNILibraryLoader.class
- unzip your old xuggle-xuggler.jar to a location, and replace com/xuggle/ferry/JNILibraryLoader.class with your modified class file
- re-zip the directory to create your new xuggle-xuggler.jar file)
If that works, let me know. I cannot test it today because in a fit of intense stupidity I just spilled hot tea all over my development laptop :(
- Art
On Fri, May 4, 2012 at 7:39 AM, Luuk Dominiek Jansen OPwrote:
To unsubscribe from this group, send email to xuggler-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/xuggler-users?hl=en.