[SPIGOT-2783] Unknown SQLite Library Created: 17/Nov/16  Updated: 19/Aug/18  Resolved: 17/Nov/16

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Trig Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: None
Environment:

java.lang.NoClassDefFoundError: org/sqlite/NativeDB
at java.lang.ClassLoader$NativeLibrary.load(Native Method) ~[?:1.8.0_111]
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941) ~[?:1.8.0_111]
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824) ~[?:1.8.0_111]
at java.lang.Runtime.load0(Runtime.java:809) ~[?:1.8.0_111]
at java.lang.System.load(System.java:1086) ~[?:1.8.0_111]
at org.sqlite.SQLiteJDBCLoader.loadNativeLibrary(SQLiteJDBCLoader.java:227) ~[spigot-1.11.jar:git-Spigot-d60de0a-a951a88]
at org.sqlite.SQLiteJDBCLoader.loadSQLiteNativeLibrary(SQLiteJDBCLoader.java:261) ~[spigot-1.11.jar:git-Spigot-d60de0a-a951a88]
at org.sqlite.SQLiteJDBCLoader.initialize(SQLiteJDBCLoader.java:65) ~[spigot-1.11.jar:git-Spigot-d60de0a-a951a88]
at org.sqlite.core.NativeDB.load(NativeDB.java:56) ~[spigot-1.11.jar:git-Spigot-d60de0a-a951a88]
at org.sqlite.core.CoreConnection.open(CoreConnection.java:211) ~[spigot-1.11.jar:git-Spigot-d60de0a-a951a88]
at org.sqlite.core.CoreConnection.<init>(CoreConnection.java:76) ~[spigot-1.11.jar:git-Spigot-d60de0a-a951a88]
at org.sqlite.jdbc3.JDBC3Connection.<init>(JDBC3Connection.java:24) ~[spigot-1.11.jar:git-Spigot-d60de0a-a951a88]
at org.sqlite.jdbc4.JDBC4Connection.<init>(JDBC4Connection.java:24) ~[spigot-1.11.jar:git-Spigot-d60de0a-a951a88]
at org.sqlite.SQLiteConnection.<init>(SQLiteConnection.java:45) ~[spigot-1.11.jar:git-Spigot-d60de0a-a951a88]
at org.sqlite.JDBC.createConnection(JDBC.java:114) ~[spigot-1.11.jar:git-Spigot-d60de0a-a951a88]
at org.sqlite.JDBC.connect(JDBC.java:88) ~[spigot-1.11.jar:git-Spigot-d60de0a-a951a88]
at java.sql.DriverManager.getConnection(DriverManager.java:664) ~[?:1.8.0_111]
at java.sql.DriverManager.getConnection(DriverManager.java:270) ~[?:1.8.0_111]
at com.sk89q.worldguard.util.profile.cache.SQLiteCache.<init>(SQLiteCache.java:63) ~[?:?]
at com.sk89q.worldguard.bukkit.WorldGuardPlugin.onEnable(WorldGuardPlugin.java:162) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:271) ~[spigot-1.11.jar:git-Spigot-d60de0a-a951a88]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:337) [spigot-1.11.jar:git-Spigot-d60de0a-a951a88]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) [spigot-1.11.jar:git-Spigot-d60de0a-a951a88]
at org.bukkit.craftbukkit.v1_11_R1.CraftServer.enablePlugin(CraftServer.java:373) [spigot-1.11.jar:git-Spigot-d60de0a-a951a88]
at org.bukkit.craftbukkit.v1_11_R1.CraftServer.enablePlugins(CraftServer.java:323) [spigot-1.11.jar:git-Spigot-d60de0a-a951a88]
at net.minecraft.server.v1_11_R1.MinecraftServer.t(MinecraftServer.java:419) [spigot-1.11.jar:git-Spigot-d60de0a-a951a88]
at net.minecraft.server.v1_11_R1.MinecraftServer.l(MinecraftServer.java:380) [spigot-1.11.jar:git-Spigot-d60de0a-a951a88]
at net.minecraft.server.v1_11_R1.MinecraftServer.a(MinecraftServer.java:335) [spigot-1.11.jar:git-Spigot-d60de0a-a951a88]
at net.minecraft.server.v1_11_R1.DedicatedServer.init(DedicatedServer.java:272) [spigot-1.11.jar:git-Spigot-d60de0a-a951a88]
at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.java:542) [spigot-1.11.jar:git-Spigot-d60de0a-a951a88]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111]
Caused by: java.lang.ClassNotFoundException: org.sqlite.NativeDB
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_111]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_111]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) ~[?:1.8.0_111]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_111]
... 31 more


