PaperMC / Paper

The most widely used, high performance Minecraft server that aims to fix gameplay and mechanics inconsistencies
https://papermc.io/
Other
10.06k stars 2.34k forks source link

Build 177+ Duplicate class definition for com.sk89q.worldedit.bukkit.BukkitPlayer #3137

Closed HcNguyen111 closed 4 years ago

HcNguyen111 commented 4 years ago

What behaviour is observed:

PlayerJoinEvent:

[16:18:46 ERROR]: Could not pass event PlayerJoinEvent to WorldGuard v7.0.3-SNAPSHOT;2030-17c1647
java.lang.LinkageError: loader org.bukkit.plugin.java.PluginClassLoader @bdefa3b attempted duplicate class definition for com.sk89q.worldedit.bukkit.BukkitPlayer. (com.sk89q.worldedit.bukkit.BukkitPlayer is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @bdefa3b, parent loader 'app')
    at java.lang.ClassLoader.defineClass1(Native Method) ~[?:?]
    at java.lang.ClassLoader.defineClass(ClassLoader.java:1016) ~[?:?]
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151) ~[?:?]
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:167) ~[patched_1.15.2.jar:git-Paper-177]
    at org.bukkit.plugin.java.JavaPluginLoader.getClassByName(JavaPluginLoader.java:201) ~[patched_1.15.2.jar:git-Paper-177]
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:111) ~[patched_1.15.2.jar:git-Paper-177]
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:100) ~[patched_1.15.2.jar:git-Paper-177]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:588) ~[?:?]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[?:?]
    at java.lang.ClassLoader.defineClass1(Native Method) ~[?:?]
    at java.lang.ClassLoader.defineClass(ClassLoader.java:1016) ~[?:?]
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151) ~[?:?]
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:167) ~[patched_1.15.2.jar:git-Paper-177]
    at org.bukkit.plugin.java.JavaPluginLoader.getClassByName(JavaPluginLoader.java:201) ~[patched_1.15.2.jar:git-Paper-177]
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:111) ~[patched_1.15.2.jar:git-Paper-177]
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:100) ~[patched_1.15.2.jar:git-Paper-177]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:588) ~[?:?]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[?:?]
    at com.sk89q.worldguard.bukkit.WorldGuardPlugin.wrapPlayer(WorldGuardPlugin.java:404) ~[?:?]
    at com.sk89q.worldguard.bukkit.listener.WorldGuardPlayerListener.onPlayerJoin(WorldGuardPlayerListener.java:120) ~[?:?]
    at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor145.execute(Unknown Source) ~[?:?]
    at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.15.2.jar:git-Paper-177]
    at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[patched_1.15.2.jar:git-Paper-177]
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.15.2.jar:git-Paper-177]
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:607) ~[patched_1.15.2.jar:git-Paper-177]
    at net.minecraft.server.v1_15_R1.PlayerList.a(PlayerList.java:193) ~[patched_1.15.2.jar:git-Paper-177]
    at net.minecraft.server.v1_15_R1.LoginListener.c(LoginListener.java:174) ~[patched_1.15.2.jar:git-Paper-177]
    at net.minecraft.server.v1_15_R1.LoginListener.tick(LoginListener.java:65) ~[patched_1.15.2.jar:git-Paper-177]
    at net.minecraft.server.v1_15_R1.NetworkManager.a(NetworkManager.java:256) ~[patched_1.15.2.jar:git-Paper-177]
    at net.minecraft.server.v1_15_R1.ServerConnection.c(ServerConnection.java:139) ~[patched_1.15.2.jar:git-Paper-177]
    at net.minecraft.server.v1_15_R1.MinecraftServer.b(MinecraftServer.java:1296) ~[patched_1.15.2.jar:git-Paper-177]
    at net.minecraft.server.v1_15_R1.DedicatedServer.b(DedicatedServer.java:430) ~[patched_1.15.2.jar:git-Paper-177]
    at net.minecraft.server.v1_15_R1.MinecraftServer.a(MinecraftServer.java:1133) ~[patched_1.15.2.jar:git-Paper-177]
    at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:941) ~[patched_1.15.2.jar:git-Paper-177]
    at java.lang.Thread.run(Thread.java:830) [?:?]

java.lang.LinkageError: loader org.bukkit.plugin.java.PluginClassLoader @bdefa3b attempted duplicate class definition for com.sk89q.worldedit.bukkit.BukkitPlayer:

[16:18:47 WARN]: [WorldGuard] Task #26 for WorldGuard v7.0.3-SNAPSHOT;2030-17c1647 generated an exception
java.lang.LinkageError: loader org.bukkit.plugin.java.PluginClassLoader @bdefa3b attempted duplicate class definition for com.sk89q.worldedit.bukkit.BukkitPlayer. (com.sk89q.worldedit.bukkit.BukkitPlayer is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @bdefa3b, parent loader 'app')
    at com.sk89q.worldguard.bukkit.WorldGuardPlugin.wrapPlayer(WorldGuardPlugin.java:404) ~[?:?]
    at com.sk89q.worldguard.bukkit.session.BukkitSessionManager.run(BukkitSessionManager.java:70) ~[?:?]
    at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftTask.run(CraftTask.java:84) ~[patched_1.15.2.jar:git-Paper-177]
    at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:452) ~[patched_1.15.2.jar:git-Paper-177]
    at net.minecraft.server.v1_15_R1.MinecraftServer.b(MinecraftServer.java:1212) ~[patched_1.15.2.jar:git-Paper-177]
    at net.minecraft.server.v1_15_R1.DedicatedServer.b(DedicatedServer.java:430) ~[patched_1.15.2.jar:git-Paper-177]
    at net.minecraft.server.v1_15_R1.MinecraftServer.a(MinecraftServer.java:1133) ~[patched_1.15.2.jar:git-Paper-177]
    at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:941) ~[patched_1.15.2.jar:git-Paper-177]
    at java.lang.Thread.run(Thread.java:830) [?:?]

