You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When running inside a 32-bit JVM on a aarch64 processor, sqlite-jdbc tries to load the aarch64 native library. This of course fails.
To Reproduce
package org.example;
import java.sql.DriverManager;
public class Main {
public static void main(String[] args) throws Exception {
System.out.println("Arch: " + System.getProperty("sun.arch.data.model"));
try (var connection = DriverManager.getConnection("jdbc:sqlite:/tmp/test.db");
var statement = connection.createStatement();
var result = statement.executeQuery("SELECT RANDOM();")) {
while (result.next()) {
System.out.println("Output: " + result.getLong(1));
}
}
}
}
Expected behavior
As the code is running inside a 32-bit JVM, the arm, armv6 or armv7 native library should be loaded.
Logs
Output:
Arch: 32
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
OpenJDK Client VM warning: You have loaded library /tmp/sqlite-3.46.0.0-51c6d6c2-c417-498d-9da6-fb79c3df716a-libsqlitejdbc.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
Exception in thread "main" java.sql.SQLException: Error opening connection
at org.sqlite.SQLiteConnection.open(SQLiteConnection.java:283)
at org.sqlite.SQLiteConnection.<init>(SQLiteConnection.java:67)
at org.sqlite.jdbc3.JDBC3Connection.<init>(JDBC3Connection.java:28)
at org.sqlite.jdbc4.JDBC4Connection.<init>(JDBC4Connection.java:19)
at org.sqlite.JDBC.createConnection(JDBC.java:106)
at org.sqlite.JDBC.connect(JDBC.java:79)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:681)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:252)
at org.example.Main.main(Main.java:9)
Caused by: org.sqlite.NativeLibraryNotFoundException: No native library found for os.name=Linux, os.arch=aarch64, paths=[/org/sqlite/native/Linux/aarch64:/usr/java/packages/lib:/usr/lib/arm-linux-gnueabihf/jni:/lib/arm-linux-gnueabihf:/usr/lib/arm-linux-gnueabihf:/usr/lib/jni:/lib:/usr/lib]
at org.sqlite.SQLiteJDBCLoader.loadSQLiteNativeLibrary(SQLiteJDBCLoader.java:361)
at org.sqlite.SQLiteJDBCLoader.initialize(SQLiteJDBCLoader.java:75)
at org.sqlite.core.NativeDB.load(NativeDB.java:69)
at org.sqlite.SQLiteConnection.open(SQLiteConnection.java:280)
... 8 more
Environment (please complete the following information):
OS: Raspberry Pi OS
CPU architecture: aarch64
sqlite-jdbc version: 3.46.0.0
Additional context
The text was updated successfully, but these errors were encountered:
Describe the bug
When running inside a 32-bit JVM on a aarch64 processor, sqlite-jdbc tries to load the aarch64 native library. This of course fails.
To Reproduce
Expected behavior
As the code is running inside a 32-bit JVM, the
arm
,armv6
orarmv7
native library should be loaded.Logs
Output:
Environment (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: