Could not load plugin (File cannot be null)

Discussion in 'Plugin Development' started by SteppingHat, Jun 20, 2012.

  1. Offline

    SteppingHat

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Here is the error I am receiving when I load up the plugin I made:
    Code:
    15:38:25 [SEVERE] Could not load 'plugins\tempteleport.jar' in folder 'plugins' org.bukkit.plugin.InvalidPluginException: java.lang.IllegalArgumentException: File cannot be null
    I'm assuming it's saying that one of the files is empty but they are all filled with code.
    TTP.java
    config.yml
    plugin.yml

    I have no idea what to do. I am also hesitant to put my code up here for people to use and copy so if you need it to find the bug, I will PM it to you.

    Thanks in advance!

    ~SteppingHat

    This post has been edited 1 time. It was last edited by SteppingHat Jun 20, 2012.
  2. Offline

    CorrieKay

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    is there anything more to that stacktrace?

    if not, i... think your plugin.yml is null, or doesnt point to the correct main class.
  3. Offline

    Njol

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)

    This post has been edited 1 time. It was last edited by Njol Jun 20, 2012.
  4. Offline

    CorrieKay

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
  5. Offline

    SteppingHat

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    It's got something to do with the config. When I removed anything that required/loaded the config, the plugin loaded fine.

    Code:
    package com.gmail.steppinghat;
     
    import java.util.logging.Logger;
     
    import org.bukkit.ChatColor;
    import org.bukkit.Location;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    import org.bukkit.plugin.PluginDescriptionFile;
    import org.bukkit.plugin.java.JavaPlugin;
     
    public class TempTeleport extends JavaPlugin {
       
        public static TempTeleport plugin;
        public final Logger logger = Logger.getLogger("Minecraft");
        Logger log = Logger.getLogger("Minecraft");
       
        @Override
        public void onDisable() {
            PluginDescriptionFile pdfFile = this.getDescription();
            this.logger.info(pdfFile.getName() + " has been disabled!");
        }
       
        public static int CONF_time;
       
        @Override
        public void onEnable() {
            PluginDescriptionFile pdfFile = this.getDescription();
            log.info("--------TEMPTELEPORT by SteppingHat--------");
            this.logger.info(pdfFile.getName() + " v" + pdfFile.getVersion() + " has been enabled!");
            log.info("-------------------------------------------");
            this.getConfig().options().copyDefaults(true);
            this.saveConfig();
            CONF_time = getConfig().getInt("time");
        }
    
    There's the code.
  6. Offline

    Tempelchat

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    This error happens already at loading. Does java has enough rights to create files/folders in your bukkit directory?

    PS: You should not get the Minecraft-Logger for logging. There is a getLogger() method you could use. I also does the plugin prefixing for you automatically.

    This post has been edited 1 time. It was last edited by Tempelchat Jun 21, 2012.
  7. Offline

    Njol

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)

    This post has been edited 1 time. It was last edited by Njol Jun 21, 2012.
    ferrybig and CorrieKay like this.

Share This Page