PlayerMoveEvent:

[16:13:29 ERROR]: Could not pass event PlayerMoveEvent to WorldGuard v7.0.3-SNAPSHOT;2030-17c1647
java.lang.LinkageError: loader org.bukkit.plugin.java.PluginClassLoader @43729ac1 attempted duplicate class definition for com.sk89q.worldedit.bukkit.BukkitPlayer. (com.sk89q.worldedit.bukkit.BukkitPlayer is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @43729ac1, parent loader 'app')
    at com.sk89q.worldguard.bukkit.WorldGuardPlugin.wrapPlayer(WorldGuardPlugin.java:404) ~[?:?]
    at com.sk89q.worldguard.bukkit.listener.PlayerMoveListener.onPlayerMove(PlayerMoveListener.java:89) ~[?:?]
    at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor180.execute(Unknown Source) ~[?:?]
    at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.15.2.jar:git-Paper-181]
    at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[patched_1.15.2.jar:git-Paper-181]
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.15.2.jar:git-Paper-181]
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:607) ~[patched_1.15.2.jar:git-Paper-181]
    at net.minecraft.server.v1_15_R1.PlayerConnection.a(PlayerConnection.java:1115) ~[patched_1.15.2.jar:git-Paper-181]
    at net.minecraft.server.v1_15_R1.PacketPlayInFlying.a(SourceFile:122) ~[patched_1.15.2.jar:git-Paper-181]
    at net.minecraft.server.v1_15_R1.PacketPlayInFlying$PacketPlayInPosition.a(SourceFile:56) ~[patched_1.15.2.jar:git-Paper-181]
    at net.minecraft.server.v1_15_R1.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConnectionUtils.java:23) ~[patched_1.15.2.jar:git-Paper-181]
    at net.minecraft.server.v1_15_R1.TickTask.run(SourceFile:18) ~[patched_1.15.2.jar:git-Paper-181]
    at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136) ~[patched_1.15.2.jar:git-Paper-181]
    at net.minecraft.server.v1_15_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[patched_1.15.2.jar:git-Paper-181]
    at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) ~[patched_1.15.2.jar:git-Paper-181]
    at net.minecraft.server.v1_15_R1.MinecraftServer.ba(MinecraftServer.java:1059) ~[patched_1.15.2.jar:git-Paper-181]
    at net.minecraft.server.v1_15_R1.MinecraftServer.executeNext(MinecraftServer.java:1052) ~[patched_1.15.2.jar:git-Paper-181]
    at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119) ~[patched_1.15.2.jar:git-Paper-181]
    at net.minecraft.server.v1_15_R1.MinecraftServer.sleepForTick(MinecraftServer.java:1022) ~[patched_1.15.2.jar:git-Paper-181]
    at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:945) ~[patched_1.15.2.jar:git-Paper-181]
    at java.lang.Thread.run(Thread.java:830) [?:?]

UseBlockEvent:

[16:13:34 ERROR]: Could not pass event UseBlockEvent to WorldGuard v7.0.3-SNAPSHOT;2030-17c1647
java.lang.LinkageError: loader org.bukkit.plugin.java.PluginClassLoader @43729ac1 attempted duplicate class definition for com.sk89q.worldedit.bukkit.BukkitPlayer. (com.sk89q.worldedit.bukkit.BukkitPlayer is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @43729ac1, parent loader 'app')
    at com.sk89q.worldguard.bukkit.WorldGuardPlugin.wrapPlayer(WorldGuardPlugin.java:404) ~[?:?]
    at com.sk89q.worldguard.bukkit.listener.BlacklistListener.onUseBlock(BlacklistListener.java:137) ~[?:?]
    at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor193.execute(Unknown Source) ~[?:?]
    at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.15.2.jar:git-Paper-181]
    at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[patched_1.15.2.jar:git-Paper-181]
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.15.2.jar:git-Paper-181]
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:607) ~[patched_1.15.2.jar:git-Paper-181]
    at com.sk89q.worldguard.bukkit.util.Events.fireAndTestCancel(Events.java:60) ~[?:?]
    at com.sk89q.worldguard.bukkit.listener.EventAbstractionListener.onPlayerInteract(EventAbstractionListener.java:471) ~[?:?]
    at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor242.execute(Unknown Source) ~[?:?]
    at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.15.2.jar:git-Paper-181]
    at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[patched_1.15.2.jar:git-Paper-181]
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.15.2.jar:git-Paper-181]
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:607) ~[patched_1.15.2.jar:git-Paper-181]
    at org.bukkit.craftbukkit.v1_15_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:463) ~[patched_1.15.2.jar:git-Paper-181]
    at net.minecraft.server.v1_15_R1.PlayerInteractManager.a(PlayerInteractManager.java:450) ~[patched_1.15.2.jar:git-Paper-181]
    at net.minecraft.server.v1_15_R1.PlayerConnection.a(PlayerConnection.java:1378) ~[patched_1.15.2.jar:git-Paper-181]
    at net.minecraft.server.v1_15_R1.PacketPlayInUseItem.a(PacketPlayInUseItem.java:27) ~[patched_1.15.2.jar:git-Paper-181]
    at net.minecraft.server.v1_15_R1.PacketPlayInUseItem.a(PacketPlayInUseItem.java:5) ~[patched_1.15.2.jar:git-Paper-181]
    at net.minecraft.server.v1_15_R1.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConnectionUtils.java:23) ~[patched_1.15.2.jar:git-Paper-181]
    at net.minecraft.server.v1_15_R1.TickTask.run(SourceFile:18) ~[patched_1.15.2.jar:git-Paper-181]
    at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136) ~[patched_1.15.2.jar:git-Paper-181]
    at net.minecraft.server.v1_15_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[patched_1.15.2.jar:git-Paper-181]
    at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) ~[patched_1.15.2.jar:git-Paper-181]
    at net.minecraft.server.v1_15_R1.MinecraftServer.ba(MinecraftServer.java:1059) ~[patched_1.15.2.jar:git-Paper-181]
    at net.minecraft.server.v1_15_R1.MinecraftServer.executeNext(MinecraftServer.java:1052) ~[patched_1.15.2.jar:git-Paper-181]
    at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119) ~[patched_1.15.2.jar:git-Paper-181]
    at net.minecraft.server.v1_15_R1.MinecraftServer.sleepForTick(MinecraftServer.java:1022) ~[patched_1.15.2.jar:git-Paper-181]
    at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:945) ~[patched_1.15.2.jar:git-Paper-181]
    at java.lang.Thread.run(Thread.java:830) [?:?]

