Closed blakemcbride closed 2 months ago
that can't work, because of this:
- The system libsqlite3.so lacks the JNI bindings required by the SQLite JDBC driver.
This is how JNI works, you need a specifically compiled library containing the JNI code.
You can check how to compile against your own version of sqlite here: https://github.com/xerial/sqlite-jdbc/blob/02bac1a4a5d28a08334d197d3a3bb246fab9cb05/.github/workflows/ci.yml#L161-L181
Then, what is the purpose of:
-Dorg.sqlite.lib.path=/usr/lib64 -Dorg.sqlite.lib.name=libsqlite3.so
Then, what is the purpose of:
-Dorg.sqlite.lib.path=/usr/lib64 -Dorg.sqlite.lib.name=libsqlite3.so
to use the binaries you have compiled yourself, for example for architectures that we don't ship in the jar, or if you build against your own amalgamation (as in the workflow i linked above). Or to use a specific version of SQLite that you could have extracted from a previous version of the sqlite-jdbc jar.
Describe the bug
When using the SQLite JDBC driver with the system-installed libsqlite3.so on both Linux and OpenIndiana platforms (and presumably others), the Java application fails with an UnsatisfiedLinkError. The driver cannot find the required JNI method implementations in the system's SQLite library.
To Reproduce
Install the SQLite JDBC driver (e.g., sqlite-jdbc-3.46.1.0.jar).
Ensure that the system's libsqlite3.so is present in /usr/lib64.
Run the Java application with the following JVM options:
Expected behavior
The application should successfully establish a connection to the SQLite database using the system-installed libsqlite3.so without any errors.
Logs
Environment (please complete the following information):
Additional context
The system libsqlite3.so lacks the JNI bindings required by the SQLite JDBC driver.
This issue occurs when attempting to use the system-installed SQLite library instead of the native library bundled within the driver JAR.
The problem is consistent across both Linux and OpenIndiana platforms.
Is there a way to configure the driver to work with the system libsqlite3.so without rebuilding the driver or creating custom JNI libraries?
Allowing the driver to use the system's SQLite library would enhance compatibility and simplify deployment.