Development Assistance Help, I don't know what this error means

Discussion in 'Plugin Help/Development/Requests' started by Ramsay, Feb 3, 2015.

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

    Ramsay

    I have started to code a plugin where the player can input a name of a player they are voting for and it sends it to the config file but it comes up with an error. This is my code so far.

    Code:
    package me.ramsay.vote;
    
    import org.bukkit.Bukkit;
    import org.bukkit.command.Command;
    import org.bukkit.entity.Player;
    import org.bukkit.plugin.java.JavaPlugin;
    
    public class Vote extends JavaPlugin {
       
        public void onEnable() {
            Bukkit.getServer().getLogger().info("Vote has been enabled!");
        }
       
        public void onDisable() {
            Bukkit.getServer().getLogger().info("Vote has been enabled!");
        }
    
       
       
        public boolean onCommand(Command sender, Command cmd, String commandLabel, String[] args) {
            Player voter = (Player) sender;
           
           
            if (cmd.getName().equalsIgnoreCase("vote")) {
                voter.sendMessage("Who would you like to vote for? Type '/votefor' to name a player");
                Player target = voter.getServer().getPlayer(args[0]);
            if (cmd.getName().equalsIgnoreCase("votefor") && target != null) {
                getConfig().createSection(target.getName());
            }
               
            }
            return true;
        }
       
       
    }
    

    And this is the error I get with it. It's probably something very obvious that I am missing.

    Code:
    org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
        at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:160) ~[craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:133) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.craftbukkit.v1_8_R1.CraftServer.loadPlugins(CraftServer.java:286) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.craftbukkit.v1_8_R1.CraftServer.reload(CraftServer.java:720) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.Bukkit.reload(Bukkit.java:303) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:23) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:180) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchCommand(CraftServer.java:623) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchServerCommand(CraftServer.java:609) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at net.minecraft.server.v1_8_R1.DedicatedServer.aM(DedicatedServer.java:320) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:285) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:600) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:508) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at java.lang.Thread.run(Thread.java:695) [?:1.6.0_65]
    Caused by: org.yaml.snakeyaml.parser.ParserException: while parsing a block mapping; expected <block end>, but found BlockMappingStart
        at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(ParserImpl.java:575) ~[craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:161) ~[craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:146) ~[craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:230) ~[craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160) ~[craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.yaml.snakeyaml.composer.Composer.composeDocument(Composer.java:123) ~[craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:106) ~[craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:121) ~[craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:480) ~[craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.yaml.snakeyaml.Yaml.load(Yaml.java:411) ~[craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.plugin.PluginDescriptionFile.<init>(PluginDescriptionFile.java:232) ~[craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:155) ~[craftbukkit.jar:git-Bukkit-"24557bc"]
        ... 13 more
    If it's todo with plugin.yml which it might be. Here it is

    Code:
    name: Vote
    
    version: 1.0
    
    main: me.ramsay.vote.Vote
    
    author: Ramsay
    
    description: Vote for an admired player!
    
    
    
    commands:
    
        vote: 
    
            usage: /<command>
    
            description: Starts the vote plugin
    
      votefor:
    
            usage: /<command>
    
            description: Confirm your admired player!
    
     
  2. Offline

    timtower Moderator Moderator

    @Ramsay Remove the blank lines between the nodes to start with.
     
  3. Offline

    Ramsay

    Yep. Then What?
     
  4. Offline

    timtower Moderator Moderator

  5. Offline

    Ramsay

    Fixed 1 error then... Out of the many errors
     
  6. Offline

    timtower Moderator Moderator

    @Ramsay And what are the other errors then?
    And please use the tahg or reply button when responding to somebody, won't see that you have responded otherwise.
     
  7. Offline

    Ramsay

    @timtower this is what i get in the console
    Code:
    [21:14:50 ERROR]: Could not load 'plugins/Inventory.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
        at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:150) ~[craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:133) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.craftbukkit.v1_8_R1.CraftServer.loadPlugins(CraftServer.java:286) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.craftbukkit.v1_8_R1.CraftServer.reload(CraftServer.java:720) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.Bukkit.reload(Bukkit.java:303) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:23) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:180) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchCommand(CraftServer.java:623) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchServerCommand(CraftServer.java:609) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at net.minecraft.server.v1_8_R1.DedicatedServer.aM(DedicatedServer.java:320) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:285) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:600) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:508) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at java.lang.Thread.run(Thread.java:695) [?:1.6.0_65]
    Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
        ... 14 more
     
  8. Offline

    timtower Moderator Moderator

    @Ramsay That is a problem while exporting your plugin, your plugin.yml isn't exporting with it.
     
  9. Offline

    Ramsay

    @timtower Thanks, now I just need to find out how to export my plugin.yml file... Thanks! Also for the main code, there is some deprecation on
    Code:
    Player target = voter.getServer().getPlayer(args[0]);
    Any to solve that?
     
  10. Offline

    timtower Moderator Moderator

    @Ramsay Safe to ignore, from what I know:
    Deprecated to get attention to the UUID change, some times you need to use that one though.
     
  11. Offline

    Ramsay

    @timtower Still getting this error
    Code:
    [21:59:48 ERROR]: Could not load 'plugins/Inventory.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
        at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:150) ~[craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:133) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.craftbukkit.v1_8_R1.CraftServer.loadPlugins(CraftServer.java:286) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.craftbukkit.v1_8_R1.CraftServer.reload(CraftServer.java:720) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.Bukkit.reload(Bukkit.java:303) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:23) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:180) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchCommand(CraftServer.java:623) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchServerCommand(CraftServer.java:609) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at net.minecraft.server.v1_8_R1.DedicatedServer.aM(DedicatedServer.java:320) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:285) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:600) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:508) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at java.lang.Thread.run(Thread.java:695) [?:1.6.0_65]
    Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
        ... 14 more
    
     
  12. Offline

    timtower Moderator Moderator

    @Ramsay Export issue again, could you open the jar with winzip or similar and check if there is a plugin.yml present?
     
  13. Offline

    Ramsay

    @timtower On mac, should be able to though... Hang on.
     
  14. Offline

    timtower Moderator Moderator

    @Ramsay Gonna sleep now though, will help again when I am active again.
     
  15. Offline

    Ramsay

    @timtower There was a plugin.yml in the jar file. Going to try and see if it works now. Thanks for the help
     
  16. Offline

    Qaisar101

    @Ramsay - Tada! Tell me if it works!
    Code:
    name: Vote
    version: 1.0
    main: me.ramsay.vote.Vote
    author: Ramsay
    description: Vote for an admired player!
    commands:
        vote:
        usage: /<command>
        description: Starts the vote plugin
        votefor:
        usage: /<command>
        description: Confirm your admired player!
     
  17. Offline

    Ramsay

    @Qaisar101 Sorry, I went to sleep. Here is the error code I get with that.

    Code:
    [16:46:12 ERROR]: Could not load 'plugins/VoteFor.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidDescriptionException: commands are of wrong type
        at org.bukkit.plugin.PluginDescriptionFile.loadMap(PluginDescriptionFile.java:941) ~[craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.plugin.PluginDescriptionFile.<init>(PluginDescriptionFile.java:232) ~[craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:155) ~[craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:133) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.craftbukkit.v1_8_R1.CraftServer.loadPlugins(CraftServer.java:286) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.craftbukkit.v1_8_R1.CraftServer.reload(CraftServer.java:720) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.Bukkit.reload(Bukkit.java:303) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:23) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:180) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchCommand(CraftServer.java:623) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchServerCommand(CraftServer.java:609) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at net.minecraft.server.v1_8_R1.DedicatedServer.aM(DedicatedServer.java:320) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:285) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:600) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:508) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at java.lang.Thread.run(Thread.java:695) [?:1.6.0_65]
    Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map
        at org.bukkit.plugin.PluginDescriptionFile.loadMap(PluginDescriptionFile.java:923) ~[craftbukkit.jar:git-Bukkit-"24557bc"]
        ... 15 more
    
    @timtower Any idea of the error?

    <Edited by bwfcwalshy: Merged posts, please use the edit button rather than double posting.>
     
    Last edited by a moderator: Feb 4, 2015
  18. Offline

    Qaisar101

    @Ramsay Well now it's not the plugin.yml's fault. It's your code. In Eclipse, does it give you any errors?
     
  19. Offline

    Ramsay

    @Qaisar101 Just deprecation on Player target = voter.getServer().getPlayer(args[0]);
     
    Last edited: Feb 4, 2015
  20. Offline

    timtower Moderator Moderator

    Code:
    name: Vote
    version: 1.0
    main: me.ramsay.vote.Vote
    author: Ramsay
    description: Vote for an admired player!
    commands:
      vote:
        usage: /<command>
        description: Starts the vote plugin
      votefor:
        usage: /<command>
        description: Confirm your admired player!
    @Ramsay That is one that can be ignored.
     
  21. Offline

    Ramsay

    @timtower Okay, the only thing that doesn't look "normal" is the deprecated. The rest is "error free"
     
  22. Offline

    timtower Moderator Moderator

    @Ramsay Hover your mouse over it, hit the quick fix button. Should suppress the warning.
     
  23. Offline

    Ramsay

    @timtower On way to school atm, will do it later. Will that fix it?
     
  24. Offline

    timtower Moderator Moderator

    @Ramsay It is a warning, not an error, nothing really broken.
     
  25. Offline

    Qaisar101

  26. Offline

    timtower Moderator Moderator

  27. Offline

    Qaisar101

    @timtower TimTower, I love you so much. I made a thread about this, bumped it a billion times, and no one replies to it. Is it okay if I tag you in random posts? xD! Thanks for the help man!
     
  28. Offline

    timtower Moderator Moderator

    @Qaisar101 Only if you actually have a question in them.
     
  29. Offline

    Ramsay

    @timtower I "suppressed the target" and I still get this error

    Code:
    Could not load 'plugins/VoteFor.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidDescriptionException: commands are of wrong type
        at org.bukkit.plugin.PluginDescriptionFile.loadMap(PluginDescriptionFile.java:941) ~[craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.plugin.PluginDescriptionFile.<init>(PluginDescriptionFile.java:232) ~[craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:155) ~[craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:133) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.craftbukkit.v1_8_R1.CraftServer.loadPlugins(CraftServer.java:286) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at org.bukkit.craftbukkit.v1_8_R1.CraftServer.<init>(CraftServer.java:248) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at net.minecraft.server.v1_8_R1.PlayerList.<init>(PlayerList.java:68) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at net.minecraft.server.v1_8_R1.DedicatedPlayerList.<init>(SourceFile:14) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at net.minecraft.server.v1_8_R1.DedicatedServer.init(DedicatedServer.java:133) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:475) [craftbukkit.jar:git-Bukkit-"24557bc"]
        at java.lang.Thread.run(Thread.java:695) [?:1.6.0_65]
    Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map
        at org.bukkit.plugin.PluginDescriptionFile.loadMap(PluginDescriptionFile.java:923) ~[craftbukkit.jar:git-Bukkit-"24557bc"]
        ... 10 more
    
     
  30. Offline

    timtower Moderator Moderator

    @Ramsay Because that isn't related to the suppressing.
    How does your plugin.yml look like?
     
Thread Status:
Not open for further replies.

Share This Page