project-mirai / mirai-api-http

Mirai HTTP API (console) plugin
GNU Affero General Public License v3.0
1.66k stars 343 forks source link

mirai 升 2.12 后出报错 #592

Closed fatinghenji closed 2 years ago

fatinghenji commented 2 years ago

如题,除升级mirai外未作任何其余改动。 报错代码如下:

2022-07-10 20:29:20 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 20:29:20 W/net.mamoe.mirai-api-http: Class loading logic may change in feature.                                                                                                                    
2022-07-10 20:29:20 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.2.mirai2.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:148)  
        at org.itxtech.mcl.Loader.lambda$start$4(Loader.java:189)
        at org.itxtech.mcl.Loader.tryCatching(Loader.java:146)
        at org.itxtech.mcl.Loader.start(Loader.java:189)
        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' @1cc680e)
        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
fatinghenji commented 2 years ago

参看在更新至2.12.0后部分插件报错,问题解决。