4drian3d / ClientCatcher

Detect the client with which a player has connected to your server
https://modrinth.com/plugin/clientcatcher
GNU General Public License v3.0
23 stars 1 forks source link

Cannot load configuration error. #42

Closed GrimPlayzs closed 11 months ago

GrimPlayzs commented 1 year ago

Every time when starting the proxy (Velocity) I get this error.

[12:50:15 ERROR] [clientcatcher]: Cannot load configuration java.util.concurrent.CompletionException: kotlin.jvm.KotlinReflectionNotSupportedError: Kotlin reflection implementation is not found at runtime. Make sure you have kotlin-reflect.jar in the classpath at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ~[?:?] at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) ~[?:?] at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1770) ~[?:?] at java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760) ~[?:?] at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387) ~[?:?] at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312) ~[?:?] at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843) ~[?:?] at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808) ~[?:?] at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188) ~[?:?] Caused by: kotlin.jvm.KotlinReflectionNotSupportedError: Kotlin reflection implementation is not found at runtime. Make sure you have kotlin-reflect.jar in the classpath at kotlin.jvm.internal.ClassReference.error(ClassReference.kt:88) ~[?:?] at kotlin.jvm.internal.ClassReference.isData(ClassReference.kt:70) ~[?:?] at io.github._4drian3d.clientcatcher.libs.org.spongepowered.configurate.kotlin.DataClassFieldDiscoverer.discover(ObjectMapping.kt:93) ~[?:?] at io.github._4drian3d.clientcatcher.libs.org.spongepowered.configurate.objectmapping.ObjectMapperFactoryImpl.newMapper(ObjectMapperFactoryImpl.java:131) ~[?:?] at io.github._4drian3d.clientcatcher.libs.org.spongepowered.configurate.objectmapping.ObjectMapperFactoryImpl.computeMapper(ObjectMapperFactoryImpl.java:120) ~[?:?] at io.github._4drian3d.clientcatcher.libs.org.spongepowered.configurate.objectmapping.ObjectMapperFactoryImpl.lambda$computeFromMap$5(ObjectMapperFactoryImpl.java:290) ~[?:?] at java.util.HashMap.computeIfAbsent(HashMap.java:1228) ~[?:?] at io.github._4drian3d.clientcatcher.libs.org.spongepowered.configurate.objectmapping.ObjectMapperFactoryImpl.computeFromMap(ObjectMapperFactoryImpl.java:288) ~[?:?] at io.github._4drian3d.clientcatcher.libs.org.spongepowered.configurate.objectmapping.ObjectMapperFactoryImpl.get(ObjectMapperFactoryImpl.java:109) ~[?:?] at io.github._4drian3d.clientcatcher.libs.org.spongepowered.configurate.objectmapping.ObjectMapperFactoryImpl.deserialize(ObjectMapperFactoryImpl.java:204) ~[?:?] at io.github._4drian3d.clientcatcher.libs.org.spongepowered.configurate.AbstractConfigurationNode.get(AbstractConfigurationNode.java:151) ~[?:?] at io.github._4drian3d.clientcatcher.libs.org.spongepowered.configurate.ConfigurationNode.get(ConfigurationNode.java:520) ~[?:?] at io.github._4drian3d.clientcatcher.ClientCatcher.loadConfig$lambda$1(ClientCatcher.kt:82) ~[?:?] at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?] ... 6 more

4drian3d commented 1 year ago

What plugins are you using? I think there was a plugin that was incompatible because it downloaded Kotlin stdlib without relocation and without the reflection module

GrimPlayzs commented 1 year ago

Here is a list of my Velocity plugins.

AdvancedServerList ajQueue Blossom Cleanping ClientCatcher EnhancedVelocity Floodgate Geyser KickRedirect LanBroadcaster LibertyBans LuckPerms Maintenance MapModCompanion MCKotlinVelocity MiniMOTD MiniPlaceholders Parties Plan PluginVersions ProxyChat SkinsRestorer Velocitab VelocityReport VelocityVanish ViaBackwards ViaRewind ViaVersion VLobby VServerInfo

4drian3d commented 1 year ago

The problem is probably EnhancedVelocity or Blossom, since they include Kotlin stdlib without relocating. The conflict comes because MCKotlin provides Kotlin stdlib to several plugins along with Kotlin reflect and KotlinX Courutines, for which, you can't relocate their dependencies, in the case of EnhancedVelocity or Blossom, they also contain Kotlin stdlib for use in their own plugin, but without Kotlin reflect (which is what ClientCatcher uses), so it creates a class conflict and the classes included in these plugins take precedence, making Kotlin reflect not accessible from ClientCatcher.

The solutions would either be for these plugins to relocate their version of Kotlin stdlib or to rely on MCKotlin (which I think would be more beneficial for them)

GrimPlayzs commented 1 year ago

After doing my own testing I figured out it was neither EnhancedVelocity nor Blossom but was AdvancedServerList that was causing the error.

4drian3d commented 1 year ago

I didn't expect it, but I just checked and AdvancedServerList has the same problem as EnhancedVelocity and Blossom. And it makes a lot of sense, since according to the alphabetical loading of plugins, AdvancedServerList would be the first to load

GrimPlayzs commented 1 year ago

Interesting all thought in my case ClientCatcher works perfectly even with EnhancedVelocity and Blossom both installed and only fails to load with AdvancedServerList in my case. But even if I'm not getting any errors in the console could I get unexpected behaviors from EnhancedVelocity or Blossom since ClientCatcher loads first?

4drian3d commented 1 year ago

Interesting all thought in my case ClientCatcher works perfectly even with EnhancedVelocity and Blossom both installed and only fails to load with AdvancedServerList in my case. But even if I'm not getting any errors in the console could I get unexpected behaviors from EnhancedVelocity or Blossom since ClientCatcher loads first?

There should be no problem if MCKotlin loads first as it contains all the libraries that ClientCatcher and the other plugins that use Kotlin require

According to your setup, the order of plugin loading would be: AdvancedServerList -> Blossom -> MCKotlin (dependency of ClientCatcher) -> ClientCatcher -> EnhancedVelocity

Although, I don't know why Blossom is not having problems in your setup

frafol commented 1 year ago

Fixed it in cleanstaffchat.