LWC icon indicating copy to clipboard operation
LWC copied to clipboard

[1.11] `java.lang.NoClassDefFoundError: org/sqlite/NativeDB` caused by SQLite driver

Open RoyCurtis opened this issue 7 years ago • 7 comments

If LWC's database.adapter is set to sqlite (which it is by default), LWC attempts to download the SQLite native driver and unpacks it into its plugin directory. This driver is then loaded in some fashion.

In Spigot 1.11, Spigot's bundled SQLite driver has been updated to the 3.14 series. This appears to conflict with the SQLite driver that LWC downloads and loads, breaking all other plugins that use SQLite:

Details

  • Tested on CraftBukkit version git-Spigot-16c940b-88eede8 (MC: 1.11) (Implementing API version 1.11-R0.1-SNAPSHOT)
  • Tested with LWC build 941
  • Plugins (28): CleanroomGenerator, dynmap, WorldEdit, Titanic, zPermissions, Chairs, WorldBorder, TicketMaster, ProtocolLib, Multiverse-Core, WorldGuard, NoCheatPlus, WoodCutter, Stables, Multiverse-SignPortals, HappyPet, Multiverse-Portals, Vault, Prism, Essentials, PerWorldInventory, LWC, SignShop, VanishNoPacket, SignShopExport, CraftBook, Multiverse-NetherPortals, PurpleIRC

Reproduction

  1. Prepare a Spigot 1.11 server
  2. Put LWC, WorldGuard and CraftBook in the plugins folder
  3. Start the server. Note that WorldGuard and CraftBook fail to load with a NoClassDefFoundError exception
  4. Stop the server and remove LWC from the plugins folder
  5. Start the server. Observe that WorldGuard and CraftBook now load as expected

Workaround

  • 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

Notes

  • This issue was reported on Spigot's JIRA as SPIGOT-2783
  • Personally, I find it concerning that LWC downloads and executes a native library from a third-party website (http://update.griefcraft.com) by default. I wonder also, why bother attempting to download or package SQLite when Spigot already has it?

RoyCurtis avatar Nov 18 '16 12:11 RoyCurtis