"java.lang.NoClassDefFoundError: org/sqlite/NativeDB" is raised by sqlite-jdbc-3.8.5-pre1 on Mac OS

Issue #147 resolved
Shigeru Fujiwara
created an issue

When using sqlite-jdbc-3.8.5-pre1.jar under 32bit JVM on Mac OS, Loading native library failed with the following error. It seems to like issue #127.

  • 32bit native library (sqlite-3.8.51-i386-libsqlitejdbc.jnilib) is extracted to $TMPDIR
  • No problem occurred under 64bit JVM
Exception in thread "async-dispatch-2" java.lang.NoClassDefFoundError: org/sqlite/NativeDB
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1833)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1709)
    at java.lang.Runtime.load0(Runtime.java:770)
    at java.lang.System.load(System.java:1019)
    at org.sqlite.SQLiteJDBCLoader.loadNativeLibrary(SQLiteJDBCLoader.java:200)
    at org.sqlite.SQLiteJDBCLoader.extractAndLoadLibraryFile(SQLiteJDBCLoader.java:180)
    at org.sqlite.SQLiteJDBCLoader.loadSQLiteNativeLibrary(SQLiteJDBCLoader.java:249)
    at org.sqlite.SQLiteJDBCLoader.initialize(SQLiteJDBCLoader.java:65)
    at org.sqlite.core.NativeDB.load(NativeDB.java:53)
    at org.sqlite.core.CoreConnection.open(CoreConnection.java:136)
    at org.sqlite.core.CoreConnection.<init>(CoreConnection.java:66)
    at org.sqlite.jdbc3.JDBC3Connection.<init>(JDBC3Connection.java:21)
    at org.sqlite.jdbc4.JDBC4Connection.<init>(JDBC4Connection.java:23)
    at org.sqlite.SQLiteConnection.<init>(SQLiteConnection.java:45)
    at org.sqlite.JDBC.createConnection(JDBC.java:114)
    at org.sqlite.JDBC.connect(JDBC.java:88)
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:207)
(snip)

Comments (4)

  1. Shigeru Fujiwara reporter

    It seems that bundled native library is obsolete.

    The following are the output of nm sqlite-3.8.51-i386-libsqlitejdbc.jnilib.

    /var/folders/.../.../T/sqlite-3.8.51-i386-libsqlitejdbc.jnilib(single module):
    00001480 T _JNI_OnLoad
    000016d0 T _Java_org_sqlite_NativeDB__1close
    00001870 T _Java_org_sqlite_NativeDB__1exec
    00001600 T _Java_org_sqlite_NativeDB__1open
    (snip)
    

    These should be _Java_org_sqlite_core_NativeDB_xxx.

  2. Log in to comment