Solved *** What means this error ***

Discussion in 'Plugin Development' started by NLGamingBross, Aug 16, 2013.

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

    NLGamingBross

    Code:
    10:06:49 [SEVERE] Could not load 'plugins\Test.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: java.lang.IllegalArgumentException: Fi
    le cannot be null
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:182)
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.
    java:305)
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
    .java:230)
            at org.bukkit.craftbukkit.v1_6_R2.CraftServer.loadPlugins(CraftServer.ja
    va:239)
            at org.bukkit.craftbukkit.v1_6_R2.CraftServer.<init>(CraftServer.java:21
    7)
            at net.minecraft.server.v1_6_R2.PlayerList.<init>(PlayerList.java:56)
            at net.minecraft.server.v1_6_R2.DedicatedPlayerList.<init>(SourceFile:11
    )
            at net.minecraft.server.v1_6_R2.DedicatedServer.init(DedicatedServer.jav
    a:106)
            at net.minecraft.server.v1_6_R2.MinecraftServer.run(MinecraftServer.java
    :391)
            at net.minecraft.server.v1_6_R2.ThreadServerApplication.run(SourceFile:5
    82)
    Caused by: java.lang.IllegalArgumentException: File cannot be null
            at org.apache.commons.lang.Validate.notNull(Validate.java:203)
            at org.bukkit.configuration.file.YamlConfiguration.loadConfiguration(Yam
    lConfiguration.java:170)
            at org.bukkit.plugin.java.JavaPlugin.reloadConfig(JavaPlugin.java:117)
            at org.bukkit.plugin.java.JavaPlugin.getConfig(JavaPlugin.java:111)
            at me.test.MainClass.<init>(MainClass.java:38)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
     
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
     
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
    rce)
            at java.lang.reflect.Constructor.newInstance(Unknown Source)
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:178)
            ... 9 more

    How to fix this *! Please help me!
     
  2. Offline

    Steffion

    Have you made a plugin.yml file in your project?
     
  3. Offline

    Chinwe

    Are you using getConfig() or reloadConfig() when config.yml does not exist?
     
  4. Offline

    NLGamingBross


    Yeah, So stupid iam not! :p


    I dont created an Config.Yml in the project! i make one an tri it again

    Error:

    Code:
    14:44:12 [SEVERE] Could not load 'plugins\OMGeco.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: java.lang.IllegalArgumentException: Fi
    le cannot be null
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:182)
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.
    java:305)
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
    .java:230)
            at org.bukkit.craftbukkit.v1_6_R2.CraftServer.loadPlugins(CraftServer.ja
    va:239)
            at org.bukkit.craftbukkit.v1_6_R2.CraftServer.<init>(CraftServer.java:21
    7)
            at net.minecraft.server.v1_6_R2.PlayerList.<init>(PlayerList.java:56)
            at net.minecraft.server.v1_6_R2.DedicatedPlayerList.<init>(SourceFile:11
    )
            at net.minecraft.server.v1_6_R2.DedicatedServer.init(DedicatedServer.jav
    a:106)
            at net.minecraft.server.v1_6_R2.MinecraftServer.run(MinecraftServer.java
    :391)
            at net.minecraft.server.v1_6_R2.ThreadServerApplication.run(SourceFile:5
    82)
    Caused by: java.lang.IllegalArgumentException: File cannot be null
            at org.apache.commons.lang.Validate.notNull(Validate.java:203)
            at org.bukkit.configuration.file.YamlConfiguration.loadConfiguration(Yam
    lConfiguration.java:170)
            at org.bukkit.plugin.java.JavaPlugin.reloadConfig(JavaPlugin.java:117)
            at org.bukkit.plugin.java.JavaPlugin.getConfig(JavaPlugin.java:111)
            at me.nlgamingbross.OMGeco.MainClass.<init>(MainClass.java:41)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
     
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
     
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
    rce)
            at java.lang.reflect.Constructor.newInstance(Unknown Source)
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:178)
            ... 9 more
    Plugin.Yml:

    Code:
    name: OMGeco
    main: me.nlgamingbross.OMGeco.MainClass
    author: NLGamingBross
    description: Eco plugin for OMG
    version: 1.0
    commands:
        meco:
        description: main command.
        usage: |
                Usage:
                /<command> - Display help
    Config.Yml:

    Code:
    MSGjoinback: true


    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 3, 2016
  5. Offline

    Tirelessly

    But what's the code..
     
  6. Offline

    NLGamingBross

    Why code i think there is other fail not the code because the " org.bukkit.plugin.InvalidPluginException: java.lang.IllegalArgumentException: File cannot be null"
    Let's see the code...... it is:

    Code:
    /**
    *
    */
    package me.nlgamingbross.OMGeco;
     
    import java.util.HashMap;
     
    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.EventPriority;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.PlayerJoinEvent;
    import org.bukkit.plugin.java.JavaPlugin;
     
    /**
    * ----------------------------- *
    * @Author Joey || NLGamingBross
    * ----------------------------- *
    */
     
    public class MainClass extends JavaPlugin implements Listener {
            /*=============== HashMaps ===============*/
           
            public HashMap<Player, Integer> Silver = new HashMap<Player, Integer>();
            public HashMap<Player, Integer> Gold = new HashMap<Player, Integer>();
            public HashMap<Player, Boolean> FJoin = new HashMap<Player, Boolean>();
           
           
            /*=============== Strings ===============*/
           
            public String Prefix = ChatColor.DARK_GRAY + "[" + ChatColor.AQUA + " OpenMindGame " + ChatColor.DARK_GRAY + "]";
            public String PSilver = ChatColor.DARK_GRAY + "[" + ChatColor.GRAY + " Silver " + ChatColor.DARK_GRAY + "]";
            public String PGold = ChatColor.DARK_GRAY + "[" + ChatColor.YELLOW + " Gold " + ChatColor.DARK_GRAY + "]";
           
            /*=============== Boolean ===============*/
           
            public Boolean MSGback = getConfig().getBoolean("MSGjoinback");
     
            /*=============== Code ===============*/
           
            @Override
            public void onEnable() {
                Bukkit.getPluginManager().registerEvents(this,this);
                getConfig().options().copyDefaults(true);
                saveConfig();
            }
           
            @Override
            public void onDisable() {
            saveConfig();
            }
           
            @EventHandler(priority = EventPriority.NORMAL)
            public void OnPlayerJoin(PlayerJoinEvent e){
                Player p = e.getPlayer();
                if(FJoin.get(e.getPlayer().getName())){
                    p.sendMessage(this.Prefix + ChatColor.GOLD + e.getPlayer().getName() + "'s" + ChatColor.DARK_PURPLE + "Economy account is succesfully registerd" );
                    FJoin.put(e.getPlayer(), false);
                }
                if(!FJoin.get(e.getPlayer().getName())){
                    if(MSGback == true){
                    p.sendMessage(this.Prefix + ChatColor.GOLD + e.getPlayer().getName() + ChatColor.DARK_PURPLE + "Welcome Back," );
                    }else{
                        return;
                    }
                }
            }
            public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
                if(cmd.getName().equalsIgnoreCase("meco")){
                          if(args.length == 0 || args.length == 1 || args.length == 2){
                       
                          if(args.length == 0){
                              sender.sendMessage("");
                              sender.sendMessage("");
                              sender.sendMessage(ChatColor.RED + "/meco add <type> <player> <points>" + ChatColor.DARK_GRAY + " - " + ChatColor.GREEN + "Add type of points to player");
                              sender.sendMessage(ChatColor.RED + "/meco remove <type> <player> <points>" + ChatColor.DARK_GRAY + " - " + ChatColor.GREEN + "Remove type of points from player");
                              sender.sendMessage("");
                              sender.sendMessage("");
                          }else if(args.length == 1){
                                if(args[0].equalsIgnoreCase("add")){
                                      sender.sendMessage(this.Prefix + ChatColor.DARK_RED + ChatColor.BOLD + "Error: " + ChatColor.RED + "Please specify: Gold/Silver-Player-Points.");
                                }
                          }else if(args.length == 2){
                              if(args[1].equalsIgnoreCase("Silver")){
                                  sender.sendMessage(ChatColor.GRAY + "SilverTest");
                                  //End Goal.. /meco add Silver <player> <points>
                              }
                              else if(args[1].equalsIgnoreCase("Gold")){
                                  sender.sendMessage(ChatColor.GOLD + "Gold test");
                                  //End Goal.. /meco add Gold <player> <points>
                              }
                          }
                      }
                }
                return true;
            }
           
    }
     
     
    



    Maybe the comands?!? I fail with command and args.....
     
  7. Offline

    NLGamingBross


    Yup,[​IMG]
     
  8. Offline

    NLGamingBross

    READ THE ERROR MAN! ANd check what u said!

    You: Did you add the config.yml to your jar?

    Error: 14:44:12 [SEVERE] Could not load 'plugins\OMGeco.jar' in folder 'plugins'
     
  9. NLGamingBross Read the comment, then read it again, and then...Read it one more time. Tell me when you're cooled down.
     
  10. Offline

    NLGamingBross

    You: Did you add the config.yml to your jar?`

    I said YUP! It means YES! and imnot stupid. That is basic for checking it etcccc... But i need a fix i know i need to check if all is good but no error in the code and all files are right! Why the console gives a error!!!

    [​IMG]
     
  11. Offline

    Lolmewn

    In the first screenshot it kinda looks like you've added the files to a package instead of the root folder of your project.
    Also, please no caps. You're making people sad by using those :(
     
  12. NLGamingBross Hey why so rude mate? Anyways, I asked if you Exported it in the jar. Because sometimes eclipse just doesn't export it within the jar. Try using "this.saveDefaultConfig()" instead of "getConfig().options().copyDefaults(true);
     
  13. Offline

    Aqua

    Whats your skype? I will help you there. (Zodat we Nederlands verder kunnen aangezien je Engels niet helemaal optimaal is, (trans: So I can help you in Dutch since your English is not that good.)
     
  14. Offline

    NLGamingBross

    I dont use skype every day. You can contact me on my TeamSpeak3 Server(Search "iNoLife - Joey" on teamspeak or Poke me with right click)

    TeamSpeak3 IP: 217.23.12.139:9989
    Skype: Crackbyhack
     
  15. Offline

    NoChanceSD

    Maybe try renaming "MainClass" to your plugin name "OMGeco"
     
  16. Offline

    NLGamingBross


    Nope, These diffrent i have by more plugins! That name haven't any effect

    By checking my code good for the 10ste time i see the fault! it's a fault i maked by a other plugin!
    This the wrong line
    Code:java
    1. public Boolean MSGback = getConfig().getBoolean("MSGjoinback");


    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 3, 2016
  17. Offline

    Tirelessly

    I just got back and saw that immediately..
     
  18. Offline

    NLGamingBross

    Yeah yeah! Great Boy ;)
     
  19. Offline

    Tirelessly

    Lol sorry didn't mean to come off like that.
     
Thread Status:
Not open for further replies.

Share This Page