24
Янв
2021

Создаю мод на Java. Всё вроде бы было хорошо, но при запуске игры появляется ошибка java.nio.file.AccessDeniedException

Пытался, что-то делать, но вообще не могу понять, в чём заключается ошибка. Ниже приведу код и краш-репорт

Time: 24.01.21 0:01
Description: Rendering overlay

com.electronwill.nightconfig.core.io.WritingException: An I/O error occured
    at com.electronwill.nightconfig.core.io.ConfigWriter.write(ConfigWriter.java:90) ~[core-3.6.2.jar:?] {}
    at com.electronwill.nightconfig.core.file.WriteSyncFileConfig.save(WriteSyncFileConfig.java:61) ~[core-3.6.2.jar:?] {}
    at com.electronwill.nightconfig.core.file.AutosaveCommentedFileConfig.save(AutosaveCommentedFileConfig.java:80) ~[core-3.6.2.jar:?] {}
    at net.minecraftforge.fml.config.ModConfig.save(ModConfig.java:94) ~[forge:?] {re:classloading}
    at net.minecraftforge.fml.config.ConfigTracker.openConfig(ConfigTracker.java:107) ~[forge:?] {re:classloading}
    at net.minecraftforge.fml.config.ConfigTracker.lambda$loadConfigs$1(ConfigTracker.java:83) ~[forge:?] {re:classloading}
    at java.lang.Iterable.forEach(Iterable.java:75) ~[?:1.8.0_275] {}
    at java.util.Collections$SynchronizedCollection.forEach(Collections.java:2064) ~[?:1.8.0_275] {}
    at net.minecraftforge.fml.config.ConfigTracker.loadConfigs(ConfigTracker.java:83) ~[forge:?] {re:classloading}
    at net.minecraftforge.fml.ModLoader.lambda$null$18(ModLoader.java:202) ~[forge:?] {re:classloading}
    at net.minecraftforge.fml.DistExecutor.unsafeRunWhenOn(DistExecutor.java:125) ~[forge:?] {re:classloading}
    at net.minecraftforge.fml.ModLoader.loadMods(ModLoader.java:202) ~[forge:?] {re:classloading}
    at net.minecraftforge.fml.client.ClientModLoader.lambda$startModLoading$7(ClientModLoader.java:132) ~[forge:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$4(ClientModLoader.java:123) ~[forge:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraftforge.fml.client.ClientModLoader.startModLoading(ClientModLoader.java:132) ~[forge:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraftforge.fml.client.ClientModLoader.lambda$onResourceReload$2(ClientModLoader.java:114) ~[forge:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$4(ClientModLoader.java:123) ~[forge:?] {re:classloading,pl:runtimedistcleaner:A}
    at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1640) ~[?:1.8.0_275] {}
    at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1632) ~[?:1.8.0_275] {}
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) ~[?:1.8.0_275] {}
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) ~[?:1.8.0_275] {}
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) ~[?:1.8.0_275] {}
    at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:175) ~[?:1.8.0_275] {}
Caused by: java.nio.file.AccessDeniedException: C:\Users\user\Desktop\amulets_mod\run\config\forge-client.toml
    at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:83) ~[?:1.8.0_275] {}
    at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97) ~[?:1.8.0_275] {}
    at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102) ~[?:1.8.0_275] {}
    at sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:230) ~[?:1.8.0_275] {}
    at java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:434) ~[?:1.8.0_275] {}
    at java.nio.file.Files.newOutputStream(Files.java:216) ~[?:1.8.0_275] {}
    at com.electronwill.nightconfig.core.io.ConfigWriter.write(ConfigWriter.java:87) ~[core-3.6.2.jar:?] {}
    ... 22 more


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Render thread
Stacktrace:
    at com.electronwill.nightconfig.core.io.ConfigWriter.write(ConfigWriter.java:90) ~[core-3.6.2.jar:?] {}
    at com.electronwill.nightconfig.core.file.WriteSyncFileConfig.save(WriteSyncFileConfig.java:61) ~[core-3.6.2.jar:?] {}
    at com.electronwill.nightconfig.core.file.AutosaveCommentedFileConfig.save(AutosaveCommentedFileConfig.java:80) ~[core-3.6.2.jar:?] {}
    at net.minecraftforge.fml.config.ModConfig.save(ModConfig.java:94) ~[forge:?] {re:classloading}
    at net.minecraftforge.fml.config.ConfigTracker.openConfig(ConfigTracker.java:107) ~[forge:?] {re:classloading}
    at net.minecraftforge.fml.config.ConfigTracker.lambda$loadConfigs$1(ConfigTracker.java:83) ~[forge:?] {re:classloading}
    at java.lang.Iterable.forEach(Iterable.java:75) ~[?:1.8.0_275] {}
    at java.util.Collections$SynchronizedCollection.forEach(Collections.java:2064) ~[?:1.8.0_275] {}
