yyuueexxiinngg/onebot-kotlin

[BUG]mirai更新到v2.12.0后,加载本插件会导致mirai-http插件无法工作

fatinghenji opened this issue · 1 comments

  • 控制台报错如下
2022-07-10 08:27:36 W/net.mamoe.mirai-api-http: Linked class net.mamoe.yamlkt.YamlElement in onebot-mirai-0.3.4-all.jar but plugin not depend on it.                                                          
2022-07-10 08:27:36 W/net.mamoe.mirai-api-http: Class loading logic may change in feature.                                                                                                                    
2022-07-10 08:27:36 E/net.mamoe.mirai-api-http: net.mamoe.yamlkt.YamlDecodingException: Top-level decoder: deserializing nested class for 'adapterSettings' in 'setting'                                      
    host: 0.0.0.0                                                                                                                                                                                             
                ^ at line 11, column 18                                                                                                                                                                       
                                                                                                                                                                                                              
net.mamoe.yamlkt.YamlDecodingException: Top-level decoder: deserializing nested class for 'adapterSettings' in 'setting'                                                                                      
    host: 0.0.0.0                                                                                                                                                                                             
                ^ at line 11, column 18                                                                                                                                                                       
                                                                                                                                                                                                              
        at net.mamoe.yamlkt.internal.YamlUtils__ContextualExceptionKt.contextualDecodingException(ContextualException.kt:154)                                                                                 
        at net.mamoe.yamlkt.internal.YamlUtils.contextualDecodingException(Unknown Source)                                                                                                                    
        at net.mamoe.yamlkt.internal.YamlDecoder$AbstractDecoder.decodeSerializableElement(YamlDecoder.kt:181)                                                                                                
        at kotlinx.serialization.encoding.CompositeDecoder$DefaultImpls.decodeSerializableElement$default(Decoding.kt:535)                                                                                    
        at net.mamoe.mirai.console.internal.data.PluginDataImpl$updaterSerializer$1.deserialize(PluginDataImpl.kt:85)                                                                                         
        at net.mamoe.mirai.console.internal.data.PluginDataImpl$updaterSerializer$1.deserialize(PluginDataImpl.kt:47)                                                                                         
        at net.mamoe.yamlkt.Yaml.decodeFromString(Yaml.kt:162)                                                                                                                                                
        at net.mamoe.mirai.console.internal.data.MultiFilePluginDataStorageImpl.load(MultiFilePluginDataStorageImpl.kt:44)                                                                                    
        at net.mamoe.mirai.console.plugin.jvm.AbstractJvmPlugin.reloadPluginConfig(AbstractJvmPlugin.kt:59)
        at mirai-api-http-v2.5.0.mirai.jar//net.mamoe.mirai.api.http.HttpApiPluginBase.onEnable(HttpApiPluginBase.kt:34)
        at net.mamoe.mirai.console.internal.plugin.JvmPluginInternal.internalOnEnable$mirai_console(JvmPluginInternal.kt:131)
        at net.mamoe.mirai.console.internal.plugin.BuiltInJvmPluginLoaderImpl.enable(BuiltInJvmPluginLoaderImpl.kt:278)
        at net.mamoe.mirai.console.internal.plugin.BuiltInJvmPluginLoaderImpl.enable(BuiltInJvmPluginLoaderImpl.kt:35)
        at net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader$BuiltIn.enable(JvmPluginLoader.kt)       
        at net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader$BuiltIn.enable(JvmPluginLoader.kt:50)    
        at net.mamoe.mirai.console.plugin.PluginManager.enablePlugin(PluginManager.kt:173)             
        at net.mamoe.mirai.console.internal.plugin.PluginManagerImpl.enableAllLoadedPlugins$mirai_console(PluginManagerImpl.kt:178)
        at net.mamoe.mirai.console.internal.MiraiConsoleImplementationBridge.doStart$mirai_console(MiraiConsoleImplementationBridge.kt:235)
        at net.mamoe.mirai.console.MiraiConsoleImplementation$Companion.start(MiraiConsoleImplementation.kt:464)
        at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon(MiraiConsoleTerminalLoader.kt:168)
        at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon$default(MiraiConsoleTerminalLoader.kt:167)
        at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.main(MiraiConsoleTerminalLoader.kt:52)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)              
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)              
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)          
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)                                   
        at org.itxtech.mcl.Utility.bootJars(Utility.java:89)                                           
        at org.itxtech.mcl.Utility.bootJars(Utility.java:79)                                           
        at org.itxtech.mcl.Utility.bootMirai(Utility.java:101)                                         
        at org.itxtech.mcl.module.builtin.Boot.boot(Boot.java:109)                                     
        at org.itxtech.mcl.module.ModuleManager.phaseBoot(ModuleManager.java:145)                      
        at org.itxtech.mcl.Loader.lambda$start$4(Loader.java:184)                                      
        at org.itxtech.mcl.Loader.tryCatching(Loader.java:146)                                         
        at org.itxtech.mcl.Loader.start(Loader.java:184)                                               
        at org.itxtech.mcl.Loader.main(Loader.java:79)                                                 
