dumptruckman/Multiverse-Inventories — Issue #3: First startup: debug.log file handle not available
Author: lithium3141
Created: 2012-01-06 22:33:21+00:00
State: open

On first install of MV-Inventories, the plugin throws an exception as follows:

17:27:02 [SEVERE] java.io.IOException: Couldn't get lock for plugins/Multiverse-Profiles/debug.log
17:27:02 [SEVERE] at java.util.logging.FileHandler.openFiles(FileHandler.java:372)
17:27:02 [SEVERE] at java.util.logging.FileHandler.(FileHandler.java:270)
17:27:02 [SEVERE] at com.onarandombox.MultiverseCore.utils.DebugLog.(DebugLog.java:39)
17:27:02 [SEVERE] at com.onarandombox.multiverseprofiles.util.ProfilesDebug.init(ProfilesDebug.java:25)
17:27:02 [SEVERE] at com.onarandombox.multiverseprofiles.MultiverseProfiles.onEnable(MultiverseProfiles.java:92)
17:27:02 [SEVERE] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:228)
17:27:02 [SEVERE] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:970)
17:27:02 [SEVERE] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:280)
17:27:02 [SEVERE] at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:186)
17:27:02 [SEVERE] at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:169)
17:27:02 [SEVERE] at net.minecraft.server.MinecraftServer.t(MinecraftServer.java:348)
17:27:02 [SEVERE] at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:335)
17:27:02 [SEVERE] at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:165)
17:27:02 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:399)
17:27:02 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:457)

I think this has to do with the plugin folder not existing yet, but I'm not sure. In any event, the plugin needs to lock `debug.log` safely even on first startup. Subsequent starts initialize MV-Inventories successfully.