Solved Plugin Initialisation Error..

Discussion in 'Spigot Plugin Development' started by digdiggydigger, May 3, 2017.

  1. Hello Spigot,

    So I've had this code for a while and today for some reason its started throwing an error on loading the plugin. I usually get this error if i am running two plugins with the same main class path but i only have this plugin loaded into the server? Whats going on here? I have attached my console error:

    Code (Text):
    [10:30:46 ERROR]: Could not load 'plugins/RepairRunes.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: java.lang.ExceptionInInitializerError
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:135) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:329) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:251) [spigot.jar:git-Spigot-db6de12-18fbb24]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:292) [spigot.jar:git-Spigot-db6de12-18fbb24]
        at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:198) [spigot.jar:git-Spigot-db6de12-18fbb24]
        at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:525) [spigot.jar:git-Spigot-db6de12-18fbb24]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_121]
    Caused by: java.lang.ExceptionInInitializerError
        at java.lang.Class.forName0(Native Method) ~[?:1.8.0_121]
        at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_121]
        at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:64) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
        ... 6 more
    Caused by: java.lang.NullPointerException
        at me.LavaBa11.MainClass.<clinit>(MainClass.java:30) ~[?:?]
        at java.lang.Class.forName0(Native Method) ~[?:1.8.0_121]
        at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_121]
        at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:64) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
        ... 6 more
     
     
  2. Post here line 30 from MainClass
     
    • Like Like x 1
  3. Just in case its needed, I've posted lines 27 - 37
    Code (Text):

        public static FileConfiguration config; // line 27
        File cFile;

        public static String prefix = getConfigFile().getString("prefix");

        public static String basicRune = getConfigFile().getString("basicRune");
        public static String enchantedRune = getConfigFile().getString("enchantedRune");
        public static String legendaryRune = getConfigFile().getString("legendaryRune");
        public static String immortalRune = getConfigFile().getString("immortalRune");
        public static String godRune = getConfigFile().getString("godRune");
        public static String undeadRune = getConfigFile().getString("undeadRune"); // line 37
     
     
  4. Okay I've fixed that error was a minor mistake where i had not removed some code that was inactive and not used so i just removed it and there was so error..