Open Metric-Void opened 3 years ago
从仓库中重新编译了一份 行号有变化
2021-02-19 17:35:52 I/OneBot: 此链接图片已缓存, 如需删除缓存请至 D:\Users\...\mirai-runtime\data\OneBot\image\80F65671342E1F31588E6F04DBA27D9C.cqimg
2021-02-19 17:35:52 E/OneBot: Exception in WebsocketServer
java.lang.ExceptionInInitializerError
at com.github.yyuueexxiinngg.onebot.util.CQMessgeParserKt.tryResolveCachedImage(CQMessgeParser.kt:578)
at com.github.yyuueexxiinngg.onebot.util.CQMessgeParserKt$tryResolveMedia$2.invokeSuspend(CQMessgeParser.kt:404)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
Caused by: java.lang.ClassNotFoundException: net.mamoe.mirai.internal.network.QQAndroidBotNetworkHandler
at net.mamoe.mirai.console.internal.plugin.JvmPluginClassLoader.findClass$mirai_console(JvmPluginClassLoader.kt:110)
at net.mamoe.mirai.console.internal.plugin.JvmPluginClassLoader.findClass(JvmPluginClassLoader.kt:51)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:377)
at com.github.yyuueexxiinngg.onebot.util.ImgUtil.<clinit>(ImgUtil.kt:23)
... 8 more
2021-02-19 17:36:02 I/OneBot: 此链接图片已缓存, 如需删除缓存请至 D:\Users\...\mirai-runtime\data\OneBot\image\80F65671342E1F31588E6F04DBA27D9C.cqimg
2021-02-19 17:36:02 E/OneBot: Exception in WebsocketServer
java.lang.NoClassDefFoundError: Could not initialize class com.github.yyuueexxiinngg.onebot.util.ImgUtil
at com.github.yyuueexxiinngg.onebot.util.CQMessgeParserKt.tryResolveCachedImage(CQMessgeParser.kt:578)
at com.github.yyuueexxiinngg.onebot.util.CQMessgeParserKt$tryResolveMedia$2.invokeSuspend(CQMessgeParser.kt:404)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
我遇到了同样的问题
我遇到了同样的问题
看看我的PR,构建一下,应该能解决问题
我遇到了同样的问题
看看我的PR,构建一下,应该能解决问题
不需要自行构建,actions会自己构建pr
https://github.com/yyuueexxiinngg/onebot-kotlin/actions/runs/583096688
我遇到了同样的问题
看看我的PR,构建一下,应该能解决问题
会有另一个报错 ` 2021-03-04 11:07:50 E/OneBot: Exception in coroutine Plugin OneBot of OneBot kotlinx.serialization.SerializationException: Class 'ForwardMessageInternal' is not registered for polymorphic serializa tion in the scope of 'SingleMessage'. Mark the base class as 'sealed' or register the serializer explicitly. at kotlinx.serialization.internal.AbstractPolymorphicSerializerKt.throwSubtypeNotRegistered(AbstractPolymorphicS erializer.kt:103) at kotlinx.serialization.internal.AbstractPolymorphicSerializerKt.throwSubtypeNotRegistered(AbstractPolymorphicS erializer.kt:113) at kotlinx.serialization.PolymorphicSerializerKt.findPolymorphicSerializer(PolymorphicSerializer.kt:96) at kotlinx.serialization.json.internal.PolymorphicKt.findActualSerializer(Polymorphic.kt:29) at kotlinx.serialization.json.internal.PolymorphicKt.access$findActualSerializer(Polymorphic.kt:1) at kotlinx.serialization.json.internal.StreamingJsonEncoder.encodeSerializableValue(StreamingJsonEncoder.kt:226)
at kotlinx.serialization.encoding.AbstractEncoder.encodeSerializableElement(AbstractEncoder.kt:71)
at kotlinx.serialization.internal.ListLikeSerializer.serialize(CollectionSerializers.kt:69)
at net.mamoe.mirai.message.data.MessageChain$Serializer.serialize(MessageChain.kt:251)
at net.mamoe.mirai.message.data.MessageChain$Serializer.serialize(MessageChain.kt:246)
at kotlinx.serialization.json.internal.StreamingJsonEncoder.encodeSerializableValue(StreamingJsonEncoder.kt:223)
at kotlinx.serialization.encoding.AbstractEncoder.encodeSerializableElement(AbstractEncoder.kt:71)
at net.mamoe.mirai.internal.message.MessageSourceSerializerImpl$SerialData.write$Self(MessageSerializersImpl.kt)
at net.mamoe.mirai.internal.message.MessageSourceSerializerImpl$SerialData$$serializer.serialize(MessageSerializ
ersImpl.kt) at net.mamoe.mirai.internal.message.MessageSourceSerializerImpl$SerialData$$serializer.serialize(MessageSerializ ersImpl.kt:59) at net.mamoe.mirai.internal.message.MessageSourceSerializerImpl$$special$$inlined$map$1.serialize(MessageSeriali zersImpl.kt:234) at net.mamoe.mirai.internal.message.MessageSourceSerializerImpl.serialize(MessageSerializersImpl.kt) at net.mamoe.mirai.internal.message.MessageSourceSerializerImpl.serialize(MessageSerializersImpl.kt:45) at kotlinx.serialization.json.internal.StreamingJsonEncoder.encodeSerializableValue(StreamingJsonEncoder.kt:228)
at kotlinx.serialization.encoding.AbstractEncoder.encodeSerializableElement(AbstractEncoder.kt:71)
at kotlinx.serialization.internal.ListLikeSerializer.serialize(CollectionSerializers.kt:69)
at net.mamoe.mirai.message.data.MessageChain$Serializer.serialize(MessageChain.kt:251)
at net.mamoe.mirai.message.data.MessageChain$Serializer.serialize(MessageChain.kt:246)
at kotlinx.serialization.json.internal.StreamingJsonEncoder.encodeSerializableValue(StreamingJsonEncoder.kt:223)
at kotlinx.serialization.json.Json.encodeToString(Json.kt:73)
at net.mamoe.mirai.message.data.MessageChain$Companion.serializeToJsonString(MessageChain.kt:303)
at net.mamoe.mirai.message.data.MessageChain$Companion.serializeToJsonString$default(MessageChain.kt:302)
at com.github.yyuueexxiinngg.onebot.util.DatabaseUtilsKt.saveMessageToDB(DatabaseUtils.kt:25)
at com.github.yyuueexxiinngg.onebot.PluginBase$onEnable$2.invokeSuspend(PluginBase.kt:140)
at com.github.yyuueexxiinngg.onebot.PluginBase$onEnable$2.invoke(PluginBase.kt)
at net.mamoe.mirai.event.EventChannel$subscribeAlways$1.invokeSuspend(EventChannel.kt:431)
at net.mamoe.mirai.event.EventChannel$subscribeAlways$1.invoke(EventChannel.kt)
at net.mamoe.mirai.internal.event.Handler$onEvent$2.invokeSuspend(InternalEventListeners.kt:49)
at net.mamoe.mirai.internal.event.Handler$onEvent$2.invoke(InternalEventListeners.kt)
at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:91)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:165)
at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
at net.mamoe.mirai.internal.event.Handler.onEvent(InternalEventListeners.kt:49)
at net.mamoe.mirai.event.EventKt.broadcast(Event.kt:226)
at net.mamoe.mirai.internal.network.handler.QQAndroidBotNetworkHandler$handlePacket$7.invokeSuspend(QQAndroidBot
NetworkHandler.kt:554) at net.mamoe.mirai.internal.network.handler.QQAndroidBotNetworkHandler$handlePacket$7.invoke(QQAndroidBotNetwork Handler.kt) at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:91) at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:165) at kotlinx.coroutines.BuildersKt.withContext(Unknown Source) at net.mamoe.mirai.internal.network.handler.QQAndroidBotNetworkHandler.handlePacket(QQAndroidBotNetworkHandler.k t:547) at net.mamoe.mirai.internal.network.handler.QQAndroidBotNetworkHandler$generifiedParsePacket$2.invokeSuspend(QQA ndroidBotNetworkHandler.kt:504) at net.mamoe.mirai.internal.network.handler.QQAndroidBotNetworkHandler$generifiedParsePacket$2.invoke(QQAndroidB otNetworkHandler.kt) at net.mamoe.mirai.internal.network.protocol.packet.KnownPacketFactories.handleIncomingPacket$mirai_core(PacketF actory.kt:289) at net.mamoe.mirai.internal.network.protocol.packet.KnownPacketFactories$handleIncomingPacket$1.invokeSuspend(Pa cketFactory.kt) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:188) at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:144) at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:15) at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:90) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:188) at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:144) at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:15) at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:90) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:188) at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:144) at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:15) at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:90) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:188) at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:144) at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:15) at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:90) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665) `
看起来是kotlin-serialization的方法又变了 有空改一下
我遇到了同样的问题
看看我的PR,构建一下,应该能解决问题
会有另一个报错 ` 2021-03-04 11:07:50 E/OneBot: Exception in coroutine Plugin OneBot of OneBot kotlinx.serialization.SerializationException: Class 'ForwardMessageInternal' is not registered for polymorphic serializa tion in the scope of 'SingleMessage'. Mark the base class as 'sealed' or register the serializer explicitly. at kotlinx.serialization.internal.AbstractPolymorphicSerializerKt.throwSubtypeNotRegistered(AbstractPolymorphicS erializer.kt:103) at kotlinx.serialization.internal.AbstractPolymorphicSerializerKt.throwSubtypeNotRegistered(AbstractPolymorphicS erializer.kt:113) at kotlinx.serialization.PolymorphicSerializerKt.findPolymorphicSerializer(PolymorphicSerializer.kt:96) at kotlinx.serialization.json.internal.PolymorphicKt.findActualSerializer(Polymorphic.kt:29) at kotlinx.serialization.json.internal.PolymorphicKt.access$findActualSerializer(Polymorphic.kt:1) at kotlinx.serialization.json.internal.StreamingJsonEncoder.encodeSerializableValue(StreamingJsonEncoder.kt:226)
你的这个看起来更像是mirai本身的问题,往mirai那里报吧, 另外,多行代码需要三个点才能包住,```
兼容性问题,建议直接用onebot-korlin,内置mirai的版本,可以解决这个问题
大佬onebot-mirai-0.3.4-all也出现了这个问题,有办法更新一下mirai版本吗
使用的最新版本,遇到了同样的问题
使用的最新版本,遇到了同样的问题
我在.\mirai\data\com.github.yyuueexxiinngg.onebot下放了个叫做image的空文件直接不给他缓存了
发送的消息文本中有网络图片链接,类似于
"[CQ:image,file=https://github.com/howmanybots/onebot/raw/master/assets/logo-256.png]"
第一次发送时
但是之后如果再次发送同样的消息的话,就会出现如下bug
=====================================================================
复现
在图片第一次发送完成后,再次发送同一张图片
我使用的是nodejs,相关代码如下
在我这里,以上代码报错的是
版本
onebot-
kotlin
-0.3.4
mirai-core-
2.4.0
mirai-console-
2.4.0