From 3c68657b97980a25d3cdeca901fe397f8639c7fb Mon Sep 17 00:00:00 2001 From: huazai023 <46566922+huazai023@users.noreply.github.com> Date: Thu, 26 Sep 2024 18:17:01 +0800 Subject: [PATCH] resolve the issue of java.lang.PullPointer Exception in springboot jar --- zenoh-java/src/jvmMain/kotlin/io/zenoh/Zenoh.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zenoh-java/src/jvmMain/kotlin/io/zenoh/Zenoh.kt b/zenoh-java/src/jvmMain/kotlin/io/zenoh/Zenoh.kt index d6b7dd9b..6a1acd66 100644 --- a/zenoh-java/src/jvmMain/kotlin/io/zenoh/Zenoh.kt +++ b/zenoh-java/src/jvmMain/kotlin/io/zenoh/Zenoh.kt @@ -108,7 +108,7 @@ internal actual class Zenoh private actual constructor() { } private fun loadLibraryAsInputStream(target: Target): Result = runCatching { - val libUrl = ClassLoader.getSystemClassLoader().getResourceAsStream("$target/$target.zip")!! + val libUrl = javaClass.getResourceAsStream("/$target/$target.zip")!! val uncompressedLibFile = unzipLibrary(libUrl) return Result.success(FileInputStream(uncompressedLibFile.getOrThrow())) }