# python4j spring boot jar PythonExecutioner init error

**URL:** <https://community.konduit.ai/t/python4j-spring-boot-jar-pythonexecutioner-init-error/2950>\
**Category:** Uncategorized\
**Created:** [December 9, 2023, 12:45pm UTC](https://community.konduit.ai/t/python4j-spring-boot-jar-pythonexecutioner-init-error/2950 "2023-12-09T12:45:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aizhimin](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/aizhimin/32/1244_2.png) [@aizhimin](https://community.konduit.ai/u/aizhimin)\
**Post date:** [December 9, 2023, 12:45pm UTC](https://community.konduit.ai/t/python4j-spring-boot-jar-pythonexecutioner-init-error/2950/1 "2023-12-09T12:45:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![agibsonccc](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/agibsonccc/32/697_2.png) [@agibsonccc](https://community.konduit.ai/u/agibsonccc)\
**Post date:** [December 9, 2023, 12:46pm UTC](https://community.konduit.ai/t/python4j-spring-boot-jar-pythonexecutioner-init-error/2950/2 "2023-12-09T12:46:56Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![aizhimin](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/aizhimin/32/1244_2.png) [@aizhimin](https://community.konduit.ai/u/aizhimin)\
**Post date:** [December 9, 2023, 1:15pm UTC](https://community.konduit.ai/t/python4j-spring-boot-jar-pythonexecutioner-init-error/2950/3 "2023-12-09T13:15:38Z")

</div>

The javacpp’s bug, it needs javacpp 1.5.9.

> <https://github.com/bytedeco/javacpp-presets/issues/1319>
>
> Spring boot 3.0.2 app.
> build with spring-boot-maven-plugin.
> 
> stack
> \`\`\`bash
> …app\_1 | java.io.FileNotFoundException: JAR entry org/bytedeco/cpython/linux-x86\_64/lib/pkgconfig/libssl.pc not found in /opt/target/dist.jar
> app\_1 | at org.springframework.boot.loader.jar.JarURLConnection.throwFileNotFound(JarURLConnection.java:175)
> app\_1 | at org.springframework.boot.loader.jar.JarURLConnection.connect(JarURLConnection.java:98)
> app\_1 | at org.springframework.boot.loader.jar.JarURLConnection.getJarFile(JarURLConnection.java:106)
> app\_1 | at org.bytedeco.javacpp.Loader.extractResource(Loader.java:777)
> app\_1 | at org.bytedeco.javacpp.Loader.extractResource(Loader.java:756)
> app\_1 | at org.bytedeco.javacpp.Loader.extractResource(Loader.java:803)
> app\_1 | at org.bytedeco.javacpp.Loader.cacheResource(Loader.java:684)
> app\_1 | at org.bytedeco.javacpp.Loader.cacheResource(Loader.java:477)
> app\_1 | at org.bytedeco.javacpp.Loader.cacheResource(Loader.java:444)
> app\_1 | at org.bytedeco.javacpp.Loader.cacheResource(Loader.java:432)
> app\_1 | at org.bytedeco.cpython.presets.python.cachePackage(python.java:222)
> app\_1 | at org.bytedeco.cpython.presets.python.cachePackages(python.java:264)
> app\_1 | at com.moveo.analysis.utils.Python.configpkg(Python.java:90)
> app\_1 | at com.moveo.analysis.utils.Python.\<clinit\>(Python.java:25)
> \`\`\`
> 
> I imagine this is a config problem, as it works locally without building the jar.
> 
> Any direction?

---

<div class="post-metadata">

**Author:** ![agibsonccc](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/agibsonccc/32/697_2.png) [@agibsonccc](https://community.konduit.ai/u/agibsonccc)\
**Post date:** [December 10, 2023, 6:05am UTC](https://community.konduit.ai/t/python4j-spring-boot-jar-pythonexecutioner-init-error/2950/4 "2023-12-10T06:05:35Z")

</div>

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