Caused by: net.mamoe.yamlkt.YamlDecodingException: Top-level decoder: deserializing nested class for '1' in 'kotlin.collections.LinkedHashMap'
    host: 0.0.0.0   
        ^ at line 11, column 10

        at net.mamoe.yamlkt.internal.YamlUtils__ContextualExceptionKt.contextualDecodingException(ContextualException.kt:154)
        at net.mamoe.yamlkt.internal.YamlUtils.contextualDecodingException(Unknown Source)             
        at net.mamoe.yamlkt.internal.YamlDecoder$AbstractDecoder.decodeSerializableElement(YamlDecoder.kt:181)
        at kotlinx.serialization.encoding.CompositeDecoder$DefaultImpls.decodeSerializableElement$default(Decoding.kt:535)
        at kotlinx.serialization.internal.MapLikeSerializer.readElement(CollectionSerializers.kt:111)  
        at kotlinx.serialization.internal.MapLikeSerializer.readElement(CollectionSerializers.kt:84)   
        at kotlinx.serialization.internal.AbstractCollectionSerializer.readElement$default(CollectionSerializers.kt:51)
        at kotlinx.serialization.internal.AbstractCollectionSerializer.merge(CollectionSerializers.kt:36)
        at kotlinx.serialization.internal.AbstractCollectionSerializer.deserialize(CollectionSerializers.kt:43)
        at net.mamoe.mirai.console.data.SerializableValue$Companion$serializableValueWith$$inlined$map$1.deserialize(serializerHelper.kt:170)
        at net.mamoe.yamlkt.internal.YamlDecoder$AbstractDecoder.decodeSerializableElement(YamlDecoder.kt:179)
        ... 32 more                                
Caused by: java.lang.ClassCastException: class net.mamoe.yamlkt.internal.YamlDecoder$BlockMapDecoder cannot be cast to class net.mamoe.yamlkt.internal.YamlDecoder$AbstractDecoder (net.mamoe.yamlkt.internal.
YamlDecoder$BlockMapDecoder is in unnamed module of loader 'app'; net.mamoe.yamlkt.internal.YamlDecoder$AbstractDecoder is in unnamed module of loader 'onebot-mirai-0.3.4-all.jar' @3ce443f9)
        at onebot-mirai-0.3.4-all.jar//net.mamoe.yamlkt.internal.YamlElementSerializer.deserialize(YamlElementSerializer.kt:35)
        at onebot-mirai-0.3.4-all.jar//net.mamoe.yamlkt.internal.YamlElementSerializer.deserialize(YamlElementSerializer.kt:30)
        at net.mamoe.yamlkt.internal.YamlDecoder$AbstractDecoder.decodeSerializableElement(YamlDecoder.kt:179)
        ... 40 more 


复现

版本

onebot-mirai 插件版 - 0.3.4

75a84ee

mirai-core-2.12.0

mirai-console-2.12.0