Steps/models to reproduce:

Update to Paper 177 - 181. (176 is fine.)

Plugin list:

EssentialsX Build 874 LuckPerms Build 1044 Multiverse-Core Build 777 Multiverse-Inventories Build 469 Multiverse-NetherPortals Build 764 Multiverse-Portals Build 808 Multiverse-SignPortals Build 479 ProtocolLib Build 447 ViaVersion Build 398 WorldEdit Build 4966 WorldGuard Build 2030

Paper build number:

177+.

Anything else:

Paper 176 is fine and does not present these errors.

aikar commented 4 years ago

You have 2 world guard plugins in your plugins folder. You likely updated it but forgot to delete the old one.

Please delete the old version and you'll be back up and running.

HcNguyen111 commented 4 years ago

Hello, thanks for the quick action.

I am certain that there is only 1 WorldGuard JAR. Simply updating to Paper 177+ presents the error, and going back to 176 does not. (Without touching plugins/configs, etc.)

Previously missed Plugin: WorldEditSUI v1.7.1

Thanks and apologies.

aikar commented 4 years ago

Then you have a bad plugin that is shading WorldGuard or WorldEdit into it's jar when it should not be.

Run the following command in your server folder:

find plugins -type f -name "*.jar" -exec bash -c 'echo {} ; unzip -l {} | grep BukkitPlayer' \;

This will tell you what plugins have BukkitPlayer defined printed above it.

HcNguyen111 commented 4 years ago

Just WorldGuard and WorldEdit themselves have BukkitPlayer.class defined.

Anywho, the errors have gone away with an update to Paper Build 183 - not that I'm indicating PaperMC was in any way at fault. (Looking at 182 and 183's commits I don't even see how any of those changes could have remotely done anything and will just put it all down to magic.)

Thanks again. If anything comes up in the future, I'll contact the relevant parties.

TNTUP commented 4 years ago

I can confirm with WG/WE/WorldEditSUI. Somehow it affected DiscordSRV, i don't know. Rebooting solved it I guess. Updated WorldEditSUI and that seems to have fixed it

Menschomat commented 4 years ago

I've got more or less the same problem. Server runs fine with 177 but pushes out errors with the 183.