Attachments: Text File NoClassDef.txt    
Plugin: SPIGOT

 Description   

All plugins using SQLite seem to be throwing this NoClassDefError.



 Comments   
Comment by Daniel Ennis [ 19/Aug/18 ]

Incase anyone arrives at this issue again, you can solve this with adding to your startup flags

-Dorg.sqlite.tmpdir=tmp

and make a directory named "tmp" in your server root.

This will make sqlite store them in your servers folder instead under global /tmp.

Comment by VanDerProtofsky [ 18/Nov/16 ]

Bumped into this issue on our server; as md_5 says, a conflicting plugin was responsible for this.

It turns out that LWC attempts to download and use its own native libs for SQLite, which breaks other plugins attempting to use SQLite.

Workarounds:

  • If LWC's config.yml is set to use mysql as the adapter, try deleting plugins/LWC/lib
  • If LWC's config.yml is set to use sqlite as the adapter, you must migrate to and use MySQL instead

Edit: I have filed an issue: https://github.com/Hidendra/LWC/issues/953

Comment by md_5 [ 17/Nov/16 ]

Also Intelli your issue is different - that is because your OS is mounting /tmp noexec.
You will have to fall back to -Dsqlite.purejava=true or mount /tmp exec, or use another workaround.

The native library provides far better performance and compatibility with actual sqlite.

Comment by md_5 [ 17/Nov/16 ]

I found the issue.

You are running a conflicting plugin which packages its own SQLite.
Please investigate your plugins.

Comment by Intelli [ 17/Nov/16 ]

Getting a few reports of this on my plugin page.

https://www.spigotmc.org/threads/coreprotect.73929/page-16#post-2026175
https://www.spigotmc.org/resources/coreprotect.8631/reviews#review-105663-146663

Unable to replicate the exact error. However, on my CentOS 6 server, if I start it up with the default temp directory, I get this error:

