python4j spring boot jar PythonExecutioner init error

In spring boot application, I builded a jar with maven 3.9.5, and then run it: java -jar true-north.jar.

PythonExecutioner.init got a error:

java.lang.ExceptionInInitializerError: null
at com.banji.truenorth.runner.ApplicationInitRunner.run(ApplicationInitRunner.java:16)
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:756)
at org.springframework.boot.SpringApplication.lambda$callRunners$2(SpringApplication.java:746)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
at java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:357)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:744)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1300)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1289)
at com.banji.truenorth.TrueNorthApplication.main(TrueNorthApplication.java:16)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:65)
Caused by: java.lang.RuntimeException: java.io.FileNotFoundException: JAR entry org/bytedeco/cpython/windows-x86_64/bin/python.exe not found in D:\java_work\TrueNorth-Server\start\target\true-north.jar
at org.nd4j.python4j.PythonExecutioner.initPythonPath(PythonExecutioner.java:363)
at org.nd4j.python4j.PythonExecutioner.init(PythonExecutioner.java:79)
at org.nd4j.python4j.PythonExecutioner.(PythonExecutioner.java:70)
… 24 common frames omitted
Caused by: java.io.FileNotFoundException: JAR entry org/bytedeco/cpython/windows-x86_64/bin/python.exe not found in D:\java_work\TrueNorth-Server\start\target\true-north.jar
at org.springframework.boot.loader.jar.JarURLConnection.throwFileNotFound(JarURLConnection.java:175)
at org.springframework.boot.loader.jar.JarURLConnection.connect(JarURLConnection.java:98)
at org.springframework.boot.loader.jar.JarURLConnection.getJarFile(JarURLConnection.java:106)
at org.bytedeco.javacpp.Loader.extractResource(Loader.java:777)
at org.bytedeco.javacpp.Loader.extractResource(Loader.java:756)
at org.bytedeco.javacpp.Loader.extractResource(Loader.java:803)
at org.bytedeco.javacpp.Loader.cacheResource(Loader.java:684)
at org.bytedeco.javacpp.Loader.cacheResource(Loader.java:477)
at org.bytedeco.javacpp.Loader.cacheResource(Loader.java:444)
at org.bytedeco.javacpp.Loader.cacheResource(Loader.java:432)
at org.bytedeco.cpython.presets.python.cachePackage(python.java:222)
at org.bytedeco.cpython.presets.python.cachePackages(python.java:264)
at org.nd4j.python4j.PythonExecutioner.cachePackages(PythonExecutioner.java:372)
at org.nd4j.python4j.PythonExecutioner.initPythonPath(PythonExecutioner.java:323)
… 26 common frames omitted

@aizhimin same ask as on the issue. Please post more information to make sure it’s not a native loading issue.
This:
Caused by: java.io.FileNotFoundException: JAR entry org/bytedeco/cpython/windows-x86_64/bin/python.exe not found in D:\java_work\TrueNorth-Server\start\target\true-north.jar
at

either indicates the python file has a native (think dll hell) type conflict or you’re missing something in your dependencies. While you’re at it, could you post your pom.xml please? I don’t want any company secrets or anything just the relevant parts mainly. python4j and spring boot and any other open source 3rd party libraries you might be using.

The javacpp’s bug, it needs javacpp 1.5.9.

@aizhimin that’s already fixed in the latest then.I would try forcing the javacpp 1.5.9 dependency via dependemcnyManagement.