weaondara/BungeePerms

can‘t work witch Velocity 3.0.0

Closed this issue · 2 comments

[22:47:56 ERROR]: Can't create plugin bungeeperms
com.google.inject.ProvisionException: Unable to provision, see the following errors:

  1. at VelocityPlugin.(VelocityPlugin.java:94)
    at VelocityPluginModule.configure(VelocityPluginModule.java:48)
    while locating VelocityPlugin

Learn more:
https://github.com/google/guice/wiki/ERROR_INJECTING_CONSTRUCTOR

1 error

======================
Full classname legend:

Command: "com.velocitypowered.api.command.Command"
CommandManager: "com.velocitypowered.api.command.CommandManager"
VelocityPlugin: "net.alpenblock.bungeeperms.platform.velocity.VelocityPlugin"
VelocityPluginModule: "com.velocitypowered.proxy.plugin.loader.java.VelocityPluginModule"

End of classname legend:

    at com.google.inject.internal.InternalProvisionException.toProvisionException(InternalProvisionException.java:251) ~[velocity-3.0.0.jar:3.0.0]
    at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1103) ~[velocity-3.0.0.jar:3.0.0]
    at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1138) ~[velocity-3.0.0.jar:3.0.0]
    at com.velocitypowered.proxy.plugin.loader.java.JavaPluginLoader.createPlugin(JavaPluginLoader.java:121) ~[velocity-3.0.0.jar:3.0.0]
    at com.velocitypowered.proxy.plugin.VelocityPluginManager.loadPlugins(VelocityPluginManager.java:152) ~[velocity-3.0.0.jar:3.0.0]
    at com.velocitypowered.proxy.VelocityServer.loadPlugins(VelocityServer.java:325) ~[velocity-3.0.0.jar:3.0.0]
    at com.velocitypowered.proxy.VelocityServer.start(VelocityServer.java:223) ~[velocity-3.0.0.jar:3.0.0]
    at com.velocitypowered.proxy.Velocity.main(Velocity.java:64) ~[velocity-3.0.0.jar:3.0.0]

Caused by: java.lang.NoSuchMethodError: 'void com.velocitypowered.api.command.CommandManager.register(com.velocitypowered.api.command.Command, java.lang.String[])'
at net.alpenblock.bungeeperms.platform.velocity.VelocityPlugin.loadcmds(VelocityPlugin.java:167) ~[?:?]
at net.alpenblock.bungeeperms.platform.velocity.VelocityPlugin.(VelocityPlugin.java:112) ~[?:?]
at net.alpenblock.bungeeperms.platform.velocity.VelocityPlugin$$FastClassByGuice$$266522.GUICE$TRAMPOLINE() ~[?:?]
at net.alpenblock.bungeeperms.platform.velocity.VelocityPlugin$$FastClassByGuice$$266522.apply() ~[?:?]
at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:82) ~[velocity-3.0.0.jar:3.0.0]
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:114) ~[velocity-3.0.0.jar:3.0.0]
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91) ~[velocity-3.0.0.jar:3.0.0]
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:296) ~[velocity-3.0.0.jar:3.0.0]
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40) ~[velocity-3.0.0.jar:3.0.0]
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:169) ~[velocity-3.0.0.jar:3.0.0]
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:45) ~[velocity-3.0.0.jar:3.0.0]
at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1100) ~[velocity-3.0.0.jar:3.0.0]
... 6 more

A248 commented

I can confirm the same issue on Velocity 3.0.1.

Here is a more convenient stacktrace: https://pastebin.com/k7Vc8nRA

There are two problems I can see here:

  1. BungeePerms isn't compatible with Velocity 3.x; it uses a method which doesn't exist in Velocity 3. Hence, NoSuchMethodError.
  2. BungeePerms registers commands inside the plugin constructor. This is incorrect behavior, because parts of the Velocity server, including the CommandManager, are not guaranteed to be available during plugin construction. To fix this, BungeePerms should do its initialization work inside the ProxyInitializeEvent.

should be fixed in build 134 b14e36d