[15:44:16 WARN]: Failed to load native library:sqlite-3.14.2.1-1819ef5d-c291-40ef-8d69-45ed96542740-libsqlitejdbc.so. osinfo: Linux/x86_64
[15:44:16 WARN]: java.lang.UnsatisfiedLinkError: /tmp/sqlite-3.14.2.1-1819ef5d-c291-40ef-8d69-45ed96542740-libsqlitejdbc.so: /tmp/sqlite-3.14.2.1-1819ef5d-c291-40ef-8d69-45ed96542740-libsqlitejdbc.so: failed to map segment from shared object: Operation not permitted
[15:44:16 ERROR]: Error occurred while enabling CoreProtect v2.13.1 (Is it up to date?)
java.lang.UnsatisfiedLinkError: org.sqlite.core.NativeDB._open(Ljava/lang/String;I)V
	at org.sqlite.core.NativeDB._open(Native Method) ~[spigot-1.11.jar:git-Spigot-d60de0a-17e6e85]
	at org.sqlite.core.DB.open(DB.java:174) ~[spigot-1.11.jar:git-Spigot-d60de0a-17e6e85]
	at org.sqlite.core.CoreConnection.open(CoreConnection.java:220) ~[spigot-1.11.jar:git-Spigot-d60de0a-17e6e85]
	at org.sqlite.core.CoreConnection.<init>(CoreConnection.java:76) ~[spigot-1.11.jar:git-Spigot-d60de0a-17e6e85]
	at org.sqlite.jdbc3.JDBC3Connection.<init>(JDBC3Connection.java:24) ~[spigot-1.11.jar:git-Spigot-d60de0a-17e6e85]
	at org.sqlite.jdbc4.JDBC4Connection.<init>(JDBC4Connection.java:24) ~[spigot-1.11.jar:git-Spigot-d60de0a-17e6e85]
	at org.sqlite.SQLiteConnection.<init>(SQLiteConnection.java:45) ~[spigot-1.11.jar:git-Spigot-d60de0a-17e6e85]
	at org.sqlite.JDBC.createConnection(JDBC.java:114) ~[spigot-1.11.jar:git-Spigot-d60de0a-17e6e85]
	at org.sqlite.JDBC.connect(JDBC.java:88) ~[spigot-1.11.jar:git-Spigot-d60de0a-17e6e85]
	at java.sql.DriverManager.getConnection(DriverManager.java:664) ~[?:1.8.0_111]
	at java.sql.DriverManager.getConnection(DriverManager.java:270) ~[?:1.8.0_111]
	at net.coreprotect.database.Database.getConnection(Database.java:107) ~[?:?]
	at net.coreprotect.Functions.createDatabaseTables(Functions.java:312) ~[?:?]
	at net.coreprotect.model.Config.loadDatabase(Config.java:788) ~[?:?]
	at net.coreprotect.model.Config.performInitialization(Config.java:889) ~[?:?]
	at net.coreprotect.CoreProtect.onEnable(CoreProtect.java:98) ~[?:?]
	at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:271) ~[spigot-1.11.jar:git-Spigot-d60de0a-17e6e85]
	at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:337) [spigot-1.11.jar:git-Spigot-d60de0a-17e6e85]
	at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) [spigot-1.11.jar:git-Spigot-d60de0a-17e6e85]
	at org.bukkit.craftbukkit.v1_11_R1.CraftServer.enablePlugin(CraftServer.java:373) [spigot-1.11.jar:git-Spigot-d60de0a-17e6e85]
	at org.bukkit.craftbukkit.v1_11_R1.CraftServer.enablePlugins(CraftServer.java:323) [spigot-1.11.jar:git-Spigot-d60de0a-17e6e85]
	at net.minecraft.server.v1_11_R1.MinecraftServer.t(MinecraftServer.java:419) [spigot-1.11.jar:git-Spigot-d60de0a-17e6e85]
	at net.minecraft.server.v1_11_R1.MinecraftServer.l(MinecraftServer.java:380) [spigot-1.11.jar:git-Spigot-d60de0a-17e6e85]
	at net.minecraft.server.v1_11_R1.MinecraftServer.a(MinecraftServer.java:335) [spigot-1.11.jar:git-Spigot-d60de0a-17e6e85]
	at net.minecraft.server.v1_11_R1.DedicatedServer.init(DedicatedServer.java:272) [spigot-1.11.jar:git-Spigot-d60de0a-17e6e85]
	at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.java:542) [spigot-1.11.jar:git-Spigot-d60de0a-17e6e85]
	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111]

If I manually specify a temp directory (e.g. /plugins/CoreProtect/tmp), it starts up without any errors/warnings.

With Spigot 1.10 and earlier, I don't seem to receive the "java.lang.UnsatisfiedLinkError: org.sqlite.core.NativeDB" error.

Not sure if that's related at all, but figured I'd give it a quick mention.

Comment by F_o_F_1092 [ 17/Nov/16 ]

I'm getting the same error (with all SQLite-Plugins (WG, LWC etc.)

My Debian version is 8.6

My java version is 1.8.0_101

 

*edit*

Same on my Windows 10 PC.

Comment by Trig [ 17/Nov/16 ]

Not sure what the issue on my end is then, Problem solved by injecting SQLite 3.7 into the 1.11 jar. I'll continue to look into it on my own.

Comment by md_5 [ 17/Nov/16 ]

We ran the test server on Debian 8 with multiple plugins using SQLite no issues

Comment by Trig [ 17/Nov/16 ]

The issue seems to be with the new version of SQLite packaged in the spigot jar. I just verified it works on Windows, but does not seem to work on Debian 8.

Comment by md_5 [ 17/Nov/16 ]

Cannot reproduce with latest worldguard build

Comment by Trig [ 17/Nov/16 ]

Can't seem to edit this, but I accidentally placed the stacktrace inside of the environment section.

Generated at Wed Sep 03 19:36:20 UTC 2025 using Jira 10.3.9#10030009-sha1:eff8913ed2270ee44ab422c3609af4c4f36536d0.