itsTyrion/AntiVPN

error on startup using velocity

Closed this issue · 2 comments

[23:21:14] [main/INFO]: Loading plugins...
[23:21:14] [main/ERROR]: Can't create plugin antivpn
com.google.inject.ProvisionException: Unable to provision, see the following errors:

  1. [Guice/ErrorInjectingConstructor]: NullPointerException: Cannot invoke "com.grack.nanojson.JsonObject.getInt(String)" because "this.config" is null
    at de.itsTyrion.antiVPN.velocity.AntiVPNVelocity.(AntiVPNVelocity.java:30)
    at VelocityPluginModule.configure(VelocityPluginModule.java:48)
    while locating de.itsTyrion.antiVPN.velocity.AntiVPNVelocity

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

1 error

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

VelocityPluginModule: "com.velocitypowered.proxy.plugin.loader.java.VelocityPluginModule"

End of classname legend:

at com.google.inject.internal.InternalProvisionException.toProvisionException(InternalProvisionException.java:251) ~[velocity-3.1.1-SNAPSHOT-97.jar:3.1.1-SNAPSHOT (git-2cff5b3b-b97)]
at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1103) ~[velocity-3.1.1-SNAPSHOT-97.jar:3.1.1-SNAPSHOT (git-2cff5b3b-b97)]
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1138) ~[velocity-3.1.1-SNAPSHOT-97.jar:3.1.1-SNAPSHOT (git-2cff5b3b-b97)]
at com.velocitypowered.proxy.plugin.loader.java.JavaPluginLoader.createPlugin(JavaPluginLoader.java:121) ~[velocity-3.1.1-SNAPSHOT-97.jar:3.1.1-SNAPSHOT (git-2cff5b3b-b97)]
at com.velocitypowered.proxy.plugin.VelocityPluginManager.loadPlugins(VelocityPluginManager.java:151) ~[velocity-3.1.1-SNAPSHOT-97.jar:3.1.1-SNAPSHOT (git-2cff5b3b-b97)]
at com.velocitypowered.proxy.VelocityServer.loadPlugins(VelocityServer.java:324) ~[velocity-3.1.1-SNAPSHOT-97.jar:3.1.1-SNAPSHOT (git-2cff5b3b-b97)]
at com.velocitypowered.proxy.VelocityServer.start(VelocityServer.java:222) ~[velocity-3.1.1-SNAPSHOT-97.jar:3.1.1-SNAPSHOT (git-2cff5b3b-b97)]
at com.velocitypowered.proxy.Velocity.main(Velocity.java:64) ~[velocity-3.1.1-SNAPSHOT-97.jar:3.1.1-SNAPSHOT (git-2cff5b3b-b97)]

Caused by: java.lang.NullPointerException: Cannot invoke "com.grack.nanojson.JsonObject.getInt(String)" because "this.config" is null
at de.itsTyrion.antiVPN.velocity.ConfigVelocity.load(ConfigVelocity.java:27) ~[?:?]
at de.itsTyrion.antiVPN.velocity.AntiVPNVelocity.(AntiVPNVelocity.java:34) ~[?:?]
at de.itsTyrion.antiVPN.velocity.AntiVPNVelocity$$FastClassByGuice$$634312.GUICE$TRAMPOLINE() ~[?:?]
at de.itsTyrion.antiVPN.velocity.AntiVPNVelocity$$FastClassByGuice$$634312.apply() ~[?:?]
at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:82) ~[velocity-3.1.1-SNAPSHOT-97.jar:3.1.1-SNAPSHOT (git-2cff5b3b-b97)]
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:114) ~[velocity-3.1.1-SNAPSHOT-97.jar:3.1.1-SNAPSHOT (git-2cff5b3b-b97)]
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91) ~[velocity-3.1.1-SNAPSHOT-97.jar:3.1.1-SNAPSHOT (git-2cff5b3b-b97)]
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:296) ~[velocity-3.1.1-SNAPSHOT-97.jar:3.1.1-SNAPSHOT (git-2cff5b3b-b97)]
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40) ~[velocity-3.1.1-SNAPSHOT-97.jar:3.1.1-SNAPSHOT (git-2cff5b3b-b97)]
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:169) ~[velocity-3.1.1-SNAPSHOT-97.jar:3.1.1-SNAPSHOT (git-2cff5b3b-b97)]
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:45) ~[velocity-3.1.1-SNAPSHOT-97.jar:3.1.1-SNAPSHOT (git-2cff5b3b-b97)]
at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1100) ~[velocity-3.1.1-SNAPSHOT-97.jar:3.1.1-SNAPSHOT (git-2cff5b3b-b97)]
... 6 more

whoooops. I had a feeling something was off but didn't bother testing (why!?). Cause found, on it

Fixed a7af6be (checking the config version before loading the config - not a good idea xD)
https://github.com/itsTyrion/AntiVPN/releases/tag/1.6.1
Thanks for reporting.
... I really should've tested (or noticed!) this