Bukkit WorldCreator Gives java.io.IOException On A Specific World

Discussion in 'Bukkit Help' started by wowkster, Aug 5, 2020.

  1. Offline

    wowkster

    I am making a minigame server, and I am trying to use 2 Bukkit worlds for my map (One as the world that gets used and the other as the template when the map gets reset after each round). However, when I copied my world folder into another directory and tried loading it in my plugin onEnable method, I get the following error.

    Code:
    [11:08:50 ERROR]: Error occurred while enabling BedWars v1.0 (Is it up to date?)
    java.lang.RuntimeException: java.io.IOException: The process cannot access the file because another process has locked a portion of the file
            at org.bukkit.craftbukkit.v1_16_R1.CraftServer.createWorld(CraftServer.java:1092) ~[patched_1.16.1.jar:git-Paper-86]
            at com.adrianwowk.bedwarsclone.BedWars.onEnable(BedWars.java:44) ~[?:?]
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[patched_1.16.1.jar:git-Paper-86]
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:380) ~[patched_1.16.1.jar:git-Paper-86]
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:483) ~[patched_1.16.1.jar:git-Paper-86]
            at org.bukkit.craftbukkit.v1_16_R1.CraftServer.enablePlugin(CraftServer.java:500) ~[patched_1.16.1.jar:git-Paper-86]
            at org.bukkit.craftbukkit.v1_16_R1.CraftServer.enablePlugins(CraftServer.java:414) ~[patched_1.16.1.jar:git-Paper-86]
            at org.bukkit.craftbukkit.v1_16_R1.CraftServer.reload(CraftServer.java:932) ~[patched_1.16.1.jar:git-Paper-86]
            at com.adrianwowk.bedwarsclone.commands.CommandHandler.onCommand(CommandHandler.java:106) ~[?:?]
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[patched_1.16.1.jar:git-Paper-86]
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[patched_1.16.1.jar:git-Paper-86]
            at org.bukkit.craftbukkit.v1_16_R1.CraftServer.dispatchCommand(CraftServer.java:794) ~[patched_1.16.1.jar:git-Paper-86]
            at org.bukkit.craftbukkit.v1_16_R1.CraftServer.dispatchServerCommand(CraftServer.java:756) ~[patched_1.16.1.jar:git-Paper-86]
            at net.minecraft.server.v1_16_R1.DedicatedServer.handleCommandQueue(DedicatedServer.java:411) ~[patched_1.16.1.jar:git-Paper-86]
            at net.minecraft.server.v1_16_R1.DedicatedServer.b(DedicatedServer.java:378) ~[patched_1.16.1.jar:git-Paper-86]
            at net.minecraft.server.v1_16_R1.MinecraftServer.a(MinecraftServer.java:1212) ~[patched_1.16.1.jar:git-Paper-86]
            at net.minecraft.server.v1_16_R1.MinecraftServer.v(MinecraftServer.java:1000) ~[patched_1.16.1.jar:git-Paper-86]
            at net.minecraft.server.v1_16_R1.MinecraftServer.lambda$a$0(MinecraftServer.java:177) ~[patched_1.16.1.jar:git-Paper-86]
            at java.lang.Thread.run(Unknown Source) [?:1.8.0_261]
    Caused by: java.io.IOException: The process cannot access the file because another process has locked a portion of the file
            at sun.nio.ch.FileDispatcherImpl.write0(Native Method) ~[?:1.8.0_261]
            at sun.nio.ch.FileDispatcherImpl.write(Unknown Source) ~[?:1.8.0_261]
            at sun.nio.ch.IOUtil.writeFromNativeBuffer(Unknown Source) ~[?:1.8.0_261]
            at sun.nio.ch.IOUtil.write(Unknown Source) ~[?:1.8.0_261]
            at sun.nio.ch.FileChannelImpl.write(Unknown Source) ~[?:1.8.0_261]
            at net.minecraft.server.v1_16_R1.SessionLock.a(SourceFile:40) ~[patched_1.16.1.jar:git-Paper-86]
            at net.minecraft.server.v1_16_R1.Convertable$ConversionSession.<init>(Convertable.java:198) ~[patched_1.16.1.jar:git-Paper-86]
            at net.minecraft.server.v1_16_R1.Convertable.c(Convertable.java:180) ~[patched_1.16.1.jar:git-Paper-86]
            at org.bukkit.craftbukkit.v1_16_R1.CraftServer.createWorld(CraftServer.java:1090) ~[patched_1.16.1.jar:git-Paper-86]
            ... 18 more
    It says that "another process has locked a portion of the file", but it doesn't give me any more details. Also, I noticed that if I go into the new world directory and delete the level.dat file, then I don't get the error until the second time it gets loaded (on next server start or reload).

    I'm very confused about what the problem is so any insight or feedback would be appreciated!
     
    Last edited by a moderator: Aug 5, 2020

Share This Page