openziti / ziti-sdk-jvm

Ziti SDK for JVM
https://openziti.org
Apache License 2.0
54 stars 12 forks source link

OpenZiti Crypto loading error #178

Closed dineshsnf closed 3 years ago

dineshsnf commented 3 years ago

Hi, I am using ziti sdk v0.21.0 in my application and it is packaged as a fat/one jar. When I try to do a zitisocket connect, I get the following error: I tried searching a bit on the net and tried few suggestions but did not work. Please take a look

java.lang.ExceptionInInitializerError: null at org.openziti.net.ZitiSocketChannel$connect$2.invokeSuspend(ZitiSocketChannel.kt:149) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665) Caused by: com.goterl.resourceloader.ResourceLoaderException: Failed to load the bundled library from resources by relative path (mac/libsodium.dylib) at com.goterl.resourceloader.SharedLibraryLoader.load(SharedLibraryLoader.java:66) at com.goterl.lazysodium.utils.LibraryLoader.loadBundledLibrary(LibraryLoader.java:134) at com.goterl.lazysodium.utils.LibraryLoader.loadLibrary(LibraryLoader.java:107) at com.goterl.lazysodium.SodiumJava.(SodiumJava.java:34) at org.openziti.crypto.JavaCryptoLoader.load(JavaCryptoLoader.kt:26) at org.openziti.crypto.Crypto.(Crypto.kt:49) ... 7 common frames omitted Caused by: java.io.IOException: Failed to list contents of file:/Users/dineshsubramanian/nfprojects/clientsync/target/clientsync-0.0.1-SNAPSHOT.jar!/BOOT-INF/lib/lazysodium-java-5.0.1.jar!/mac/libsodium.dylib at com.goterl.resourceloader.ResourceLoader.doCopyDirectory(ResourceLoader.java:362) at com.goterl.resourceloader.ResourceLoader.copyDirectory(ResourceLoader.java:354) at com.goterl.resourceloader.ResourceLoader.getFileFromFileSystem(ResourceLoader.java:248) at com.goterl.resourceloader.ResourceLoader.copyToTempDirectory(ResourceLoader.java:88) at com.goterl.resourceloader.SharedLibraryLoader.load(SharedLibraryLoader.java:53) ... 12 common frames omitted

ekoby commented 3 years ago

this is an issue with packaging plugin (fat/one jar). there is nothing we can do here