[SPIGOT-7638] Library loader does not seem to resolve jackson annotations Created: 25/Apr/24 Updated: 25/Dec/24 Resolved: 26/Apr/24 |
|
Status: | Resolved |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | Priority: | Minor |
Reporter: | Yahia Mohamed | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Labels: | None | ||
Environment: |
Server is 1.20.5 running on pterodactyl panel (locally) on linux. |
Issue Links: |
|
||||||||
Version: | CraftBukkit version 4123-Spigot-b698b49-90f1059 (MC: 1.20.5) (Implementing API version 1.20.5-R0.1-SNAPSHOT) | ||||||||
Guidelines Read: | Yes |
Description |
Alright so, I have a plugin with the following libraries in plugin.yml
libraries: - org.flywaydb:flyway-core:10.11.1 NOTE: I removed libraries that i believe have nothing to do with this bug.
If you try to use flywaydb, You will get an error like this:
java.lang.NoClassDefFoundError: com/fasterxml/jackson/annotation/JsonView at com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector.<clinit>(JacksonAnnotationIntrospector.java:37) ~[?:?] at com.fasterxml.jackson.databind.ObjectMapper.<clinit>(ObjectMapper.java:375) ~[?:?] at org.flywaydb.core.extensibility.ConfigurationExtension.copy(ConfigurationExtension.java:40) ~[?:?] at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[?:?] at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1708) ~[?:?] at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?] at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?] at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575) ~[?:?] at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260) ~[?:?] at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616) ~[?:?] at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622) ~[?:?] at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627) ~[?:?] at org.flywaydb.core.internal.plugin.PluginRegister.getCopy(PluginRegister.java:100) ~[?:?] at org.flywaydb.core.api.configuration.ClassicConfiguration.configure(ClassicConfiguration.java:1348) ~[?:?] at org.flywaydb.core.api.configuration.ClassicConfiguration.<init>(ClassicConfiguration.java:261) ~[?:?] at org.flywaydb.core.Flyway.<init>(Flyway.java:116) ~[?:?] at org.flywaydb.core.api.configuration.FluentConfiguration.load(FluentConfiguration.java:65) ~[?:?] This error comes from the jackson annotations module. It looks like the server did not download or load it while resolving libraries on startup. However, doing this on a 1.20.4 server the plugin runs fine. Adding "com.fasterxml.jackson.core:jackson-annotations:2.15.2" to plugin.yml fixes the issue as the library is downloaded and loaded. You aren't supposed to do that and it should be loaded normally as it is a transitive dependency.
This bug was not really tested much. Feel free to correct me if i misunderstand something. People from the discord server have directed me to create a bug report here. |
Comments |
Comment by Yahia Mohamed [ 26/Apr/24 ] |
Yes, looks like it does fix the issue. |
Comment by Marvin Rieple [ 26/Apr/24 ] |
Made a PR for this: bukkit#1001 You can test it with BuildTools: java -jar BuildTools.jar --rev 4126 --compile spigot --pr bukkit:1001 |
Comment by Yahia Mohamed [ 26/Apr/24 ] |
Looks like so. I tried to find what has changed since 1.16.5 that would cause this and failed. I also tried looking in paper for patches related to this problem and found none. Maybe this bug is triggered by another bug? |
Comment by md_5 [ 26/Apr/24 ] |
I think this is |
Comment by Yahia Mohamed [ 25/Apr/24 ] |
After further testing, it appears that this behavior does not appear on 1.16.5 spigot. 1.20.4 paper also does not have this issue. |
Comment by md_5 [ 25/Apr/24 ] |
I do not see any com.fasterxml.jackson.core:jackson-annotations on 1.20.4 either |
Comment by md_5 [ 25/Apr/24 ] |
I don't think anything related to library loading changed in 1.20.5 |