Bukkit/Bukkit — comment on commit 55f405f4a855fcf165e02379cae5bebc76c517d4
File:  line 0
By desht:

Here's another problem, this time with putting a default config.yml file in your plugin JAR: it breaks things when you're developing your plugin. If you do a "reload" on the server, and your plugin JAR (which contains config.yml) has changed, the JAR won't reload:

12:17:19 [SEVERE] Cannot load configuration
java.util.zip.ZipException: invalid block type
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:147)
at java.io.FilterInputStream.read(FilterInputStream.java:116)
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
at java.io.InputStreamReader.read(InputStreamReader.java:167)
at java.io.BufferedReader.fill(BufferedReader.java:136)
at java.io.BufferedReader.readLine(BufferedReader.java:299)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:135)
at org.bukkit.configuration.file.YamlConfiguration.loadConfiguration(YamlConfiguration.java:245)
at org.bukkit.plugin.java.JavaPlugin.reloadConfig(JavaPlugin.java:133)
at org.bukkit.plugin.java.JavaPlugin.getConfig(JavaPlugin.java:123)
at me.desht.scrollingmenusign.SMSConfig.initConfigFile(SMSConfig.java:70)
at me.desht.scrollingmenusign.SMSConfig.init(SMSConfig.java:42)
at me.desht.scrollingmenusign.ScrollingMenuSign.onEnable(ScrollingMenuSign.java:90)
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:174)
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:957)
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:280)
at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:171)
at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:154)
at org.bukkit.craftbukkit.CraftServer.reload(CraftServer.java:413)
at org.bukkit.Bukkit.reload(Bukkit.java:182)
at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:22)
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:163)
at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:355)
at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:351)
at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:506)
at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:485)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)

You're forced to do a cold stop/start of the server, which is a big pain.

There's a caching problem here, I'm guessing ultimately stemming from the getResourceAsStream() call in JavaPlugin. I had a similar problem with another plugin of mine (ChessCraft), and I had to jump through a few hoops to fix this behaviour. Look at extractResource() in https://github.com/desht/ChessCraft/blob/master/src/me/desht/chesscraft/ChessConfig.java - I think the same principle applies here...