java.lang.Exception:java.lang.UnsatisfiedLinkError:

时间:2014-07-31 13:20:35

标签: java opencv hadoop javacv

执行我的Hadoop应用程序时,出现以下错误:

java.lang.Exception: java.lang.UnsatisfiedLinkError: /tmp/javacpp5024882630141562/libjniopencv_core.so: libopencv_core.so.2.3: cannot open shared object file: No such file or directory
        at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:399)
Caused by: java.lang.UnsatisfiedLinkError: /tmp/javacpp5024882630141562/libjniopencv_core.so: libopencv_core.so.2.3: cannot open shared object file: No such file or directory
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1957)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1882)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1843)
        at java.lang.Runtime.load0(Runtime.java:795)
        at java.lang.System.load(System.java:1061)
        at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:422)
        at com.googlecode.javacpp.Loader.load(Loader.java:372)
        at com.googlecode.javacpp.Loader.load(Loader.java:319)
        at com.googlecode.javacv.cpp.opencv_core.<clinit>(opencv_core.java:136)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:270)
        at com.googlecode.javacpp.Loader.load(Loader.java:338)
        at com.googlecode.javacv.cpp.opencv_imgproc.<clinit>(opencv_imgproc.java:97)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:270)
        at com.googlecode.javacpp.Loader.load(Loader.java:338)
        at com.googlecode.javacv.cpp.opencv_highgui.<clinit>(opencv_highgui.java:85)
        at com.googlecode.javacv.OpenCVFrameGrabber.start(OpenCVFrameGrabber.java:169)
        at HFD.videoprocessing.utils.VideoRecordReader.initialize(VideoRecordReader.java:58)
        at HFD.videoprocessing.utils.VideoInputFormat.createRecordReader(VideoInputFormat.java:30)
        at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.<init>(MapTask.java:456)
        at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:698)
        at org.apache.hadoop.mapred.MapTask.run(MapTask.java:333)
        at org.apache.hadoop.mapred.LocalJobRunner$Job$MapTaskRunnable.run(LocalJobRunner.java:231)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:724)

任何帮助?

1 个答案:

答案 0 :(得分:2)

尝试以下方法: 1)运行sudo ldconfig并检查是否有效。

如果以上不起作用

2)打开文件/etc/ld.so.conf.d/opencv.conf并在其中插入以下内容 /usr/local/opencv/

然后输入:sudo ldconfig

如果您无法找到opencv.conf尝试locate opencv.conf在系统中找到它