OkaeriPoland / okaeri-configs

Simple Java/POJO config library written with love and Lombok
MIT License
83 stars 11 forks source link

Not compatible with Java 17 #23

Closed plytki closed 2 years ago

plytki commented 2 years ago

Describe the bug Config generator printing null error with Java 17 when launching newest 1.18 minecraft version (paper).

To Reproduce Steps to reproduce the behavior:

  1. Create config with ConfigurationFactory and YamlBukkitConfigurer.
  2. Launch minecraft server.
  3. See error.

Expected behavior It wont create configuration file.

Library version I've tried 3.1.0, 3.4.2 and 4.0.0-beta2.

Config classes and setup routine Add config files source code and setup routine (the part with ConfigManager.create(...)).

dasavick commented 2 years ago

Just tried on the OpenJDK 17. Works like charm. Can you post more details?

printing null error

I'm not sure what this is supposed to mean. If there are any stacktraces, please include them in the issue.

plytki commented 2 years ago

Can you try with the plugin? I have opensource minecraft plugin called VirtualRealty that is printing that error. Can you take a look?

dasavick commented 2 years ago

Please just post the stacktrace here first.

plytki commented 2 years ago

Here https://pastebin.com/TR8GdzyL

dasavick commented 2 years ago

Please read the error messages carefully next time. This does not seem to be okaeri-configs related at all.

Cannot read field "debugMode" because the return value of "me.plytki.virtualrealty.VirtualRealty.getPluginConfiguration()" is null

[01:59:31] [Server thread/ERROR]: Error occurred while enabling VirtualRealty v1.7.0-PREMIUM (Is it up to date?)
java.lang.NullPointerException: Cannot read field "debugMode" because the return value of "me.plytki.virtualrealty.VirtualRealty.getPluginConfiguration()" is null
    at me.plytki.virtualrealty.VirtualRealty.debug(VirtualRealty.java:138) ~[VirtualRealty-Paid-1.7.0-PREMIUM.jar:?]
    at me.plytki.virtualrealty.utils.ConfigurationFactory.createMessagesConfiguration(ConfigurationFactory.java:41) ~[VirtualRealty-Paid-1.7.0-PREMIUM.jar:?]
    at me.plytki.virtualrealty.VirtualRealty.spawnLocales(VirtualRealty.java:147) ~[VirtualRealty-Paid-1.7.0-PREMIUM.jar:?]
    at me.plytki.virtualrealty.VirtualRealty.onEnable(VirtualRealty.java:103) ~[VirtualRealty-Paid-1.7.0-PREMIUM.jar:?]
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.craftbukkit.v1_18_R1.CraftServer.enablePlugin(CraftServer.java:564) ~[paper-1.18.1.jar:git-Paper-101]
    at org.bukkit.craftbukkit.v1_18_R1.CraftServer.enablePlugins(CraftServer.java:478) ~[paper-1.18.1.jar:git-Paper-101]
    at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:727) ~[paper-1.18.1.jar:git-Paper-101]
    at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:503) ~[paper-1.18.1.jar:git-Paper-101]
    at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:313) ~[paper-1.18.1.jar:git-Paper-101]
    at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1202) ~[paper-1.18.1.jar:git-Paper-101]
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:317) ~[paper-1.18.1.jar:git-Paper-101]
    at java.lang.Thread.run(Thread.java:833) ~[?:?]