QuickShop-Community / QuickShop-Hikari

QuickShop is a shop plugin that allows players to easily sell/buy any items from a chest without any commands. In fact, none of the commands that QuickShop provides are ever needed by a player.
https://modrinth.com/plugin/quickshop-hikari
Other
91 stars 56 forks source link

[BUG] org.bukkit.configuration.InvalidConfigurationException: Invalid JSON detected. #1772

Closed RICE0707 closed 1 day ago

RICE0707 commented 2 months ago

Description

This error occurred when I migrated from Reremake to Hikari

[01:40:17 ERROR]: [com.ghostchu.quickshop.addon.reremakemigrator.shade.com.dumptruckman.bukkit.configuration.json.JsonConfiguration] Cannot load plugins/QuickShop/overrides/zh_tw/messages.json
org.bukkit.configuration.InvalidConfigurationException: Invalid JSON detected.
        at com.ghostchu.quickshop.addon.reremakemigrator.shade.com.dumptruckman.bukkit.configuration.json.JsonConfiguration.loadFromString(JsonConfiguration.java:62) ~[Addon-Reremake-Migrator-6.2.0.7.jar:?]
        at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:160) ~[purpur-api-1.20.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:128) ~[purpur-api-1.20.2-R0.1-SNAPSHOT.jar:?]
        at com.ghostchu.quickshop.addon.reremakemigrator.shade.com.dumptruckman.bukkit.configuration.json.JsonConfiguration.loadConfiguration(JsonConfiguration.java:110) ~[Addon-Reremake-Migrator-6.2.0.7.jar:?]
        at com.ghostchu.quickshop.addon.reremakemigrator.shade.com.dumptruckman.bukkit.configuration.json.JsonConfiguration.loadConfiguration(JsonConfiguration.java:131) ~[Addon-Reremake-Migrator-6.2.0.7.jar:?]
        at com.ghostchu.quickshop.addon.reremakemigrator.migratecomponent.TranslationMigrateComponent.migrateFile(TranslationMigrateComponent.java:60) ~[Addon-Reremake-Migrator-6.2.0.7.jar:?]
        at com.ghostchu.quickshop.addon.reremakemigrator.migratecomponent.TranslationMigrateComponent.migrate(TranslationMigrateComponent.java:44) ~[Addon-Reremake-Migrator-6.2.0.7.jar:?]
        at com.ghostchu.quickshop.addon.reremakemigrator.command.SubCommand_ReremakeMigrate.lambda$onCommand$1(SubCommand_ReremakeMigrate.java:58) ~[Addon-Reremake-Migrator-6.2.0.7.jar:?]
        at org.bukkit.craftbukkit.v1_20_R2.scheduler.CraftTask.run(CraftTask.java:101) ~[purpur-1.20.2.jar:git-Purpur-2095]
        at org.bukkit.craftbukkit.v1_20_R2.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[purpur-1.20.2.jar:git-Purpur-2095]
        at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[purpur-1.20.2.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
        at java.lang.Thread.run(Thread.java:1583) ~[?:?]
Caused by: com.ghostchu.quickshop.addon.reremakemigrator.shade.net.minidev.json.parser.ParseException: Unexpected token 
 at position 19730.
        at com.ghostchu.quickshop.addon.reremakemigrator.shade.net.minidev.json.parser.JSONParserBase.parse(JSONParserBase.java:166) ~[Addon-Reremake-Migrator-6.2.0.7.jar:?]
        at com.ghostchu.quickshop.addon.reremakemigrator.shade.net.minidev.json.parser.JSONParserString.parse(JSONParserString.java:56) ~[Addon-Reremake-Migrator-6.2.0.7.jar:?]
        at com.ghostchu.quickshop.addon.reremakemigrator.shade.net.minidev.json.parser.JSONParserString.parse(JSONParserString.java:37) ~[Addon-Reremake-Migrator-6.2.0.7.jar:?]
        at com.ghostchu.quickshop.addon.reremakemigrator.shade.net.minidev.json.parser.JSONParser.parse(JSONParser.java:141) ~[Addon-Reremake-Migrator-6.2.0.7.jar:?]
        at com.ghostchu.quickshop.addon.reremakemigrator.shade.com.dumptruckman.bukkit.configuration.json.JsonConfiguration.loadFromString(JsonConfiguration.java:60) ~[Addon-Reremake-Migrator-6.2.0.7.jar:?]
        ... 13 more
[01:40:17 INFO]: [QuickShop-Hikari] Migrating the Reremake language file: /home/container/plugins/QuickShop/overrides/zh_tw/messages.json...

Steps to reproduce

https://quickshop-community.github.io/QuickShop-Hikari-Documents/docs/addon/reremake-migrator

Expected Behaviour

Smooth migration of language JSON

Screenshots

image This eliminates the possibility that JSON cannot be converted normally due to my modifications.

/quickshop paste URL

https://paste.helpch.at/wusejamepe

Additional Context

https://discord.com/channels/942378696415797298/942378809632649256/1287831915700682914

Checklist

YuanYuanOwO commented 1 week ago

Update: Discord channel update, please go to Discord to download new addon If I remember correctly, I should have pinged you in the Discord server. (Recommended to test as much as you can in the test server in advance)

creatorfromhell commented 1 day ago

This is a formatting issue in the JSON file. The parser used doesn't like trailing characters.