-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Glowstone/Guava 10 compatibility (vs Guava 17) #5
Comments
We modify Bukkit like https://github.com/CanaryBukkitTeam/BukkitC for CanaryBukkit. You could do the same for SpongeAPI? |
@jamierocks It'd be better to use "vanilla" Sponge, so it's compatible with everything. It might be possible to make small changes. |
Yeah I'd like to use SpongeAPI unmodified if at all possible, easier than maintaining a fork, and the SpongePowered team seems open to changes if there's anything reasonable that would need to be changed there. But changing SpongeAPI to use Guava 10 is, sadly, not feasible - not only would that be a downgrade, but would also break Guava 17 compatibility with plugins. As I understand it, they have to stick to 17 because that's what Minecraft uses (notwithstanding bundling their own relocated version). On the Bukkit API side, fixed this in Glowstone++ by using a Glowkit/Bukkit updated with Guava 17 (via Spigot-Bukkit), so its now only a problem on the original Glowstone, and potentially older Bukkit server implementations. When did Spigot update Bukkit to use Guava 17, I think it was Minecraft 1.8? or 1.7? Maybe worth just dropping older version support.. |
A possible reason to support Guava 10 in older servers:
|
Why not just use Spigot's version of bukkit? |
@jamierocks https://forums.glowstone.net/t/spigots-new-1-8-bukkit-api/68/25 PR #10 adds class relocation so the Guava is independent from whatever the server platform bundles. With this change Bukkit2Sponge loads on Glowstone (and still loads on Glowstone++), and should also work on other servers using Bukkit 1.7.10-derived/earlier APIs (untested). |
Relocate Guava at build and runtime for backward compatibility. Closes GH-5
Glowstone (tested on build 123) currently bundles Guava version 10 (see https://github.com/GlowstoneMC/Glowkit/pull/68 Update to Guava 17), but SpongeAPI requires Guava 17, therefore Bukkit2Sponge uses it (and relocating to avoid version conflicts breaks interface contracts, see #3), failing to load due to this version difference:
18:11:08 [SEVERE] Error occurred while enabling Bukkit2Sponge v0.5 (Is it up to date?)
java.lang.NoSuchMethodError: com.google.common.cache.CacheBuilder.build()Lcom/google/common/cache/Cache;
at com.google.inject.internal.WeakKeySet.(WeakKeySet.java:55)
at com.google.inject.internal.InheritingState.(InheritingState.java:65)
at com.google.inject.internal.InjectorShell$Builder.getState(InjectorShell.java:203)
at com.google.inject.internal.InjectorShell$Builder.lock(InjectorShell.java:114)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:103)
at com.google.inject.Guice.createInjector(Guice.java:96)
at com.google.inject.Guice.createInjector(Guice.java:73)
at com.google.inject.Guice.createInjector(Guice.java:62)
at io.github.deathcap.bukkit2sponge.Bukkit2Sponge.load(Bukkit2Sponge.java:54)
at io.github.deathcap.bukkit2sponge.Bukkit2Sponge.onEnable(Bukkit2Sponge.java:47)
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:316)
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:324)
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:404)
at net.glowstone.GlowServer.enablePlugins(GlowServer.java:726)
at net.glowstone.GlowServer.start(GlowServer.java:477)
at net.glowstone.GlowServer.main(GlowServer.java:106)
Bukkit2Sponge unfortunately can't downgrade to Guava 10 since SpongeAPI needs Guava 17. Maybe this conflict can be solved by dynamically relocating Guava in the plugin classloader (in addition to maven-shade-plugin relocation at build time).
The text was updated successfully, but these errors were encountered: