Config Error

Discussion in 'Spigot Plugin Development' started by Jumbo_1907, May 11, 2017.

  1. Hey,

    I have an error on this line:

    Code (Text):
        public static List<String> configList = Main.plugin.getConfig().getStringList("data");
     
    this is my error:
    [18:39:54] [Server thread/ERROR]: Could not load 'plugins\Gmc-Quest.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: java.lang.ExceptionInInitializerError
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:135) ~[spigot-1.8.7.jar:git-Spigot-d2856ae-8f0f4ed]
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:329) ~[spigot-1.8.7.jar:git-Spigot-d2856ae-8f0f4ed]
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:251) [spigot-1.8.7.jar:git-Spigot-d2856ae-8f0f4ed]
    at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:291) [spigot-1.8.7.jar:git-Spigot-d2856ae-8f0f4ed]
    at org.bukkit.craftbukkit.v1_8_R3.CraftServer.reload(CraftServer.java:740) [spigot-1.8.7.jar:git-Spigot-d2856ae-8f0f4ed]
    at org.bukkit.Bukkit.reload(Bukkit.java:534) [spigot-1.8.7.jar:git-Spigot-d2856ae-8f0f4ed]
    at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:25) [spigot-1.8.7.jar:git-Spigot-d2856ae-8f0f4ed]
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) [spigot-1.8.7.jar:git-Spigot-d2856ae-8f0f4ed]
    at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:642) [spigot-1.8.7.jar:git-Spigot-d2856ae-8f0f4ed]
    at net.minecraft.server.v1_8_R3.PlayerConnection.handleCommand(PlayerConnection.java:1135) [spigot-1.8.7.jar:git-Spigot-d2856ae-8f0f4ed]
    at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:970) [spigot-1.8.7.jar:git-Spigot-d2856ae-8f0f4ed]
    at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:45) [spigot-1.8.7.jar:git-Spigot-d2856ae-8f0f4ed]
    at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:1) [spigot-1.8.7.jar:git-Spigot-d2856ae-8f0f4ed]
    at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [spigot-1.8.7.jar:git-Spigot-d2856ae-8f0f4ed]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_101]
    at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_101]
    at net.minecraft.server.v1_8_R3.SystemUtils.a(SystemUtils.java:19) [spigot-1.8.7.jar:git-Spigot-d2856ae-8f0f4ed]
    at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:718) [spigot-1.8.7.jar:git-Spigot-d2856ae-8f0f4ed]
    at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:367) [spigot-1.8.7.jar:git-Spigot-d2856ae-8f0f4ed]
    at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:657) [spigot-1.8.7.jar:git-Spigot-d2856ae-8f0f4ed]
    at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:560) [spigot-1.8.7.jar:git-Spigot-d2856ae-8f0f4ed]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_101]
    Caused by: java.lang.ExceptionInInitializerError
    at java.lang.Class.forName0(Native Method) ~[?:1.8.0_101]
    at java.lang.Class.forName(Unknown Source) ~[?:1.8.0_101]
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:64) ~[spigot-1.8.7.jar:git-Spigot-d2856ae-8f0f4ed]
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) ~[spigot-1.8.7.jar:git-Spigot-d2856ae-8f0f4ed]
    ... 21 more
    Caused by: java.lang.NullPointerException
    at me.jumbo1907.gravitymc.quest.main.Main.<clinit>(Main.java:25) ~[?:?]
    at java.lang.Class.forName0(Native Method) ~[?:1.8.0_101]
    at java.lang.Class.forName(Unknown Source) ~[?:1.8.0_101]
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:64) ~[spigot-1.8.7.jar:git-Spigot-d2856ae-8f0f4ed]
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) ~[spigot-1.8.7.jar:git-Spigot-d2856ae-8f0f4ed]
    ... 21 more
    [18:39:54] [Server thread/INFO]: [Vault] Loading Vault v1.5.6-b49
     
  2. EDIT: my config file looks like this:

    data: []
     
  3. Well that's an NPE so its because data is null.
     
  4. plugin*

    Stop using static/public fields OP.