PaperMC / Paper

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

Error downloading dependencies in runtime from API #8868

Closed 4drian3d closed 1 year ago

4drian3d commented 1 year ago

Expected behavior

Ideally, the dependencies should be loaded without errors when the plugin is initialized

Observed/Actual behavior

When migrating from the Spigot dependency downloader in the plugin.yml file to the newly added Paper dependency download API with the same dependency to download and the same repository used, a ClassCastException error is raised when starting the plugin

Paper API:

Spigot plugin.yml

Steps/models to reproduce

Migrate from the Spigot dependency download system declared in the plugin.yml file to the new Paper API, changes made: https://github.com/4drian3d/SimpleJumpPads/commit/de2fd051b9892b4ee9116dc8e07f16b03f45060a

Plugin and Datapack List

[20:24:35 INFO]: Server Plugins (1): [20:24:35 INFO]: Paper Plugins: [20:24:35 INFO]: - SimpleJumpPads [20:24:35 INFO]: Bukkit Plugins:

Paper version

version [20:25:12 INFO]: Checking version, please wait... [20:25:13 INFO]: This server is running Paper version git-Paper-406 (MC: 1.19.3) (Implementing API version 1.19.3-R0.1-SNAPSHOT) (Git: 7baf427) You are running the latest version Previous version: git-Pufferfish-57 (MC: 1.19.3)

Other

No response

electronicboy commented 1 year ago

This appears to be due to the fact that paper itself also bundles configurate; Would need to diagnose the classloading behavior here somewhat as I'm placing bets that one of those classes is a classloader from paper (Also, why the fuck does java not have a sane way to set the classloader info in those messages...)

emilyy-dev commented 1 year ago

The additional AutoValue_ prefix is intriguing, because Paper bundles the same Configurate version the plugin is downloading. The plugin's class loader first delegates the lookup to the parent class loader so by using the same version, the -core classes used being loaded by the server's class loader isn't really a concern as they all would be the same. I am not able to replicate the issue which makes it even more intriguing (where is that prefix coming from?)

electronicboy commented 1 year ago

fwiw, I couldn't reproduce inside of runDev, only inside of an actual real server jar

emilyy-dev commented 1 year ago

touché