Open heshanthenura opened 8 months ago
Please try again with version 1.5.10
Ill try and tell you.
Please follow the instructions at https://github.com/bytedeco/javacpp-presets/wiki/Debugging-UnsatisfiedLinkError-on-Windows
Thank you, I'll try.
Did it work? If so, can you close this issue?
I met the same problem and searching for help……
Can you provide us with an MRE?
Just Call ‘Loader.load(opencv_java.class)’ under RHEL-7, Java 8 ,SpringBoot 2.7.2
with the dependency of javacv-platform 1.5.10, opencv-platform 1.5.10 , openblas-platform 1.5.10
It's worth noting that Spring Boot 2.7 no longer has OSS support.
I just tried it with my current setup and everything worked as expected (Spring Boot 3.2.4, OpenJDK Temurin-17.0.10+7).
mkdir mre &&
cd mre &&
curl https://start.spring.io/starter.tgz -d dependencies=web,devtools -d type=maven-project | tar -xzvf -
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>javacv-platform</artifactId>
<version>1.5.10</version>
</dependency>
Loader.load(opencv_java.class)
:package com.example.demo;
import org.bytedeco.javacpp.Loader;
import org.bytedeco.opencv.opencv_java;
import org.bytedeco.opencv.global.opencv_core;
import org.bytedeco.opencv.opencv_core.Mat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class Demo {
@GetMapping
public String doGet(){
Loader.load(opencv_java.class);
Mat mat = Mat.eye(3, 3, opencv_core.CV_8UC1).asMat();
return "mat = " + mat.toString() + "\n";
}
}
curl localhost:8080
# mat = org.bytedeco.opencv.opencv_core.Mat[width=3,height=3,depth=8,channels=1]
Did you do your test on red hat OS? My code can run well on windows10 but meet problem just on redhat7.
I am not in a position to directly experiment with the suggested setup at this time.
For anyone who is though, try creating a Dockerfile in the root directory of the MRE with the following content:
FROM registry.access.redhat.com/ubi8/openjdk-17:1.19-1
WORKDIR /app
COPY . .
RUN mvn clean package -DskipTests
EXPOSE 8080
CMD ["java", "-jar", "target/app-0.0.1-SNAPSHOT.jar"]
Then run:
docker build -t demo:tag . &&
docker run --rm -it demo:tag
I have a further problem. I found that problem is caused by that there is no CXXABI 1.3.8
in my environment. Does anyone have any idea on this?
I haven't used this library long enough to be able to troubleshoot problems, but I noticed it works out of the box in WSL (Ubuntu), but not in Git Bash (Windows), so I have a feeling strange errors might occur if you don't have GCC globally available in your environment when installing the dependencies. I haven't tested that theory though.
I got the libstdc.6.0.28.so, which can support CXXABI_1_3_8. I would have a try to replace libstdc.6.0.19.so with this file. I hope it can work.
I'm getting the original problem cited about the jniopenblas_nolapack not found. I've simply cloned the repo (version 1.5.10) and I'm trying to run the OpticalFlowDense.java example. Not having any luck find a solution on google. I'm using RHEL 9. Getting this error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no jniopenblas_nolapack in java.library.path: /home/cbrautigam/.javacpp/cache/lib64:/usr/local/lib:/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib:/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2458) at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:916) at java.base/java.lang.System.loadLibrary(System.java:2063) at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1832) at org.bytedeco.javacpp.Loader.load(Loader.java:1423) at org.bytedeco.javacpp.Loader.load(Loader.java:1234) at org.bytedeco.javacpp.Loader.load(Loader.java:1210) at org.bytedeco.openblas.global.openblas_nolapack.<clinit>(openblas_nolapack.java:12) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:534) at java.base/java.lang.Class.forName(Class.java:513) at org.bytedeco.javacpp.Loader.load(Loader.java:1289) at org.bytedeco.javacpp.Loader.load(Loader.java:1234) at org.bytedeco.javacpp.Loader.load(Loader.java:1210) at org.bytedeco.opencv.global.opencv_imgcodecs.<clinit>(opencv_imgcodecs.java:18) at OpticalFlowDense.main(OpticalFlowDense.java:20) Caused by: java.lang.UnsatisfiedLinkError: Could not find jniopenblas_nolapack in class, module, and library paths. at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1799) ... 12 more
Please set the "org.bytedeco.javacpp.logger.debug" system property to "true" to get more information on the console.
Here it is:
Debug: Loading class org.bytedeco.javacpp.presets.javacpp Debug: Loading class org.bytedeco.openblas.global.openblas_nolapack Debug: Loading class org.bytedeco.javacpp.presets.javacpp Debug: Loading class org.bytedeco.openblas.global.openblas_nolapack Debug: Loading /lib64/libgcc_s.so.1 Debug: Loading /lib64/libquadmath.so.0 Debug: Loading /lib64/libgfortran.so.5 Debug: Loading library gfortran Debug: Failed to load for gfortran@.4: java.lang.UnsatisfiedLinkError: no gfortran in java.library.path: /usr/local/lib:/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib Debug: Loading library gfortran Debug: Failed to load for gfortran@.3: java.lang.UnsatisfiedLinkError: no gfortran in java.library.path: /usr/local/lib:/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib Debug: Loading /home/cbrautigam/.javacpp/cache/lib64/libopenblas_nolapack.so.0 Debug: Loading library jniopenblas_nolapack Debug: Failed to load for jniopenblas_nolapack: java.lang.UnsatisfiedLinkError: no jniopenblas_nolapack in java.library.path: /usr/local/lib:/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib Exception in thread "main" java.lang.UnsatisfiedLinkError: no jniopenblas_nolapack in java.library.path: /usr/local/lib:/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2458) at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:916) at java.base/java.lang.System.loadLibrary(System.java:2063) at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1832) at org.bytedeco.javacpp.Loader.load(Loader.java:1423) at org.bytedeco.javacpp.Loader.load(Loader.java:1234) at org.bytedeco.javacpp.Loader.load(Loader.java:1210) at org.bytedeco.openblas.global.openblas_nolapack.<clinit>(openblas_nolapack.java:12) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:534) at java.base/java.lang.Class.forName(Class.java:513) at org.bytedeco.javacpp.Loader.load(Loader.java:1289) at org.bytedeco.javacpp.Loader.load(Loader.java:1234) at org.bytedeco.javacpp.Loader.load(Loader.java:1210) at org.bytedeco.opencv.global.opencv_imgcodecs.<clinit>(opencv_imgcodecs.java:18) at OpticalFlowDense.main(OpticalFlowDense.java:20) Caused by: java.lang.UnsatisfiedLinkError: Could not find jniopenblas_nolapack in class, module, and library paths. at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1799) ... 12 more
It looks like the libjniopenblas_nolapack.so isn't in your class path, you'll need to figure out why
I'm also facing the problem. It works well in windows, but failing in Ubuntu. Do I need to run any specific steps for Ubuntu?
2024-11-05 12:54:56 java.lang.UnsatisfiedLinkError: no jniopenblas_nolapack in java.library.path: /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
2024-11-05 12:54:56 at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2458)
2024-11-05 12:54:56 at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:916)
2024-11-05 12:54:56 at java.base/java.lang.System.loadLibrary(System.java:2063)
2024-11-05 12:54:56 at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1832)
2024-11-05 12:54:56 at org.bytedeco.javacpp.Loader.load(Loader.java:1423)
2024-11-05 12:54:56 at org.bytedeco.javacpp.Loader.load(Loader.java:1234)
2024-11-05 12:54:56 at org.bytedeco.javacpp.Loader.load(Loader.java:1210)
2024-11-05 12:54:56 at org.bytedeco.openblas.global.openblas_nolapack.<clinit>(openblas_nolapack.java:12)
2024-11-05 12:54:56 at java.base/java.lang.Class.forName0(Native Method)
2024-11-05 12:54:56 at java.base/java.lang.Class.forName(Class.java:534)
2024-11-05 12:54:56 at java.base/java.lang.Class.forName(Class.java:513)
2024-11-05 12:54:56 at org.bytedeco.javacpp.Loader.load(Loader.java:1289)
2024-11-05 12:54:56 at org.bytedeco.javacpp.Loader.load(Loader.java:1234)
2024-11-05 12:54:56 at org.bytedeco.javacpp.Loader.load(Loader.java:1226)
2024-11-05 12:54:56 Caused by: java.lang.UnsatisfiedLinkError: /root/.javacpp/cache/openblas-0.3.26-1.5.10-linux-x86_64.jar/org/bytedeco/openblas/linux-x86_64/libjniopenblas_nolapack.so: /usr/glibc/lib/libm.so.6: version `GLIBC_2.29' not found (required by /root/.javacpp/cache/openblas-0.3.26-1.5.10-linux-x86_64.jar/org/bytedeco/openblas/linux-x86_64/libopenblas_nolapack.so.0)
2024-11-05 12:54:56 at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
2024-11-05 12:54:56 at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:331)
2024-11-05 12:54:56 at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:197)
2024-11-05 12:54:56 at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:139)
2024-11-05 12:54:56 at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2418)
2024-11-05 12:54:56 at java.base/java.lang.Runtime.load0(Runtime.java:852)
2024-11-05 12:54:56 at java.base/java.lang.System.load(System.java:2025)
2024-11-05 12:54:56 at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1779)
2024-11-05 12:54:56 ... 13 common frames omitted
@javadroider Please upgrade your version of Ubuntu
Apologies for the confusion, I'm using Alpine as per the following docker file. Does it not support Alpine? Do you have any recommendations?
FROM ubuntu:22.04
RUN apt-get install nvidia-cuda-toolkit
FROM bellsoft/liberica-openjdk-alpine:21.0.2
VOLUME /tmp
ADD target/app-service-0.0.1-SNAPSHOT.jar app.jar
COPY target/classes/elasticsearch.jks /opt/xperio/elasticsearch.jks
RUN sh -c 'touch /app.jar'
EXPOSE 8090
ENTRYPOINT [ "sh", "-c", "java -Dspring.profiles.active=qa -jar /app.jar" ]
@javadroider Please refer to issue https://github.com/bytedeco/javacpp-presets/issues/1379
anyone know how to fix this error?