EternalCodeTeam / EternalCore

♾️ All the most important server functions in one!
https://eternalcode.pl
GNU General Public License v3.0
79 stars 17 forks source link

Dependency updating beetwen version is not working. #792

Closed vLuckyyy closed 4 months ago

vLuckyyy commented 4 months ago

What does it mean that it is not working properly? The problem is very complex, it concerns the addition of new dependencies.

For example: If EternalCore 1.2.2 did not have the Caffeine library, but EternalCore 1.3.0 does, and the plugin is updated from version 1.2.2 (with downloaded dependencies for 1.2.2 in localRepository) to 1.3.0, the following error occurs

[21:17:12] [Server thread/ERROR]: Error occurred while enabling EternalCore v1.3.0 (Is it up to date?)
com.eternalcode.core.injector.DependencyInjectorException: java.lang.reflect.InvocationTargetException
    at EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar/com.eternalcode.core.injector.DependencyInjector.newInstance(DependencyInjector.java:91) ~[EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar:?]
    at EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar/com.eternalcode.core.injector.DependencyInjector.newInstance(DependencyInjector.java:26) ~[EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar:?]
    at EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar/com.eternalcode.core.injector.scan.ComponentBeanCandidateImpl.createBean(ComponentBeanCandidateImpl.java:33) ~[EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar:?]
    at EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar/com.eternalcode.core.injector.bean.BeanFactory.initializeCandidate(BeanFactory.java:117) ~[EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar:?]
    at EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar/com.eternalcode.core.injector.bean.BeanFactory.createBeanFromCandidate(BeanFactory.java:78) ~[EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar:?]
    at EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar/com.eternalcode.core.injector.bean.BeanFactory.getSingletonBean(BeanFactory.java:48) ~[EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar:?]
    at EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar/com.eternalcode.core.injector.bean.BeanFactory.getDependency(BeanFactory.java:26) ~[EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar:?]
    at EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar/com.eternalcode.core.injector.DependencyInjector.getDependency(DependencyInjector.java:64) ~[EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar:?]
    at EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar/com.eternalcode.core.injector.DependencyInjector.newInstance(DependencyInjector.java:79) ~[EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar:?]
    at EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar/com.eternalcode.core.injector.DependencyInjector.newInstance(DependencyInjector.java:26) ~[EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar:?]
    at EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar/com.eternalcode.core.injector.scan.ComponentBeanCandidateImpl.createBean(ComponentBeanCandidateImpl.java:33) ~[EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar:?]
    at EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar/com.eternalcode.core.injector.bean.BeanFactory.initializeCandidate(BeanFactory.java:117) ~[EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar:?]
    at EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar/com.eternalcode.core.injector.bean.BeanFactory.initializeCandidates(BeanFactory.java:110) ~[EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar:?]
    at EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar/com.eternalcode.core.EternalCore.<init>(EternalCore.java:56) ~[EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar:?]
    at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62) ~[?:?]
    at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502) ~[?:?]
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486) ~[?:?]
    at EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar/com.eternalcode.core.loader.EternalCoreWrapper.enable(EternalCoreWrapper.java:25) ~[EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar:?]
    at EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar/com.eternalcode.core.loader.EternalCoreLoader.onEnable(EternalCoreLoader.java:26) ~[EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar:?]
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:287) ~[paper-api-1.20.6-R0.1-SNAPSHOT.jar:?]
    at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:202) ~[paper-1.20.6.jar:1.20.6-138-906df69]
    at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:109) ~[paper-1.20.6.jar:1.20.6-138-906df69]
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:519) ~[paper-api-1.20.6-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.craftbukkit.CraftServer.enablePlugin(CraftServer.java:604) ~[paper-1.20.6.jar:1.20.6-138-906df69]
    at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:553) ~[paper-1.20.6.jar:1.20.6-138-906df69]
    at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:675) ~[paper-1.20.6.jar:1.20.6-138-906df69]
    at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:437) ~[paper-1.20.6.jar:1.20.6-138-906df69]
    at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:323) ~[paper-1.20.6.jar:1.20.6-138-906df69]
    at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1136) ~[paper-1.20.6.jar:1.20.6-138-906df69]
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:323) ~[paper-1.20.6.jar:1.20.6-138-906df69]
    at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]
Caused by: java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:74) ~[?:?]
    at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502) ~[?:?]
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486) ~[?:?]
    at EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar/com.eternalcode.core.injector.DependencyInjector.newInstance(DependencyInjector.java:85) ~[EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar:?]
    ... 30 more
Caused by: java.lang.NoClassDefFoundError: com/eternalcode/core/libs/com/github/benmanes/caffeine/cache/Caffeine
    at EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar/com.eternalcode.core.feature.chat.ChatServiceImpl.<init>(ChatServiceImpl.java:20) ~[EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar:?]
    at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62) ~[?:?]
    at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502) ~[?:?]
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486) ~[?:?]
    at EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar/com.eternalcode.core.injector.DependencyInjector.newInstance(DependencyInjector.java:85) ~[EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar:?]
    ... 30 more
Caused by: java.lang.ClassNotFoundException: com.eternalcode.core.libs.com.github.benmanes.caffeine.cache.Caffeine
    at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:197) ~[paper-api-1.20.6-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:164) ~[paper-api-1.20.6-R0.1-SNAPSHOT.jar:?]
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526) ~[?:?]
    at EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar/com.eternalcode.core.feature.chat.ChatServiceImpl.<init>(ChatServiceImpl.java:20) ~[EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar:?]
    at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62) ~[?:?]
    at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502) ~[?:?]
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486) ~[?:?]
    at EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar/com.eternalcode.core.injector.DependencyInjector.newInstance(DependencyInjector.java:85) ~[EternalCore.v1.3.0.MC.1.17.x-1.20.x.jar:?]
    ... 30 more
[21:17:12] [Server thread/INFO]: [EternalCore] Disabling EternalCore v1.3.0

The solution to this problem is to delete the localRepository folder and re-download the dependencies at server startup

This is not the first such action, this error has been repeated many times, someone should do something about it, it is impossible to live like this!