Extra Hard Mode

Extra Hard Mode

63.1k Downloads

SQLite causes error on OpenJ9 versions of Java

vladaad opened this issue ยท 3 comments

commented

Running Purpur on Java15 with OpenJ9, the game throws out this error:

[12:26:34] [Server thread/ERROR]: Error occurred while enabling ExtraHardMode v3.14.2-3b567aa (Is it up to date?)
java.lang.NoClassDefFoundError: org.sqlite.core.NativeDB
	at jdk.internal.loader.NativeLibraries.load(Native Method) ~[?:?]
	at jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(Unknown Source) ~[?:?]
	at jdk.internal.loader.NativeLibraries.loadLibrary(Unknown Source) ~[?:?]
	at jdk.internal.loader.NativeLibraries.loadLibrary(Unknown Source) ~[?:?]
	at java.lang.ClassLoader.loadLibrary(Unknown Source) ~[?:?]
	at java.lang.System.load(Unknown Source) ~[?:?]
	at org.sqlite.SQLiteJDBCLoader.loadNativeLibrary(SQLiteJDBCLoader.java:274) ~[patched_1.16.4.jar:git-Purpur-929]
	at org.sqlite.SQLiteJDBCLoader.extractAndLoadLibraryFile(SQLiteJDBCLoader.java:253) ~[patched_1.16.4.jar:git-Purpur-929]
	at org.sqlite.SQLiteJDBCLoader.loadSQLiteNativeLibrary(SQLiteJDBCLoader.java:341) ~[patched_1.16.4.jar:git-Purpur-929]
	at org.sqlite.SQLiteJDBCLoader.initialize(SQLiteJDBCLoader.java:64) ~[patched_1.16.4.jar:git-Purpur-929]
	at org.sqlite.core.NativeDB.load(NativeDB.java:63) ~[patched_1.16.4.jar:git-Purpur-929]
	at org.sqlite.SQLiteConnection.open(SQLiteConnection.java:235) ~[patched_1.16.4.jar:git-Purpur-929]
	at org.sqlite.SQLiteConnection.<init>(SQLiteConnection.java:61) ~[patched_1.16.4.jar:git-Purpur-929]
	at org.sqlite.jdbc3.JDBC3Connection.<init>(JDBC3Connection.java:28) ~[patched_1.16.4.jar:git-Purpur-929]
	at org.sqlite.jdbc4.JDBC4Connection.<init>(JDBC4Connection.java:21) ~[patched_1.16.4.jar:git-Purpur-929]
	at org.sqlite.JDBC.createConnection(JDBC.java:115) ~[patched_1.16.4.jar:git-Purpur-929]
	at org.sqlite.JDBC.connect(JDBC.java:90) ~[patched_1.16.4.jar:git-Purpur-929]
	at java.sql.DriverManager.getConnection(Unknown Source) ~[java.sql:?]
	at java.sql.DriverManager.getConnection(Unknown Source) ~[java.sql:?]
	at com.extrahardmode.module.MsgPersistModule.retrieveConnection(MsgPersistModule.java:172) ~[?:?]
	at com.extrahardmode.module.MsgPersistModule.initializeTables(MsgPersistModule.java:183) ~[?:?]
	at com.extrahardmode.module.MsgPersistModule.starting(MsgPersistModule.java:75) ~[?:?]
	at com.extrahardmode.ExtraHardMode.registerModule(ExtraHardMode.java:286) ~[?:?]
	at com.extrahardmode.ExtraHardMode.onEnable(ExtraHardMode.java:124) ~[?:?]
	at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[patched_1.16.4.jar:git-Purpur-929]
	at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:380) ~[patched_1.16.4.jar:git-Purpur-929]
	at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:483) ~[patched_1.16.4.jar:git-Purpur-929]
	at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugin(CraftServer.java:501) ~[patched_1.16.4.jar:git-Purpur-929]
	at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugins(CraftServer.java:415) ~[patched_1.16.4.jar:git-Purpur-929]
	at net.minecraft.server.v1_16_R3.MinecraftServer.loadWorld(MinecraftServer.java:471) ~[patched_1.16.4.jar:git-Purpur-929]
	at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:249) ~[patched_1.16.4.jar:git-Purpur-929]
	at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:942) ~[patched_1.16.4.jar:git-Purpur-929]
	at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:180) ~[patched_1.16.4.jar:git-Purpur-929]
	at net.minecraft.server.v1_16_R3.MinecraftServer$$Lambda$3157/0x00000000f73d5a20.run(Unknown Source) ~[?:?]
	at java.lang.Thread.run(Unknown Source) [?:?]
Caused by: java.lang.ClassNotFoundException: org.sqlite.core.NativeDB
	at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:?]
	... 35 more

This usually happens with plugins that integrate sqlite databases, usually i fix it by pointing them to my MySQL database but I don't see any option in the config to do that in this plugin.

commented

interesting.
Am curious what your thoughts are here @nouish? Thought CB included SQLite so idk why the Java implementation would matter...?

commented

Or is this a Java 15 thing instead.

commented

Looks like a failed attempt at loading the native library (which Xerial's SQLite driver bundles for most operating systems).

This usually happens with plugins that integrate sqlite databases, usually i fix it by pointing them to my MySQL database but I don't see any option in the config to do that in this plugin.

Again, seems like a recurring thing, which suggests the same thing.


I'd look into which OS this happens on, and if a newer SQLite driver bundles a native lib for it.