GlassFish - UnsatisfiedLinkError: no jniopencv_core in java.library.path

555 views
Skip to first unread message

Marcelo

unread,
Jul 1, 2011, 3:57:06 PM7/1/11
to javacv
Hi...

I developed a face detect application in GUI (it is work fine) and now
I'm trying to develop a services to consume this.
My current server is the "GlassFish Server 3.1" and the following
error occurs when the services is used:

Caused by: java.lang.UnsatisfiedLinkError: no jniopencv_core in
java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1754)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1045)
at com.googlecode.javacpp.Loader.load(Loader.java:343)
at com.googlecode.javacpp.Loader.load(Loader.java:271)
at com.googlecode.javacv.cpp.opencv_core.<clinit>(opencv_core.java:
125)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at com.googlecode.javacpp.Loader.load(Loader.java:291)
at service.Manager.verify(Manager.java:36)
at service.VerifyResource.putXml(VerifyResource.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:
1052)
at
org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:
1124)
at
com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:
5367)
at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:619)
at
com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:
801)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:571)
at
com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doAround(SystemInterceptorProxy.java:
162)
at
com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:
144)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:
862)
at
com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:
801)
at
com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:
371)
at
com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:
5339)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:
5327)
at
com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:
214)
... 46 more

Samuel Audet

unread,
Jul 1, 2011, 9:11:31 PM7/1/11
to jav...@googlegroups.com
On 2011-07-02 04:57, Marcelo wrote:
> Hi...
>
> I developed a face detect application in GUI (it is work fine) and now
> I'm trying to develop a services to consume this.
> My current server is the "GlassFish Server 3.1" and the following
> error occurs when the services is used:
>
> Caused by: java.lang.UnsatisfiedLinkError: no jniopencv_core in
> java.library.path

At runtime JavaCV/JavaCPP can behave just like JNI, so simply do
whatever you need to do with .dll/.so/.dylib files and it should work..
These containers usually need us to do something special in the case of JNI.

Samuel

Marcelo Beckmann

unread,
Jul 2, 2011, 6:00:42 AM7/2/11
to jav...@googlegroups.com
This happens because the orignal class loader (that you did the tests) was changed by the glassfish container.
In tomcat service I've got the same error. To fix it, be sure the opencv is in classpath, and If not work, try to put the opencv DLL in the glassfish bin.

[]´s
--
Marcelo Beckmann

VIKAS SINHA

unread,
Sep 22, 2017, 10:01:55 AM9/22/17
to javacv
Hi,

I am using Netbeans 8.2 with GlassFish 4.1.1. I have started working on javaCV face recognition but getting below error. Please refer the attached screenshot for Library used with sample code.



Exception in thread "main" java.lang.UnsatisfiedLinkError: no jniopencv_core in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:976)
at org.bytedeco.javacpp.Loader.load(Loader.java:777)
at org.bytedeco.javacpp.Loader.load(Loader.java:684)
at org.bytedeco.javacpp.opencv_core.<clinit>(opencv_core.java:10)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.bytedeco.javacpp.Loader.load(Loader.java:739)
at org.bytedeco.javacpp.Loader.load(Loader.java:684)
at org.bytedeco.javacpp.opencv_imgcodecs.<clinit>(opencv_imgcodecs.java:13)
at facerecognition.FaceRecognition.main(FaceRecognition.java:22)
Caused by: java.lang.UnsatisfiedLinkError: no opencv_imgproc320 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:976)
at org.bytedeco.javacpp.Loader.load(Loader.java:765)
... 8 more

Regards,
Vikas Sinha
Capture.PNG
Capture1.PNG

VIKAS SINHA

unread,
Sep 30, 2017, 5:52:36 AM9/30/17
to javacv
Hi,

Thank you, this is fixed now.

Regards,
Vikas Sinha
Reply all
Reply to author
Forward
0 new messages