Solved Yaml deserialization exception

Discussion in 'Spigot Plugin Development' started by Cerus, Jan 3, 2019.

  1. Hello guys,
    I'm getting an IllegalArgumentException while trying to load my file. It says that the specified class doesnt exist although its in the jar. Is there some way to fix that?

    Code (Text):
    [ERROR] Cannot load plugins/Dungeons/DungeonData.yml

    org.bukkit.configuration.InvalidConfigurationException: org.yaml.snakeyaml.error.YAMLException: Could not deserialize object

    at org.bukkit.configuration.file.YamlConfiguration.loadFromString(YamlConfiguration.java:55) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:162) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:130) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.bukkit.configuration.file.YamlConfiguration.loadConfiguration(YamlConfiguration.java:178) [spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at de.cerus.ceruslib.config.CustomConfig.reload(CustomConfig.java:72) [Dungeons.jar:?]

    at de.cerus.ceruslib.config.CustomConfig.get(CustomConfig.java:102) [Dungeons.jar:?]

    at de.cerus.ceruslib.config.CustomConfig.<init>(CustomConfig.java:49) [Dungeons.jar:?]

    at de.cerus.horstblocks.dungeons.Dungeons.onPluginEnable(Dungeons.java:42) [Dungeons.jar:?]

    at de.cerus.ceruslib.CerusPlugin.onEnable(CerusPlugin.java:44) [Dungeons.jar:?]

    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) [spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:337) [spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:403) [spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugin(CraftServer.java:381) [spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugins(CraftServer.java:330) [spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at net.minecraft.server.v1_12_R1.MinecraftServer.t(MinecraftServer.java:422) [spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at net.minecraft.server.v1_12_R1.MinecraftServer.l(MinecraftServer.java:383) [spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at net.minecraft.server.v1_12_R1.MinecraftServer.a(MinecraftServer.java:338) [spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at net.minecraft.server.v1_12_R1.DedicatedServer.init(DedicatedServer.java:272) [spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:545) [spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_172]

    Caused by: org.yaml.snakeyaml.error.YAMLException: Could not deserialize object

    at org.bukkit.configuration.file.YamlConstructor$ConstructCustomObject.construct(YamlConstructor.java:37) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:207) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:196) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping2ndStep(BaseConstructor.java:462) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.yaml.snakeyaml.constructor.SafeConstructor.constructMapping2ndStep(SafeConstructor.java:183) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping(BaseConstructor.java:443) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.yaml.snakeyaml.constructor.SafeConstructor$ConstructYamlMap.construct(SafeConstructor.java:519) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.bukkit.configuration.file.YamlConstructor$ConstructCustomObject.construct(YamlConstructor.java:26) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:207) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:196) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping2ndStep(BaseConstructor.java:462) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.yaml.snakeyaml.constructor.SafeConstructor.constructMapping2ndStep(SafeConstructor.java:183) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping(BaseConstructor.java:443) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.yaml.snakeyaml.constructor.SafeConstructor$ConstructYamlMap.construct(SafeConstructor.java:519) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.bukkit.configuration.file.YamlConstructor$ConstructCustomObject.construct(YamlConstructor.java:26) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:207) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:196) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.yaml.snakeyaml.constructor.BaseConstructor.constructDocument(BaseConstructor.java:161) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:147) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:524) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.yaml.snakeyaml.Yaml.load(Yaml.java:437) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.bukkit.configuration.file.YamlConfiguration.loadFromString(YamlConfiguration.java:53) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    ... 19 more

    Caused by: java.lang.IllegalArgumentException: Specified class does not exist ('de.cerus.horstblocks.dungeons.objects.Cuboid')

    at org.bukkit.configuration.serialization.ConfigurationSerialization.deserializeObject(ConfigurationSerialization.java:187) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.bukkit.configuration.file.YamlConstructor$ConstructCustomObject.construct(YamlConstructor.java:35) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:207) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:196) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping2ndStep(BaseConstructor.java:462) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.yaml.snakeyaml.constructor.SafeConstructor.constructMapping2ndStep(SafeConstructor.java:183) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping(BaseConstructor.java:443) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.yaml.snakeyaml.constructor.SafeConstructor$ConstructYamlMap.construct(SafeConstructor.java:519) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.bukkit.configuration.file.YamlConstructor$ConstructCustomObject.construct(YamlConstructor.java:26) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:207) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:196) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping2ndStep(BaseConstructor.java:462) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.yaml.snakeyaml.constructor.SafeConstructor.constructMapping2ndStep(SafeConstructor.java:183) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping(BaseConstructor.java:443) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.yaml.snakeyaml.constructor.SafeConstructor$ConstructYamlMap.construct(SafeConstructor.java:519) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.bukkit.configuration.file.YamlConstructor$ConstructCustomObject.construct(YamlConstructor.java:26) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:207) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:196) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.yaml.snakeyaml.constructor.BaseConstructor.constructDocument(BaseConstructor.java:161) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:147) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:524) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.yaml.snakeyaml.Yaml.load(Yaml.java:437) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    at org.bukkit.configuration.file.YamlConfiguration.loadFromString(YamlConfiguration.java:53) ~[spigot-1.12.2.jar:git-Spigot-eb3d921-2b93d83]

    ... 19 more
    Im just loading a file, nothing more
    Code (YAML):
    end-dungeon:
      portal
    :
        ==
    : de.cerus.horstblocks.dungeons.objects.Cuboid
        worldName
    : Plotztztz
        z1
    : 64
        y1
    : 65
        z2
    : 64
        x1
    : -164
        y2
    : 70
        x2
    : -161
     
    Thanks!
     
    #1 Cerus, Jan 3, 2019
    Last edited: Jan 3, 2019
  2. Alright, solved. I needed to register my class which implemented ConfigurationSerializable with ConfigurationSerialization.registerClass(Cuboid.class)