任务工作流程: 使用网络摄像头拍摄照片并保存在目录中并加载该图像以进行 opencv 检测(人脸)
第一次在 Ubuntu 中运行程序时,图像未保存并发生异常。
错误1:
HTTP 状态 500 -
类型异常报告
信息
description The server encountered an internal error () that prevented it from fulfilling this request.
例外
javax.servlet.ServletException: Servlet execution threw an exception
root cause
java.lang.UnsatisfiedLinkError: /var/cache/tomcat6/temp/javacpp8724578391270070/libjniopencv_core.so: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /var/cache/tomcat6/temp/javacpp8724578391270070/libopencv_core.so.2.4)
java.lang.ClassLoader$NativeLibrary.load(Native Method)
java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1750)
java.lang.ClassLoader.loadLibrary(ClassLoader.java:1646)
java.lang.Runtime.load0(Runtime.java:787)
java.lang.System.load(System.java:1022)
com.googlecode.javacpp.Loader.loadLibrary(Loader.java:566)
com.googlecode.javacpp.Loader.load(Loader.java:489)
com.googlecode.javacpp.Loader.load(Loader.java:431)
com.googlecode.javacv.cpp.opencv_core.<clinit>(opencv_core.java:136)
java.lang.Class.forName0(Native Method)
java.lang.Class.forName(Class.java:266)
com.googlecode.javacpp.Loader.load(Loader.java:453)
com.googlecode.javacv.cpp.opencv_imgproc.<clinit>(opencv_imgproc.java:97)
java.lang.Class.forName0(Native Method)
java.lang.Class.forName(Class.java:266)
com.googlecode.javacpp.Loader.load(Loader.java:453)
com.googlecode.javacv.cpp.opencv_highgui.<clinit>(opencv_highgui.java:85)
facerecognition.javafaces.TestServlet.doPost(TestServlet.java:104)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause
java.lang.UnsatisfiedLinkError: /var/cache/tomcat6/temp/javacpp8724578391270070/libopencv_core.so.2.4: libtbb.so: cannot open shared object file: No such file or directory
java.lang.ClassLoader$NativeLibrary.load(Native Method)
java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1750)
java.lang.ClassLoader.loadLibrary(ClassLoader.java:1646)
java.lang.Runtime.load0(Runtime.java:787)
java.lang.System.load(System.java:1022)
com.googlecode.javacpp.Loader.loadLibrary(Loader.java:566)
com.googlecode.javacpp.Loader.load(Loader.java:481)
com.googlecode.javacpp.Loader.load(Loader.java:431)
com.googlecode.javacv.cpp.opencv_core.<clinit>(opencv_core.java:136)
java.lang.Class.forName0(Native Method)
java.lang.Class.forName(Class.java:266)
com.googlecode.javacpp.Loader.load(Loader.java:453)
com.googlecode.javacv.cpp.opencv_imgproc.<clinit>(opencv_imgproc.java:97)
java.lang.Class.forName0(Native Method)
java.lang.Class.forName(Class.java:266)
com.googlecode.javacpp.Loader.load(Loader.java:453)
com.googlecode.javacv.cpp.opencv_highgui.<clinit>(opencv_highgui.java:85)
facerecognition.javafaces.TestServlet.doPost(TestServlet.java:104)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note Apache Tomcat/6.0.24 日志中提供了根本原因的完整堆栈跟踪。
当程序第二次运行时,图像被保存但发生异常
错误2:
HTTP 状态 500 -
类型异常报告
信息
描述 服务器遇到一个内部错误 () 阻止它完成这个请求。
例外
javax.servlet.ServletException: Servlet execution threw an exception
root cause
java.lang.NoClassDefFoundError: Could not initialize class com.googlecode.javacv.cpp.opencv_highgui
facerecognition.javafaces.TestServlet.doPost(TestServlet.java:104)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note Apache Tomcat/6.0.24 日志中提供了根本原因的完整堆栈跟踪。
我使用了try catch,但出现异常。程序在Windows中运行时没有问题。