Solved config.yml Bug

Discussion in 'Plugin Development' started by boomboompower, Aug 22, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    boomboompower

    Whenever I load the plugin I always get this warning

    Code:
    Cannot load configuration from jar
    org.bukkit.configuration.InvalidConfigurationException: Top level is not a Map.
        at org.bukkit.configuration.file.YamlConfiguration.loadFromString(YamlConfiguration.java:59) ~[spigot-1.8.7.jar:git-Spigot-f928e7a-e91aed8]
        at org.bukkit.plugin.java.JavaPlugin.reloadConfig(JavaPlugin.java:214) [spigot-1.8.7.jar:git-Spigot-f928e7a-e91aed8]
        at org.bukkit.plugin.java.JavaPlugin.getConfig(JavaPlugin.java:162) [spigot-1.8.7.jar:git-Spigot-f928e7a-e91aed8]
        at me.boomboompowermc.Alert.onEnable(Alert.java:31) [Alert%20(BKCAU).jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) [spigot-1.8.7.jar:git-Spigot-f928e7a-e91aed8]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:340) [spigot-1.8.7.jar:git-Spigot-f928e7a-e91aed8]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) [spigot-1.8.7.jar:git-Spigot-f928e7a-e91aed8]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:356) [spigot-1.8.7.jar:git-Spigot-f928e7a-e91aed8]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:316) [spigot-1.8.7.jar:git-Spigot-f928e7a-e91aed8]
        at net.minecraft.server.v1_8_R3.MinecraftServer.s(MinecraftServer.java:418) [spigot-1.8.7.jar:git-Spigot-f928e7a-e91aed8]
        at net.minecraft.server.v1_8_R3.MinecraftServer.k(MinecraftServer.java:382) [spigot-1.8.7.jar:git-Spigot-f928e7a-e91aed8]
        at net.minecraft.server.v1_8_R3.MinecraftServer.a(MinecraftServer.java:337) [spigot-1.8.7.jar:git-Spigot-f928e7a-e91aed8]
        at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:256) [spigot-1.8.7.jar:git-Spigot-f928e7a-e91aed8]
        at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:528) [spigot-1.8.7.jar:git-Spigot-f928e7a-e91aed8]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_51]
     
    Last edited by a moderator: Aug 22, 2015
  2. Online

    timtower Administrator Administrator Moderator

    au2001 likes this.
  3. Offline

    SuperSniper

    e.boomboompowermc.Alert.onEnable(Alert.java:31)
    Show us line 31 of your Alert class
     
  4. Offline

    boomboompower

    Line 31:
    Code:
    this.AutoUpdater = this.getConfig().getBoolean("AutoUpdater");
    @timtower the config:
    Code:
    
    #----------------------------------------------#
    # Welcome & thanks for using SimpleChatAlert!  #
    # This is the default config file so feel free #
    # To edit any of the values to your advantage  #
    #                                              #
    # Once again thanks! :D -boomboompower [Dev]   #
    #----------------------------------------------#
    
    
    # This is so you can turn the plugin automatically
    # Updating off. (Switch to "true" for updates!)
    AutoUpdater: false
    
    
    #----------------------------------------------#
    #    Thats the end of the S.C.A config file!   #
    #       Report any bugs/errors you find!       #
    #----------------------------------------------#
     
    Last edited: Aug 23, 2015
  5. Offline

    au2001

  6. Offline

    boomboompower

    @au2001 Its in the post above, I updated it.
     
  7. Offline

    au2001

    @boomboompower There must be a problem with your comments somewhere...
    Try writing just "AutoUpdater: false" in the config, without anything else.
     
  8. Offline

    boomboompower

    @au2001 That worked, how can I make it so it has comments but does not error?
     
  9. Offline

    au2001

    @boomboompower Try writing simple comments (no empty line or fancy dashes), test, add a few, test, add more...
     
  10. Offline

    boomboompower

    Ok, thanks for the help, I have added you a role of contributor to my plugin :)
     
  11. Offline

    au2001

    @boomboompower Thanks ^^ Even if I don't think I really helped you that much :p

    Don't forget to mark this as filled though ;)
     
  12. Online

    timtower Administrator Administrator Moderator

    @boomboompower Configs don't like comments unless you use your own class to transfer them.
    The only comment that Bukkit allows is a header comment at the top of the file.
     
  13. Offline

    boomboompower

    Okay, thx for the info can you please lock this thread?
     
  14. Online

    timtower Administrator Administrator Moderator

    We don't lock when a thread is just solved.
     
  15. Offline

    boomboompower

    Oh, im used to other kinds of forums. xD
     
Thread Status:
Not open for further replies.

Share This Page