From 9b7fc30512d3f7a6697e9fc0f084098d54f4d425 Mon Sep 17 00:00:00 2001 From: LamGC Date: Sat, 2 Jul 2022 22:01:05 +0800 Subject: [PATCH] =?UTF-8?q?fix(config):=20=E4=BF=AE=E5=A4=8D=E5=9B=A0?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E4=BA=86=E9=94=99=E8=AF=AF=E7=9A=84=20Gson?= =?UTF-8?q?=20=E5=AF=B9=E8=B1=A1=E8=80=8C=E5=AF=BC=E8=87=B4=E7=9A=84?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=88=9D=E5=A7=8B=E5=8C=96=E8=AD=A6=E5=91=8A?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 导致的原因是在初始化 app.json 时错误的使用了 botConfigGson, 而 botConfigGson 未配置用于 MetricsServer 的 UsernameAuthenticator 序列化器, 导致在初始化配置文件中序列化 AppConfig 时, Gson 会反射调用 BasicAuthenticator, 导致被 Java 模块系统拦截并报错, 现已修复该问题. --- scalabot-app/src/main/kotlin/AppConfigs.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scalabot-app/src/main/kotlin/AppConfigs.kt b/scalabot-app/src/main/kotlin/AppConfigs.kt index a57b9b3..355c28d 100644 --- a/scalabot-app/src/main/kotlin/AppConfigs.kt +++ b/scalabot-app/src/main/kotlin/AppConfigs.kt @@ -114,7 +114,7 @@ internal enum class AppPaths( CONFIG_APPLICATION({ "$DATA_ROOT/config.json" }, { if (!file.exists()) { file.bufferedWriter(StandardCharsets.UTF_8).use { - GsonConst.botConfigGson.toJson( + GsonConst.appConfigGson.toJson( AppConfig( mavenRepositories = listOf( MavenRepositoryConfig(