bytedeco / javacv

Java interface to OpenCV, FFmpeg, and more
Other
7.39k stars 1.56k forks source link

UnsatisfiedLinkError: java.net.URISyntaxException: Illegal character in opaque part at index 22: jar:nested:/C:/Program Files/MyApp/app/MyApp-0.9.3-SNAPSHOT.jar/!BOOT-INF/lib/openblas-0.3.26-1.5.10-windows-x86_64.jar!/org/bytedeco/openblas/windows-x86_64/jniopenblas_nolapack.dll #2202

Closed mtvgn closed 3 months ago

mtvgn commented 3 months ago

Hi!

I've got this java program which works fine from either the command line with 'java-jar app.jar' or from intellij, but when I 'mvn clean install' it with mvn clean install -Djavacpp.platform=windows-x86_64 and then package it with jpackage --input target/ --name MyApp --main-jar MyApp-0.9.3-SNAPSHOT.jar --app-version 0.9.3 --main-class org.springframework.boot.loader.launch.JarLauncher --type msi --win-console and install the msi, the installed exe won't start because of this error message in the title, even though the dll is actually present in the jar (see screencap)

I updated version 1.5.9 of the org.bytedeco package I was using to 1.5.10 hoping that would help, but it didn't

A couple of months ago I could run the program I created from this project, but of course a lot has changed since then and I wonder what of the many changes could cause this. But this error seems weird as the UnsatisfiedLink is to a dll that is actually present in the package and I'm running Windows 10, so the platform seems correct Unsatisfied

saudet commented 3 months ago

Sounds like a bug in Spring Boot...

saudet commented 3 months ago

For some reason, Spring Boot returns resource URLs with spaces in them. That's not something that we can use. They'll need to get that fixed.

mtvgn commented 3 months ago

Thanks for your research!

I was using org.springframework.boot:spring-boot-starter-parent version 3.2.0 when I got this error and it sure had worked with some 3.1.x version before.

The first thing I tried after reading your comment is the newest version, 3.2.3, and with that the bug no longer happens, so the people at spring boot already fixed it in the meantime.

Just giving the version numbers in this comment as it might help anyone in the future :-)