retrixe/reconsole

MongoDB driver doesn't load correctly in some places

Closed this issue · 1 comments

Before Gradle 5 upgrade, IntelliJ did not detect MongoDB on my system. While this may be a local issue, when running the Gradle 5 jar task and then running the plugin in Paper 1.12.2, the plugin throws this error:

[21:25:27 ERROR]: Error occurred while enabling ReConsole v1.0.0-alpha.0 (Is it up to date?)
java.lang.NoClassDefFoundError: com/mongodb/client/MongoClients
        at com.reconsole.reconsole.loginstrategies.MongoStrategy.<init>(MongoStrategy.java:22) ~[?:?]
        at com.reconsole.reconsole.httphandlers.LoginEndpoint.<init>(LoginEndpoint.java:31) ~[?:?]
        at com.reconsole.reconsole.Main.onEnable(Main.java:30) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[patched_1.12.2.jar:git-Paper-1589]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:316) ~[patched_1.12.2.jar:git-Paper-1589]

No idea if this is a local issue, please attempt to reproduce.
(You don't need a MongoDB server running, just setup config.yml login-method: mongodb to reproduce)

Use shadowJar instead of jar for future builds from now on, the dependencies weren't getting bundled, all our dependencies (Guava and its dependency gson, along with Bukkit API) were being provided by Spigot up till now (it doesn't provide MongoDB) hence the bug was unnoticed.. The shadow plugin handles this for us and bundles our dependencies.