FileReader wont initialize

Discussion in 'Plugin Development' started by psychic94, Jun 7, 2013.

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

    psychic94

    For a while now, I've been struggling with a runtime error that until today was disguised as a semantic error. By editing try/catch blocks and throws statements, I have revealed the true problem, but I cant find a way to fix it. Here's the stack trace:
    Code:
    2013-06-07 15:53:14 [WARNING] Unexpected exception while parsing console command "ppercent psychic94"
    org.bukkit.command.CommandException: Unhandled exception executing command 'ppercent' in plugin ActivityHistory v0.1.5
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:189)
        at org.bukkit.craftbukkit.v1_5_R3.CraftServer.dispatchCommand(CraftServer.java:523)
        at org.bukkit.craftbukkit.v1_5_R3.CraftServer.dispatchServerCommand(CraftServer.java:512)
        at net.minecraft.server.v1_5_R3.DedicatedServer.an(DedicatedServer.java:262)
        at net.minecraft.server.v1_5_R3.DedicatedServer.r(DedicatedServer.java:227)
        at net.minecraft.server.v1_5_R3.MinecraftServer.q(MinecraftServer.java:477)
        at net.minecraft.server.v1_5_R3.MinecraftServer.run(MinecraftServer.java:410)
        at net.minecraft.server.v1_5_R3.ThreadServerApplication.run(SourceFile:573)
    Caused by: java.lang.NullPointerException
        at java.io.FileInputStream.<init>(Unknown Source)
        at java.io.FileReader.<init>(Unknown Source)
        at psy.ActivityHistory.PlayerLogFile.loadSessions(PlayerLogFile.java:44)
        at psy.ActivityHistory.PlayerLogFile.<init>(PlayerLogFile.java:39)
        at psy.ActivityHistory.PlayerLogFile.<init>(PlayerLogFile.java:27)
        at psy.ActivityHistory.cmd.FilePQCE.loadLogFile(FilePQCE.java:73)
        at psy.ActivityHistory.cmd.FilePQCE.onCommand(FilePQCE.java:28)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)
        ... 8 more
    All of my code can be found on my repository: https://github.com/psychic94/ActivityHistory/

    Any ideas?
     
  2. Offline

    Jogy34

    ummm... you're never initializing your file.
     
  3. Offline

    psychic94

    The file is initialized in the constructor of PlayerLogFile.
     
  4. Offline

    Jogy34

    You create the file but you don't actually set your file variable.
     
  5. Offline

    psychic94

    Wow I can't believe I missed that.

    Thanks it works now.
     
Thread Status:
Not open for further replies.

Share This Page