I'm getting these FileIO errors when DC is loading chests. Many load, some don't. Here's an example of the stack trace:
2012-01-09 10:27:32 [SEVERE] java.io.FileNotFoundException: D:\MC 1.0\Minecraft\plugins\DropChest\dropchests.yml (The requested operation cannot be performed on a file with a user-mapped section open)
2012-01-09 10:27:32 [SEVERE] at java.io.FileOutputStream.open(Native Method)
2012-01-09 10:27:32 [SEVERE] at java.io.FileOutputStream.(Unknown Source)
2012-01-09 10:27:32 [SEVERE] at java.io.FileOutputStream.(Unknown Source)
2012-01-09 10:27:32 [SEVERE] at java.io.FileWriter.(Unknown Source)
2012-01-09 10:27:32 [SEVERE] at com.narrowtux.DropChest.DropChest.save(DropChest.java:224)
2012-01-09 10:27:32 [SEVERE] at com.narrowtux.DropChest.DropChest.addChest(DropChest.java:106)
2012-01-09 10:27:32 [SEVERE] at com.narrowtux.DropChest.DropChest.load(DropChest.java:146)
2012-01-09 10:27:32 [SEVERE] at com.narrowtux.DropChest.DropChest.onEnable(DropChest.java:96)
2012-01-09 10:27:32 [SEVERE] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:188)
2012-01-09 10:27:32 [SEVERE] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:968)
2012-01-09 10:27:32 [SEVERE] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:280)
2012-01-09 10:27:32 [SEVERE] at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:186)
2012-01-09 10:27:32 [SEVERE] at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:169)
2012-01-09 10:27:32 [SEVERE] at net.minecraft.server.MinecraftServer.t(MinecraftServer.java:348)
2012-01-09 10:27:32 [SEVERE] at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:335)
2012-01-09 10:27:32 [SEVERE] at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:165)
2012-01-09 10:27:32 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:399)
2012-01-09 10:27:32 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:457)
2012-01-09 10:27:32 [INFO] Chest loaded.
2012-01-09 10:27:32 [SEVERE] java.io.FileNotFoundException: D:\MC 1.0\Minecraft\plugins\DropChest\dropchests.yml (The requested operation cannot be performed on a file with a user-mapped section open)
2012-01-09 10:27:32 [SEVERE] at java.io.FileOutputStream.open(Native Method)
2012-01-09 10:27:32 [SEVERE] at java.io.FileOutputStream.(Unknown Source)
2012-01-09 10:27:32 [SEVERE] at java.io.FileOutputStream.(Unknown Source)
2012-01-09 10:27:32 [SEVERE] at java.io.FileWriter.(Unknown Source)
2012-01-09 10:27:32 [SEVERE] at com.narrowtux.DropChest.DropChest.save(DropChest.java:224)
2012-01-09 10:27:32 [SEVERE] at com.narrowtux.DropChest.DropChest.addChest(DropChest.java:106)
2012-01-09 10:27:32 [SEVERE] at com.narrowtux.DropChest.DropChest.load(DropChest.java:146)
2012-01-09 10:27:32 [SEVERE] at com.narrowtux.DropChest.DropChest.onEnable(DropChest.java:96)
2012-01-09 10:27:32 [SEVERE] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:188)
2012-01-09 10:27:32 [SEVERE] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:968)
2012-01-09 10:27:32 [SEVERE] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:280)
2012-01-09 10:27:32 [SEVERE] at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:186)
2012-01-09 10:27:32 [SEVERE] at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:169)
2012-01-09 10:27:32 [SEVERE] at net.minecraft.server.MinecraftServer.t(MinecraftServer.java:348)
2012-01-09 10:27:32 [SEVERE] at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:335)
2012-01-09 10:27:32 [SEVERE] at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:165)
2012-01-09 10:27:32 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:399)
2012-01-09 10:27:32 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:457)
2012-01-09 10:27:32 [INFO] Chest loaded.
It'll load a bunch (like 30-50 chests), then throw a couple of these errors, then load more. The chests that error out on load are deleted.
I am running the same mod on two servers here, one Windows-based, and one Mac-based. Do you perhaps have an antivirus program installed? If so, could you try to add an exception to the Minecraft folder?
Edit: It appears that when adding a chest to its internal data structures, "save()" is called, which attempts to save the chests back out to disk.
In my form I have fixed this now, but that fork is highly experimental due to some performance optimizations I've done.
Does he update this plugin? If so, is it possible for you to submit a pull for that change?
If not, I can just fork and grab your change. But i'd prefer not to.
Don't know yet, he hasn't responded to the issue I posted a few days
back. To be honest, there's a lot of problems with his code. For
instance, an internal data structure intended to lighten the load on
the server had a memory leak, and on server restart new chests got
ID's starting at 1 again, risking overwriting existing chests. This
can easily be observed by creating one chest, restarting server,
creating another, restarting again and checking the list.
I have fixed the following issues in my own repository:
- overlapping chest radius areas did not work
- duplicate ID's after server restart
- memory leak in code intended to lighten overhead
- if an item was placed into a chest, the code still ran through all
the other chests to process the same item
- no mention of setdelay command in help
Additionally:
- now places items in chests with filters before considering chests
without (easier to create spillover chests)
- pre-filters item against chest filter before processing chests, and
check distance first (not sure I pushed that change), this avoids
loading chunks with dropchests into memory
- working "lighten the load" code that works better than his, I
frequently observed items floating around for minutes, now it takes
seconds
For now I'll maintain my own fork, but I hope he responds.
Lasse Vågsæther Karlsen
On 9. jan. 2012, at 22:44, sorklin
[email protected]
wrote:
Does he update this plugin? If so, is it possible for you to submit a pull for that change?
If not, I can just fork and grab your change. But i'd prefer not to.
Reply to this email directly or view it on GitHub:
https://github.com/narrowtux/DropChest/issues/9#issuecomment-3420944