java.lang.LinkageError: loader org.bukkit.plugin.java.PluginClassLoader @10355008 attempted duplicate class definition for com.sk89q.worldedit.bukkit.BukkitPlayer. (com.sk89q.worldedit.bukkit.BukkitPlayer is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @10355008, parent loader 'app')
    at com.sk89q.worldedit.bukkit.WorldEditPlugin.wrapPlayer(WorldEditPlugin.java:439) ~[?:?]
    at com.sk89q.worldedit.bukkit.BukkitAdapter.adapt(BukkitAdapter.java:141) ~[?:?]
    at com.gmail.nossr50.worldguard.WorldGuardManager.hasMainFlag(WorldGuardManager.java:31) ~[?:?]
    at com.gmail.nossr50.listeners.EntityListener.onFoodLevelChange(EntityListener.java:879) ~[?:?]
    at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor305.execute(Unknown Source) ~[?:?]
    at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.15.2.jar:git-Paper-183]
    at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[patched_1.15.2.jar:git-Paper-183]
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.15.2.jar:git-Paper-183]
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:607) ~[patched_1.15.2.jar:git-Paper-183]
    at org.bukkit.craftbukkit.v1_15_R1.event.CraftEventFactory.callFoodLevelChangeEvent(CraftEventFactory.java:1125) ~[patched_1.15.2.jar:git-Paper-183]
    at org.bukkit.craftbukkit.v1_15_R1.event.CraftEventFactory.callFoodLevelChangeEvent(CraftEventFactory.java:1120) ~[patched_1.15.2.jar:git-Paper-183]
    at net.minecraft.server.v1_15_R1.FoodMetaData.a(FoodMetaData.java:54) ~[patched_1.15.2.jar:git-Paper-183]
    at net.minecraft.server.v1_15_R1.EntityHuman.tick(EntityHuman.java:177) ~[patched_1.15.2.jar:git-Paper-183]
    at net.minecraft.server.v1_15_R1.EntityPlayer.playerTick(EntityPlayer.java:438) ~[patched_1.15.2.jar:git-Paper-183]
    at net.minecraft.server.v1_15_R1.PlayerConnection.tick(PlayerConnection.java:149) ~[patched_1.15.2.jar:git-Paper-183]
    at net.minecraft.server.v1_15_R1.NetworkManager.a(NetworkManager.java:260) ~[patched_1.15.2.jar:git-Paper-183]
    at net.minecraft.server.v1_15_R1.ServerConnection.c(ServerConnection.java:139) ~[patched_1.15.2.jar:git-Paper-183]
    at net.minecraft.server.v1_15_R1.MinecraftServer.b(MinecraftServer.java:1296) ~[patched_1.15.2.jar:git-Paper-183]
    at net.minecraft.server.v1_15_R1.DedicatedServer.b(DedicatedServer.java:430) ~[patched_1.15.2.jar:git-Paper-183]
    at net.minecraft.server.v1_15_R1.MinecraftServer.a(MinecraftServer.java:1133) ~[patched_1.15.2.jar:git-Paper-183]
    at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:941) ~[patched_1.15.2.jar:git-Paper-183]
    at java.lang.Thread.run(Thread.java:834) [?:?] ```
matbcvo commented 4 years ago

I have same problem. All was good on Paper build 171 until I updated to build 183, then I was getting errors spammed.

[17:49:56] [Server thread/INFO]: This server is running Paper version git-Paper-183 (MC: 1.15.2) (Implementing API version 1.15.2-R0.1-SNAPSHOT)

[17:49:59] [Server thread/INFO]: [WorldEdit] Loading WorldEdit v7.1.0;8e55131

Using only WorldGuard and WorldEdit.

[18:08:47] [Server thread/ERROR]: Could not pass event PlayerInteractEvent to WorldEdit v7.1.0;8e55131
java.lang.LinkageError: loader org.bukkit.plugin.java.PluginClassLoader @23cd6a9 attempted duplicate class definition for com.sk89q.worldedit.bukkit.BukkitPlayer. (com.sk89q.worldedit.bukkit.BukkitPlayer is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @23cd6a9, parent loader 'app')
    at com.sk89q.worldedit.bukkit.WorldEditPlugin.wrapPlayer(WorldEditPlugin.java:439) ~[?:?]
    at com.sk89q.worldedit.bukkit.WorldEditListener.onPlayerInteract(WorldEditListener.java:105) ~[?:?]
    at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor13.execute(Unknown Source) ~[?:?]
    at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.15.2.jar:git-Paper-183]
    at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[patched_1.15.2.jar:git-Paper-183]
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.15.2.jar:git-Paper-183]
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:607) ~[patched_1.15.2.jar:git-Paper-183]
    at org.bukkit.craftbukkit.v1_15_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:463) ~[patched_1.15.2.jar:git-Paper-183]
    at org.bukkit.craftbukkit.v1_15_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:430) ~[patched_1.15.2.jar:git-Paper-183]
    at net.minecraft.server.v1_15_R1.PlayerInteractManager.a(PlayerInteractManager.java:137) ~[patched_1.15.2.jar:git-Paper-183]
    at net.minecraft.server.v1_15_R1.PlayerConnection.a(PlayerConnection.java:1324) ~[patched_1.15.2.jar:git-Paper-183]
    at net.minecraft.server.v1_15_R1.PacketPlayInBlockDig.a(SourceFile:40) ~[patched_1.15.2.jar:git-Paper-183]
    at net.minecraft.server.v1_15_R1.PacketPlayInBlockDig.a(SourceFile:10) ~[patched_1.15.2.jar:git-Paper-183]
    at net.minecraft.server.v1_15_R1.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConnectionUtils.java:23) ~[patched_1.15.2.jar:git-Paper-183]
    at net.minecraft.server.v1_15_R1.TickTask.run(SourceFile:18) ~[patched_1.15.2.jar:git-Paper-183]
    at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136) ~[patched_1.15.2.jar:git-Paper-183]
    at net.minecraft.server.v1_15_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[patched_1.15.2.jar:git-Paper-183]
    at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) ~[patched_1.15.2.jar:git-Paper-183]
    at net.minecraft.server.v1_15_R1.MinecraftServer.ba(MinecraftServer.java:1059) ~[patched_1.15.2.jar:git-Paper-183]
    at net.minecraft.server.v1_15_R1.MinecraftServer.executeNext(MinecraftServer.java:1052) ~[patched_1.15.2.jar:git-Paper-183]
    at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119) ~[patched_1.15.2.jar:git-Paper-183]
    at net.minecraft.server.v1_15_R1.MinecraftServer.a(MinecraftServer.java:1123) ~[patched_1.15.2.jar:git-Paper-183]
    at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:941) ~[patched_1.15.2.jar:git-Paper-183]
    at java.lang.Thread.run(Thread.java:834) [?:?]

bit different error when server was starting to run:

[17:50:23] [ForkJoinPool.commonPool-worker-5/WARN]: Exception in thread "ForkJoinPool.commonPool-worker-5" java.lang.LinkageError: loader org.bukkit.plugin.java.PluginClassLoader @23cd6a9 attempted duplicate class definition for com.sk89q.worldedit.bukkit.BukkitPlayer. (com.sk89q.worldedit.bukkit.BukkitPlayer is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @23cd6a9, parent loader 'app')
[17:50:23] [ForkJoinPool.commonPool-worker-5/WARN]:     at java.base/java.lang.ClassLoader.defineClass1(Native Method)
[17:50:23] [ForkJoinPool.commonPool-worker-5/WARN]:     at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
[17:50:23] [ForkJoinPool.commonPool-worker-5/WARN]:     at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
[17:50:23] [ForkJoinPool.commonPool-worker-5/WARN]:     at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:167)
[17:50:23] [ForkJoinPool.commonPool-worker-5/WARN]:     at org.bukkit.plugin.java.JavaPluginLoader.getClassByName(JavaPluginLoader.java:201)
[17:50:23] [ForkJoinPool.commonPool-worker-5/WARN]:     at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:111)
[17:50:23] [ForkJoinPool.commonPool-worker-5/WARN]:     at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:100)
[17:50:23] [ForkJoinPool.commonPool-worker-5/WARN]:     at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
[17:50:23] [ForkJoinPool.commonPool-worker-5/WARN]:     at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
[17:50:23] [ForkJoinPool.commonPool-worker-5/WARN]:     at com.sk89q.worldedit.bukkit.WorldEditPlugin.wrapPlayer(WorldEditPlugin.java:439)
[17:50:23] [ForkJoinPool.commonPool-worker-5/WARN]:     at com.sk89q.worldedit.bukkit.WorldEditPlugin.wrapCommandSender(WorldEditPlugin.java:444)
[17:50:23] [ForkJoinPool.commonPool-worker-5/WARN]:     at com.sk89q.worldedit.bukkit.BukkitCommandInspector.lambda$testPermission$0(BukkitCommandInspector.java:81)
[17:50:23] [ForkJoinPool.commonPool-worker-5/WARN]:     at org.enginehub.piston.inject.MapBackedValueStore.lambda$injectedValue$0(MapBackedValueStore.java:56)
[17:50:23] [ForkJoinPool.commonPool-worker-5/WARN]:     at java.base/java.util.Optional.flatMap(Optional.java:294)
[17:50:23] [ForkJoinPool.commonPool-worker-5/WARN]:     at org.enginehub.piston.inject.MapBackedValueStore.injectedValue(MapBackedValueStore.java:56)
[17:50:23] [ForkJoinPool.commonPool-worker-5/WARN]:     at org.enginehub.piston.inject.InjectedValueAccess.injectedValue(InjectedValueAccess.java:44)
[17:50:23] [ForkJoinPool.commonPool-worker-5/WARN]:     at com.sk89q.worldedit.command.util.PermissionCondition.satisfied(PermissionCondition.java:46)
[17:50:23] [ForkJoinPool.commonPool-worker-5/WARN]:     at com.sk89q.worldedit.bukkit.BukkitCommandInspector.testPermission(BukkitCommandInspector.java:82)
[17:50:23] [ForkJoinPool.commonPool-worker-5/WARN]:     at com.sk89q.bukkit.util.DynamicPluginCommand.testPermissionSilent(DynamicPluginCommand.java:100)
[17:50:23] [ForkJoinPool.commonPool-worker-5/WARN]:     at org.bukkit.craftbukkit.v1_15_R1.command.BukkitCommandWrapper.test(BukkitCommandWrapper.java:39)
[17:50:23] [ForkJoinPool.commonPool-worker-5/WARN]:     at org.bukkit.craftbukkit.v1_15_R1.command.BukkitCommandWrapper.test(BukkitCommandWrapper.java:20)
[17:50:23] [ForkJoinPool.commonPool-worker-5/WARN]:     at com.mojang.brigadier.tree.CommandNode.canUse(CommandNode.java:78)
[17:50:23] [ForkJoinPool.commonPool-worker-5/WARN]:     at net.minecraft.server.v1_15_R1.CommandDispatcher.a(CommandDispatcher.java:297)
[17:50:23] [ForkJoinPool.commonPool-worker-5/WARN]:     at net.minecraft.server.v1_15_R1.CommandDispatcher.sendAsync(CommandDispatcher.java:263)
[17:50:23] [ForkJoinPool.commonPool-worker-5/WARN]:     at net.minecraft.server.v1_15_R1.CommandDispatcher.lambda$a$4(CommandDispatcher.java:246)
[17:50:23] [ForkJoinPool.commonPool-worker-5/WARN]:     at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
[17:50:23] [ForkJoinPool.commonPool-worker-5/WARN]:     at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
[17:50:23] [ForkJoinPool.commonPool-worker-5/WARN]:     at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
[17:50:23] [ForkJoinPool.commonPool-worker-5/WARN]:     at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
[17:50:23] [ForkJoinPool.commonPool-worker-5/WARN]:     at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
[17:50:23] [ForkJoinPool.commonPool-worker-5/WARN]:     at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
[17:50:24] [ForkJoinPool.commonPool-worker-7/WARN]: Exception in thread "ForkJoinPool.commonPool-worker-7" java.lang.LinkageError: loader org.bukkit.plugin.java.PluginClassLoader @23cd6a9 attempted duplicate class definition for com.sk89q.worldedit.bukkit.BukkitPlayer. (com.sk89q.worldedit.bukkit.BukkitPlayer is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @23cd6a9, parent loader 'app')
[17:50:24] [ForkJoinPool.commonPool-worker-7/WARN]:     at com.sk89q.worldedit.bukkit.WorldEditPlugin.wrapPlayer(WorldEditPlugin.java:439)
[17:50:24] [ForkJoinPool.commonPool-worker-7/WARN]:     at com.sk89q.worldedit.bukkit.WorldEditPlugin.wrapCommandSender(WorldEditPlugin.java:444)
[17:50:24] [ForkJoinPool.commonPool-worker-7/WARN]:     at com.sk89q.worldedit.bukkit.BukkitCommandInspector.lambda$testPermission$0(BukkitCommandInspector.java:81)
[17:50:24] [ForkJoinPool.commonPool-worker-7/WARN]:     at org.enginehub.piston.inject.MapBackedValueStore.lambda$injectedValue$0(MapBackedValueStore.java:56)
[17:50:24] [ForkJoinPool.commonPool-worker-7/WARN]:     at java.base/java.util.Optional.flatMap(Optional.java:294)
[17:50:24] [ForkJoinPool.commonPool-worker-7/WARN]:     at org.enginehub.piston.inject.MapBackedValueStore.injectedValue(MapBackedValueStore.java:56)
[17:50:24] [ForkJoinPool.commonPool-worker-7/WARN]:     at org.enginehub.piston.inject.InjectedValueAccess.injectedValue(InjectedValueAccess.java:44)
[17:50:24] [ForkJoinPool.commonPool-worker-7/WARN]:     at com.sk89q.worldedit.command.util.PermissionCondition.satisfied(PermissionCondition.java:46)
[17:50:24] [ForkJoinPool.commonPool-worker-7/WARN]:     at com.sk89q.worldedit.bukkit.BukkitCommandInspector.testPermission(BukkitCommandInspector.java:82)
[17:50:24] [ForkJoinPool.commonPool-worker-7/WARN]:     at com.sk89q.bukkit.util.DynamicPluginCommand.testPermissionSilent(DynamicPluginCommand.java:100)
[17:50:24] [ForkJoinPool.commonPool-worker-7/WARN]:     at org.bukkit.craftbukkit.v1_15_R1.command.BukkitCommandWrapper.test(BukkitCommandWrapper.java:39)
[17:50:24] [ForkJoinPool.commonPool-worker-7/WARN]:     at org.bukkit.craftbukkit.v1_15_R1.command.BukkitCommandWrapper.test(BukkitCommandWrapper.java:20)
[17:50:24] [ForkJoinPool.commonPool-worker-7/WARN]:     at com.mojang.brigadier.tree.CommandNode.canUse(CommandNode.java:78)
[17:50:24] [ForkJoinPool.commonPool-worker-7/WARN]:     at net.minecraft.server.v1_15_R1.CommandDispatcher.a(CommandDispatcher.java:297)
[17:50:24] [ForkJoinPool.commonPool-worker-7/WARN]:     at net.minecraft.server.v1_15_R1.CommandDispatcher.sendAsync(CommandDispatcher.java:263)
[17:50:24] [ForkJoinPool.commonPool-worker-7/WARN]:     at net.minecraft.server.v1_15_R1.CommandDispatcher.lambda$a$4(CommandDispatcher.java:246)
[17:50:24] [ForkJoinPool.commonPool-worker-7/WARN]:     at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
[17:50:24] [ForkJoinPool.commonPool-worker-7/WARN]:     at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
[17:50:24] [ForkJoinPool.commonPool-worker-7/WARN]:     at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
[17:50:24] [ForkJoinPool.commonPool-worker-7/WARN]:     at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
[17:50:24] [ForkJoinPool.commonPool-worker-7/WARN]:     at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
[17:50:24] [ForkJoinPool.commonPool-worker-7/WARN]:     at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
[17:50:24] [ForkJoinPool.commonPool-worker-3/WARN]: Exception in thread "ForkJoinPool.commonPool-worker-3" java.lang.LinkageError: loader org.bukkit.plugin.java.PluginClassLoader @23cd6a9 attempted duplicate class definition for com.sk89q.worldedit.bukkit.BukkitPlayer. (com.sk89q.worldedit.bukkit.BukkitPlayer is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @23cd6a9, parent loader 'app')
[17:50:24] [ForkJoinPool.commonPool-worker-3/WARN]:     at com.sk89q.worldedit.bukkit.WorldEditPlugin.wrapPlayer(WorldEditPlugin.java:439)
[17:50:24] [ForkJoinPool.commonPool-worker-3/WARN]:     at com.sk89q.worldedit.bukkit.WorldEditPlugin.wrapCommandSender(WorldEditPlugin.java:444)
[17:50:24] [ForkJoinPool.commonPool-worker-3/WARN]:     at com.sk89q.worldedit.bukkit.BukkitCommandInspector.lambda$testPermission$0(BukkitCommandInspector.java:81)
[17:50:24] [ForkJoinPool.commonPool-worker-3/WARN]:     at org.enginehub.piston.inject.MapBackedValueStore.lambda$injectedValue$0(MapBackedValueStore.java:56)
[17:50:24] [ForkJoinPool.commonPool-worker-3/WARN]:     at java.base/java.util.Optional.flatMap(Optional.java:294)
[17:50:24] [ForkJoinPool.commonPool-worker-3/WARN]:     at org.enginehub.piston.inject.MapBackedValueStore.injectedValue(MapBackedValueStore.java:56)
[17:50:24] [ForkJoinPool.commonPool-worker-3/WARN]:     at org.enginehub.piston.inject.InjectedValueAccess.injectedValue(InjectedValueAccess.java:44)
[17:50:24] [ForkJoinPool.commonPool-worker-3/WARN]:     at com.sk89q.worldedit.command.util.PermissionCondition.satisfied(PermissionCondition.java:46)
[17:50:24] [ForkJoinPool.commonPool-worker-3/WARN]:     at com.sk89q.worldedit.bukkit.BukkitCommandInspector.testPermission(BukkitCommandInspector.java:82)
[17:50:24] [ForkJoinPool.commonPool-worker-3/WARN]:     at com.sk89q.bukkit.util.DynamicPluginCommand.testPermissionSilent(DynamicPluginCommand.java:100)
[17:50:24] [ForkJoinPool.commonPool-worker-3/WARN]:     at org.bukkit.craftbukkit.v1_15_R1.command.BukkitCommandWrapper.test(BukkitCommandWrapper.java:39)
[17:50:24] [ForkJoinPool.commonPool-worker-3/WARN]:     at org.bukkit.craftbukkit.v1_15_R1.command.BukkitCommandWrapper.test(BukkitCommandWrapper.java:20)
[17:50:24] [ForkJoinPool.commonPool-worker-3/WARN]:     at com.mojang.brigadier.tree.CommandNode.canUse(CommandNode.java:78)
[17:50:24] [ForkJoinPool.commonPool-worker-3/WARN]:     at net.minecraft.server.v1_15_R1.CommandDispatcher.a(CommandDispatcher.java:297)
[17:50:24] [ForkJoinPool.commonPool-worker-3/WARN]:     at net.minecraft.server.v1_15_R1.CommandDispatcher.sendAsync(CommandDispatcher.java:263)
[17:50:24] [ForkJoinPool.commonPool-worker-3/WARN]:     at net.minecraft.server.v1_15_R1.CommandDispatcher.lambda$a$4(CommandDispatcher.java:246)
[17:50:24] [ForkJoinPool.commonPool-worker-3/WARN]:     at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
[17:50:24] [ForkJoinPool.commonPool-worker-3/WARN]:     at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
[17:50:24] [ForkJoinPool.commonPool-worker-3/WARN]:     at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
[17:50:24] [ForkJoinPool.commonPool-worker-3/WARN]:     at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
[17:50:24] [ForkJoinPool.commonPool-worker-3/WARN]:     at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
[17:50:24] [ForkJoinPool.commonPool-worker-3/WARN]:     at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
[17:50:25] [ForkJoinPool.commonPool-worker-9/WARN]: Exception in thread "ForkJoinPool.commonPool-worker-9" java.lang.LinkageError: loader org.bukkit.plugin.java.PluginClassLoader @23cd6a9 attempted duplicate class definition for com.sk89q.worldedit.bukkit.BukkitPlayer. (com.sk89q.worldedit.bukkit.BukkitPlayer is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @23cd6a9, parent loader 'app')
[17:50:25] [ForkJoinPool.commonPool-worker-9/WARN]:     at com.sk89q.worldedit.bukkit.WorldEditPlugin.wrapPlayer(WorldEditPlugin.java:439)
[17:50:25] [ForkJoinPool.commonPool-worker-9/WARN]:     at com.sk89q.worldedit.bukkit.WorldEditPlugin.wrapCommandSender(WorldEditPlugin.java:444)
[17:50:25] [ForkJoinPool.commonPool-worker-9/WARN]:     at com.sk89q.worldedit.bukkit.BukkitCommandInspector.lambda$testPermission$0(BukkitCommandInspector.java:81)
[17:50:25] [ForkJoinPool.commonPool-worker-9/WARN]:     at org.enginehub.piston.inject.MapBackedValueStore.lambda$injectedValue$0(MapBackedValueStore.java:56)
[17:50:25] [ForkJoinPool.commonPool-worker-9/WARN]:     at java.base/java.util.Optional.flatMap(Optional.java:294)
[17:50:25] [ForkJoinPool.commonPool-worker-9/WARN]:     at org.enginehub.piston.inject.MapBackedValueStore.injectedValue(MapBackedValueStore.java:56)
[17:50:25] [ForkJoinPool.commonPool-worker-9/WARN]:     at org.enginehub.piston.inject.InjectedValueAccess.injectedValue(InjectedValueAccess.java:44)
[17:50:25] [ForkJoinPool.commonPool-worker-9/WARN]:     at com.sk89q.worldedit.command.util.PermissionCondition.satisfied(PermissionCondition.java:46)
[17:50:25] [ForkJoinPool.commonPool-worker-9/WARN]:     at com.sk89q.worldedit.bukkit.BukkitCommandInspector.testPermission(BukkitCommandInspector.java:82)
[17:50:25] [ForkJoinPool.commonPool-worker-9/WARN]:     at com.sk89q.bukkit.util.DynamicPluginCommand.testPermissionSilent(DynamicPluginCommand.java:100)
[17:50:25] [ForkJoinPool.commonPool-worker-9/WARN]:     at org.bukkit.craftbukkit.v1_15_R1.command.BukkitCommandWrapper.test(BukkitCommandWrapper.java:39)
[17:50:25] [ForkJoinPool.commonPool-worker-9/WARN]:     at org.bukkit.craftbukkit.v1_15_R1.command.BukkitCommandWrapper.test(BukkitCommandWrapper.java:20)
[17:50:25] [ForkJoinPool.commonPool-worker-9/WARN]:     at com.mojang.brigadier.tree.CommandNode.canUse(CommandNode.java:78)
[17:50:25] [ForkJoinPool.commonPool-worker-9/WARN]:     at net.minecraft.server.v1_15_R1.CommandDispatcher.a(CommandDispatcher.java:297)
[17:50:25] [ForkJoinPool.commonPool-worker-9/WARN]:     at net.minecraft.server.v1_15_R1.CommandDispatcher.sendAsync(CommandDispatcher.java:263)
[17:50:25] [ForkJoinPool.commonPool-worker-9/WARN]:     at net.minecraft.server.v1_15_R1.CommandDispatcher.lambda$a$4(CommandDispatcher.java:246)
[17:50:25] [ForkJoinPool.commonPool-worker-9/WARN]:     at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
[17:50:25] [ForkJoinPool.commonPool-worker-9/WARN]:     at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
[17:50:25] [ForkJoinPool.commonPool-worker-9/WARN]:     at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
[17:50:25] [ForkJoinPool.commonPool-worker-9/WARN]:     at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
[17:50:25] [ForkJoinPool.commonPool-worker-9/WARN]:     at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
[17:50:25] [ForkJoinPool.commonPool-worker-9/WARN]:     at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
wizjany commented 4 years ago

last stacktrace points to https://github.com/PaperMC/Paper/commit/06044e24584c48a6c8380872a250275b06418b6d possibly being an issue. class being loaded on the pool thread and somehow conflicting? /shrug

electronicboy commented 4 years ago

Two threads loading the class at the same time? Thought that classloaders where supposed to be safe around that, maybe not

On Tue, 14 Apr 2020, 16:35 wizjany, notifications@github.com wrote:

last stacktrace points to 06044e2 https://github.com/PaperMC/Paper/commit/06044e24584c48a6c8380872a250275b06418b6d possibly being an issue. class being loaded on the pool thread and somehow conflicting? /shrug

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/PaperMC/Paper/issues/3137#issuecomment-613514239, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJMAZDVYB5AZ2ZLUWOEHGTRMR7EBANCNFSM4MGYDHQA .

Trigary commented 4 years ago

I could almost reliably reproduce by creating two plugins, one depending on the other one (plugin.yml depends doesn't affect this, but I had it set up correctly). Both plugins have a main class and one of them has some other class that defines a non-static method. Yes, static doesn't work: it doesn't produce the error. Just creating a new instance and not calling any methods doesn't work either. Both plugins do the following in onEnable: ForkJoinPool.commonPool().execute(() -> new SomeClass().doStuff()); This is as basic I could make the reproduction case. Using eg. Executors.newSingleThreadExecutor() instead of the common thread pool also produces the error. I am on OpenJDK 11.

Plugin A:

public class BukkitPlugin extends JavaPlugin {
    @Override
    public void onEnable() {
        ForkJoinPool.commonPool().execute(() -> new SomeClass().doStuff());
    }
}
public class SomeClass {
    public void doStuff() {
        System.out.println("doStuff");
    }
}

Plugin B depends on A:

public class BukkitPluginBeta extends JavaPlugin {
    @Override
    public void onEnable() {
        ForkJoinPool.commonPool().execute(() -> new SomeClass().doStuff());
    }
}

Error:

[00:26:44 INFO]: [BukkitPlugin] Enabling BukkitPlugin v1.0
[00:26:44 INFO]: [BukkitPluginBeta] Enabling BukkitPluginBeta v1.0
[00:26:44 INFO]: doStuff
[00:26:44 WARN]: Exception in thread "ForkJoinPool.commonPool-worker-5" java.lang.LinkageError: loader org.bukkit.plugin.java.PluginClassLoader @5b19f6c5 (instance of org.bukkit.plugin.java.PluginClassLoader, child of 'app' jdk.internal.loader.ClassLoaders$AppClassLoader) attempted duplicate class definition for hu.trigary.bukkitplugin.SomeClass.
[00:26:44 WARN]:        at java.base/java.lang.ClassLoader.defineClass1(Native Method)
[00:26:44 WARN]:        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
[00:26:44 WARN]:        at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
[00:26:44 WARN]:        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:167)
[00:26:44 WARN]:        at org.bukkit.plugin.java.JavaPluginLoader.getClassByName(JavaPluginLoader.java:201)
[00:26:44 WARN]:        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:111)
[00:26:44 WARN]:        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:100)
[00:26:44 WARN]:        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
[00:26:44 WARN]:        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
[00:26:44 WARN]:        at hu.trigary.bukkitplugin.BukkitPlugin.lambda$onEnable$0(BukkitPlugin.java:16)
[00:26:44 WARN]:        at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
[00:26:44 WARN]:        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
[00:26:44 WARN]:        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
[00:26:44 WARN]:        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
[00:26:44 WARN]:        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
[00:26:44 WARN]:        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
[00:26:44 INFO]: Done (11.530s)! For help, type "help"

Might prove useful, wish you good reading: https://docs.oracle.com/javase/specs/jvms/se11/html/jvms-5.html

Since I have specified that one plugin depends on the other one in the plugin.yml, and because this problem exists even if you use the ServerLoadEvent, I would suggest reopening this issue. The problem lies within the server software, the plugins have done everything in their power to specify that they depend on each other. Well, everything apart from doing some sort of synchronization for the async class loading themselves.

Trigary commented 4 years ago

Looking at the source code it's clear that PluginClassLoader and JavaPluginLoader are just simply not thread-safe when it comes to potentially concurrently running class lookups.

A248 commented 4 years ago

Nice work. This issue should be re-opened.

aikar commented 4 years ago

Fixed in Paper 184. This is actually a VERY old bug...

Congratulations to @Callahhh for uncovering such an old bug with such a simple PR no one would of ever thought would of caused such a massive uncovering lol.