-- Overlay render details --
Details:
    Overlay name: net.minecraft.client.gui.ResourceLoadProgressGui
Stacktrace:
    at net.minecraft.client.renderer.GameRenderer.updateCameraAndRender(GameRenderer.java:495) ~[forge-1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1002) ~[forge-1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.run(Minecraft.java:612) ~[forge-1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.main.Main.main(Main.java:184) ~[forge-1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_275] {}
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_275] {}
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_275] {}
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_275] {}
    at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:52) ~[forge-1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.0.6.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.0.6.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.0.6.jar:?] {}
    at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.0.6.jar:?] {}
    at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.0.6.jar:?] {}
    at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:105) [forge-1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {}


-- System Details --
Details:
    Minecraft Version: 1.16.4
    Minecraft Version ID: 1.16.4
    Operating System: Windows 7 (amd64) version 6.1
    Java Version: 1.8.0_275, AdoptOpenJDK
    Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), AdoptOpenJDK
    Memory: 454096776 bytes (433 MB) / 987234304 bytes (941 MB) up to 1901592576 bytes (1813 MB)
    CPUs: 4
    JVM Flags: 1 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump
    ModLauncher: 8.0.6+85+master.325de55
    ModLauncher launch target: fmluserdevclient
    ModLauncher naming: mcp
    ModLauncher services: 
        /mixin-0.8.2.jar mixin PLUGINSERVICE 
        /eventbus-3.0.5-service.jar eventbus PLUGINSERVICE 
        /forge-1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3-launcher.jar object_holder_definalize PLUGINSERVICE 
        /forge-1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3-launcher.jar runtime_enum_extender PLUGINSERVICE 
        /accesstransformers-2.2.0-shadowed.jar accesstransformer PLUGINSERVICE 
        /forge-1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3-launcher.jar capability_inject_definalize PLUGINSERVICE 
        /forge-1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3-launcher.jar runtimedistcleaner PLUGINSERVICE 
        /mixin-0.8.2.jar mixin TRANSFORMATIONSERVICE 
        /forge-1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3-launcher.jar fml TRANSFORMATIONSERVICE 
    FML: 35.1
    Forge: net.minecraftforge:35.1.4
    FML Language Providers: 
        [email protected]
        [email protected]
    Mod List: 
        client-extra.jar                                  |Minecraft                     |minecraft                     |1.16.4              |COMMON_SET|a1:d4:5e:04:4f:d3:d6:e0:7b:37:97:cf:77:b0:de:ad:4a:47:ce:8c:96:49:5f:0a:cf:8c:ae:b2:6d:4b:8a:3f
        forge-1.16.4-35.1.4_mapped_snapshot_20201028-1.16.|Forge                         |forge                         |35.1.4              |COMMON_SET|NOSIGNATURE
        main                                              |Amulets                       |amulets_mod                   |1.16.4.1-0.1.0      |COMMON_SET|NOSIGNATURE
    Crash Report UUID: c12457b9-4d99-46be-8e41-cf9a8ade4954
    Launched Version: MOD_DEV
    Backend library: LWJGL version 3.2.2 build 10
    Backend API: GeForce GTX 1050 Ti/PCIe/SSE2 GL version 4.6.0 NVIDIA 430.86, NVIDIA Corporation
    GL Caps: Using framebuffer using OpenGL 3.0
    Using VBOs: Yes
    Is Modded: Definitely; Client brand changed to 'forge'
    Type: Client (map_client.txt)
    Graphics mode: fancy
    Resource Packs: 
    Current Language: English (US)
    CPU: 4x Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz'''

Основная ошибка Caused by: java.nio.file.AccessDeniedException: C:\Users\user\Desktop\amulets_mod\run\config\forge-client.toml

Forge-client.toml:

введите сюда описание изображения

Источник: https://ru.stackoverflow.com/questions/1235397/%D0%A1%D0%BE%D0%B7%D0%B4%D0%B0%D1%8E-%D0%BC%D0%BE%D0%B4-%D0%BD%D0%B0-java-%D0%92%D1%81%D1%91-%D0%B2%D1%80%D0%BE%D0%B4%D0%B5-%D0%B1%D1%8B-%D0%B1%D1%8B%D0%BB%D0%BE-%D1%85%D0%BE%D1%80%D0%BE%D1%88%D0%BE-%D0%BD%D0%BE-%D0%BF%D1%80%D0%B8-%D0%B7%D0%B0%D0%BF%D1%83%D1%81%D0%BA%D0%B5-%D0%B8%D0%B3%D1%80%D1%8B-%D0%BF%D0%BE%D1%8F%D0%B2%D0%BB%D1%8F%D0%B5%D1%82%D1%81%D1%8F-%D0%BE%D1%88%D0%B8

Тебе может это понравится...

Добавить комментарий