Nullpointerexeption that doesn't exist

Discussion in 'Plugin Development' started by MattTheBeast, Jun 4, 2017.

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

    MattTheBeast

    My plugin was working just fine intill I exported it with a few minor updates and it gives me a null pointer for a class that doesn't exist.. I use to have that class but I removed it long ago

    Code:
    5:42:00 PM [ERROR] Error occurred while enabling SolarPrisons v1.0 (Is it up to date?)
    5:42:00 PM java.lang.NullPointerException
    5:42:00 PM at me.matt.solarprison.Utils.TeamsYML.reloadTeams(TeamsYML.java:29) ~[?:?]
    5:42:00 PM at me.matt.solarprison.Utils.TeamsYML.getTeams(TeamsYML.java:47) ~[?:?]
    5:42:00 PM at me.matt.solarprison.Main.onEnable(Main.java:67) ~[?:?]
    5:42:00 PM at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) ~[spigot-1.8.8-R0.1-SNAPSHOT-latest.jar:git-Spigot-db6de12-18fbb24]
    5:42:00 PM at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:340) [spigot-1.8.8-R0.1-SNAPSHOT-latest.jar:git-Spigot-db6de12-18fbb24]
    5:42:00 PM at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) [spigot-1.8.8-R0.1-SNAPSHOT-latest.jar:git-Spigot-db6de12-18fbb24]
    5:42:00 PM at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:357) [spigot-1.8.8-R0.1-SNAPSHOT-latest.jar:git-Spigot-db6de12-18fbb24]
    5:42:00 PM at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:317) [spigot-1.8.8-R0.1-SNAPSHOT-latest.jar:git-Spigot-db6de12-18fbb24]
    5:42:00 PM at net.minecraft.server.v1_8_R3.MinecraftServer.s(MinecraftServer.java:414) [spigot-1.8.8-R0.1-SNAPSHOT-latest.jar:git-Spigot-db6de12-18fbb24]
    5:42:00 PM at net.minecraft.server.v1_8_R3.MinecraftServer.k(MinecraftServer.java:378) [spigot-1.8.8-R0.1-SNAPSHOT-latest.jar:git-Spigot-db6de12-18fbb24]
    5:42:00 PM at net.minecraft.server.v1_8_R3.MinecraftServer.a(MinecraftServer.java:333) [spigot-1.8.8-R0.1-SNAPSHOT-latest.jar:git-Spigot-db6de12-18fbb24]
    5:42:00 PM at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:263) [spigot-1.8.8-R0.1-SNAPSHOT-latest.jar:git-Spigot-db6de12-18fbb24]
    5:42:00 PM at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:525) [spigot-1.8.8-R0.1-SNAPSHOT-latest.jar:git-Spigot-db6de12-18fbb24]
    5:42:00 PM at java.lang.Thread.run(Unknown Source) [?:1.8.0_101]

    this is my onEnable

    Code:
      public void onEnable()
      {
    
        plugin = this;
        pm = Bukkit.getPluginManager();
        this.players = new HashMap<>();
      
        registerCommands();
        registerListener();
      
        loadConfiguration();
      
        getConfig().addDefault("Rank.PLAYER", "�6(To (target)�6): �f(message)");
        getConfig().options().copyDefaults(true);
        saveConfig();
      
      }
    Please help if you can!
     
    Last edited by a moderator: Jun 4, 2017
  2. Offline

    Zombie_Striker

    @MattTheBeast
    1. Don't use color codes in your plugin. The ChatColor enum is there for a reason.
    2. Most configs do not support color codes. Replace the signs with & and use ChatColor.transltaeAlternateColorCodes('&',STRING); to re-add the color codes.
    3. What is reloadTeams 29 for the TeamYML class?
     
  3. Offline

    MattTheBeast

    @Zombie_Striker

    Thats the problem I dont have the the TeamYML class anymore
     
  4. Offline

    ipodtouch0218

    You must be testing an old build of your plugin. If a class doesn't exist, errors won't be created by them. Try re-building and compiling.
     
Thread Status:
Not open for further replies.

Share This Page