BanManager fails to start up on 1.12
zombachu opened this issue ยท 4 comments
Issue report
Tell us about your environment
-
Server Version:
CraftBukkit version git-Spigot-6629162-cda27c9 (MC: 1.12-pre5) (Implementing API version 1.12-pre5-SNAPSHOT) -
BanManager Version:
5.14.0 -
Online/Offline mode:
Online
Describe your issue:
BanMaanger fails to load in 1.12, most likely due to Mojang updating Guava to 21.0. Here's the error I get on startup, though it's possible other uses of Guava in this plugin will cause issues too.
[01:51:59] [Server thread/ERROR]: Error occurred while enabling BanManager v5.14.0 (Is it up to date?)
java.lang.NoSuchMethodError: com.google.common.util.concurrent.MoreExecutors.sameThreadExecutor()Lcom/google/common/util/concurrent/ListeningExecutorService;
at me.confuser.banmanager.internal.guava.cache.LocalCache.<clinit>(LocalCache.java:77) ~[?:?]
at me.confuser.banmanager.internal.guava.cache.LocalCache$LocalManualCache.<init>(LocalCache.java:4702) ~[?:?]
at me.confuser.banmanager.internal.guava.cache.CacheBuilder.build(CacheBuilder.java:811) ~[?:?]
at me.confuser.banmanager.storage.PlayerWarnStorage.<init>(PlayerWarnStorage.java:34) ~[?:?]
at me.confuser.banmanager.BanManager.setupStorages(BanManager.java:343) ~[?:?]
at me.confuser.banmanager.BanManager.onEnable(BanManager.java:135) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[spigot.jar:git-Spigot-6629162-cda27c9]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:337) [spigot.jar:git-Spigot-6629162-cda27c9]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:402) [spigot.jar:git-Spigot-6629162-cda27c9]
at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugin(CraftServer.java:376) [spigot.jar:git-Spigot-6629162-cda27c9]
at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugins(CraftServer.java:326) [spigot.jar:git-Spigot-6629162-cda27c9]
at net.minecraft.server.v1_12_R1.MinecraftServer.t(MinecraftServer.java:421) [spigot.jar:git-Spigot-6629162-cda27c9]
at net.minecraft.server.v1_12_R1.MinecraftServer.l(MinecraftServer.java:382) [spigot.jar:git-Spigot-6629162-cda27c9]
at net.minecraft.server.v1_12_R1.MinecraftServer.a(MinecraftServer.java:337) [spigot.jar:git-Spigot-6629162-cda27c9]
at net.minecraft.server.v1_12_R1.DedicatedServer.init(DedicatedServer.java:272) [spigot.jar:git-Spigot-6629162-cda27c9]
at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:544) [spigot.jar:git-Spigot-6629162-cda27c9]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_91]
Further information:
Thanks for your work on this awesome plugin!
Looks like guavabackport has been updated recently, but I haven't taken a close look yet so I'm not sure whether this will fix this issue or if it'll break this plugin on < 1.12.
^ Can't you selectively load or unload+load a lib like Guava if you need 2 versions of a lib to support 2 different ranges of game versions ? That'd of course add a remarkable size increase.
I know having multiple versions of same address spaces is a (syntax ?) violation, but I don't think it causes a crash that'd prevent unloading them to then selectively load.
That's good to know. Thanks @zombachu!
I looked into this briefly at the weekend, there seemed to be only two choices. Break backwards compatibility with older minecraft versions, and support only newer versions going forwards, or shade Guava in. Neither of which ideal.
I'll check on guavabackport.
@confuser Just took a closer look at the new version of guavabackport and it looks like it won't solve the issue. In fact, it looks like 1.2 contains entirely different classes from 1.1 and doesn't include the ones used by this plugin.
I know you said shading guava in isn't ideal and sorry if this is a stupid question, but you're already shading in guavabackport so what's the difference between that and the official stuff?