kohlschutter / junixsocket

Unix Domain Sockets in Java 7 and newer (AF_UNIX), AF_TIPC, AF_VSOCK, and more
Apache License 2.0
433 stars 114 forks source link

Could not load native library junixsocket-native for architecture amd64-Linux #126

Closed wuxianseng closed 1 year ago

wuxianseng commented 1 year ago

Describe the bug A clear and concise description of what the bug is. error infomation is: Get connection failed, the reason is [Could not load native library junixsocket-native for architecture amd64-Linux], detail: java.lang.UnsatisfiedLinkError: Could not load native library junixsocket-native for architecture amd64-Linux Could not initialize class org.newsclub.net.unix.AFUNIXSocketAddress], detail: java.lang.NoClassDefFoundError: Could not initialize class org.newsclub.net.unix.AFUNIXSocketAddress', clientIP=127.0.0.1.]\n <-- Could not initialize class org.newsclub.net.unix.AFUNIXSocketAddress

To Reproduce Steps to reproduce the behavior:

  1. jdbc use junixsocket-common-2.4.0.jar and junixsocket-native-common-2.4.0.jar to connect database
  2. This is an occasional problem

Expected behavior jdbc can connect to database

Output/Screenshots If applicable, add console output/screenshots to help explain your problem.

Get connection failed, the reason is [Could not load native library junixsocket-native for architecture amd64-Linux], detail: java.lang.UnsatisfiedLinkError: Could not load native library junixsocket-native for architecture amd64-Linux Could not initialize class org.newsclub.net.unix.AFUNIXSocketAddress], detail: java.lang.NoClassDefFoundError: Could not initialize class org.newsclub.net.unix.AFUNIXSocketAddress', clientIP=127.0.0.1.]\n <-- Could not initialize class org.newsclub.net.unix.AFUNIXSocketAddress

Environment (please complete the following information): Linux version 4.18.0-147.5.2.15.h1109.eulerosv2r10.x86_64 (abuild@szxrtosci10000) (gcc version 7.3.0 (GCC)) #1 SMP Thu Dec 8 04:08:54 UTC 2022

Please also add the output of java -jar junixsocket-selftest-x.y.z-SNAPSHOT-jar-with-dependencies.jar (x.y.z being the latest version, e.g., 2.3.3). — The selftest jar is available from the junixsocket-dist package in the Release section.

Notes Add any other context about the problem here. Please link/attach any source code that is useful to diagnose the issue.

Lastly, please make sure to test the problem still occurs on the latest version of junixsocket All minor version updates (e.g., 2.4.x -> 2.5.x) are supposed to be backwards compatible. If you find that this isn't the case, please mention it in your report. Thank you!

kohlschuetter commented 1 year ago

Thanks for reporting! Does this still reproduce with junixsocket 2.6.1?

kohlschuetter commented 1 year ago

@wuxianseng Please re-test with 2.6.1

kohlschuetter commented 1 year ago

@wuxianseng Please re-test with 2.6.2. Closing due to inactivity. Re-open if you still encounter issues.