kennytv/Maintenance

Non-relocated SLF4J component of HikariCP causes collision with LuckPerms

AuroraLS3 opened this issue · 2 comments

Issue

Following error occurs on startup if both Maintenance and LuckPerms are installed on a BungeeCord server

09:56:54 [INFO] Enabled plugin reconnect_yaml version git:reconnect_yaml:1.13-SNAPSHOT:6fadb42:1343 by SpigotMC
09:56:54 [INFO]         __
09:56:54 [INFO]   |    |__)   LuckPerms v4.2.75
09:56:54 [INFO]   |___ |      Running on Bungee - BungeeCord
09:56:54 [INFO]
09:56:54 [INFO] [LuckPerms] Loading configuration...
09:56:54 [INFO] [LuckPerms] Loading storage provider... [MYSQL]
09:56:54 [WARNING] Exception encountered when loading plugin: LuckPerms
java.lang.reflect.UndeclaredThrowableException
    at com.sun.proxy.$Proxy3.init(Unknown Source)
    at me.lucko.luckperms.common.storage.StorageFactory.getInstance(StorageFactory.java:117)
    at me.lucko.luckperms.common.plugin.AbstractLuckPermsPlugin.enable(AbstractLuckPermsPlugin.java:132)
    at me.lucko.luckperms.bungee.LPBungeeBootstrap.onEnable(LPBungeeBootstrap.java:124)
    at net.md_5.bungee.api.plugin.PluginManager.enablePlugins(PluginManager.java:227)
    at net.md_5.bungee.BungeeCord.start(BungeeCord.java:281)
    at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:56)
    at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15)
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at me.lucko.luckperms.common.storage.wrappings.PhasedStorage.lambda$wrap$0(PhasedStorage.java:64)
    ... 8 more
Caused by: java.lang.LinkageError: loader constraint violation: when resolving method "org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;" the class loader (instance of net/md_5/bungee/api/plugin/PluginClassloader) of the current class, org/slf4j/LoggerFactory, and the class loader (instance of net/md_5/bungee/api/plugin/PluginClassloader) for the method's defining class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type org/slf4j/ILoggerFactory used in the signature
    at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:418)
    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357)
    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383)
    at me.lucko.luckperms.lib.hikari.HikariConfig.<clinit>(HikariConfig.java:51)
    at me.lucko.luckperms.common.storage.dao.sql.connection.hikari.HikariConnectionFactory.init(HikariConnectionFactory.java:76)
    at me.lucko.luckperms.common.storage.dao.sql.SqlDao.init(SqlDao.java:159)
    at me.lucko.luckperms.common.storage.AbstractStorage.init(AbstractStorage.java:122)
    ... 13 more

This is because neither of the plugins relocate org.slf4j packages on build.

I belive you might be able to collaborate with lucko with the fix LuckPerms/LuckPerms#1153

Necessary server information

Running on: BungeeCord

Maintenance version: 2.3.1

Other information

Other motd changing plugins: none

ProtocolLib version: none installed

Should probably be fixed in the version below, but I can't really test it, as I'm currently at the Gamescom on holidays. Would you be as kind as to test it for me? 😄
https://www.dropbox.com/s/6ijo2d7x8v4k40b/Maintenance.jar?dl=0 (Dont do that now, it's outdated)

Sorry, looks like the error was caused by BungeeAdminTools instead on my server, my bad.