fleet-amiya 阿米娅插件
-
-
-
2021-12-03 15:32:03 W/hundun.fleet.amiya: updateAndGetTopBlog but no userInfoCacahe: 6279793937
2021-12-03 15:32:03 W/hundun.fleet.amiya: updateAndGetTopBlog but no userInfoCacahe: 6441489862
2021-12-03 15:32:03 W/hundun.fleet.amiya: updateAndGetTopBlog but no userInfoCacahe: 7499841383
好像推送微博功能出了点问题 -
使用说明里写漏了,晚点补上。
【指令】更新订阅数据
第一次启用该插件,或修改
WeiboConfig.json
添加了新的微博uid后需要执行一次。在miral-console内执行该指令即可。特别的,该指令只有第一套的格式:
-> /阿米娅WeiboFunction 刷新微博订阅
<- 已刷新 -
@hundun000 谢谢大佬
-
2021-12-04 11:59:19 E/hundun.fleet.amiya: com.fasterxml.jackson.databind.JsonMappingException: Invalid UTF-8 start byte 0xbc
at [Source: (File); line: 4, column: 26] (through reference chain: java.util.concurrent.ConcurrentHashMap["7499841383"]->hundun.miraifleet.framework.starter.botlogic.function.weibo.domain.WeiboUserInfoCache["screenName"])
com.fasterxml.jackson.databind.JsonMappingException: Invalid UTF-8 start byte 0xbc
at [Source: (File); line: 4, column: 26] (through reference chain: java.util.concurrent.ConcurrentHashMap["7499841383"]->hundun.miraifleet.framework.starter.botlogic.function.weibo.domain.WeiboUserInfoCache["screenName"])
at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:390)
at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:349)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.wrapAndThrow(BeanDeserializerBase.java:1822)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:326)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:187)
at com.fasterxml.jackson.databind.deser.std.MapDeserializer._readAndBindStringKeyMap(MapDeserializer.java:609)
at com.fasterxml.jackson.databind.deser.std.MapDeserializer.deserialize(MapDeserializer.java:437)
at com.fasterxml.jackson.databind.deser.std.MapDeserializer.deserialize(MapDeserializer.java:32)
at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:322)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4593)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3453)
at hundun.miraifleet.framework.core.helper.repository.FileRepository.readDataList(FileRepository.java:82)
at hundun.miraifleet.framework.core.helper.repository.FileRepository.<init>(FileRepository.java:55)
at hundun.miraifleet.framework.core.helper.repository.MapDocumentRepository.<init>(MapDocumentRepository.java:35)
at hundun.miraifleet.framework.starter.botlogic.function.weibo.db.WeiboUserInfoCacheRepository.<init>(WeiboUserInfoCacheRepository.java:20)
at hundun.miraifleet.framework.starter.botlogic.function.weibo.WeiboFunction.<init>(WeiboFunction.java:69)
at hundun.miraifleet.arknights.amiya.botlogic.AmiyaBotLogic.<init>(AmiyaBotLogic.java:36)
at hundun.miraifleet.arknights.amiya.AmiyaPlugin.onEnable(AmiyaPlugin.java:34)
at net.mamoe.mirai.console.internal.plugin.JvmPluginInternal.internalOnEnable$mirai_console(JvmPluginInternal.kt:113)
at net.mamoe.mirai.console.internal.plugin.BuiltInJvmPluginLoaderImpl.enable(BuiltInJvmPluginLoaderImpl.kt:122)
at net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader$BuiltIn.enable(JvmPluginLoader.kt)
at net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader$BuiltIn.enable(JvmPluginLoader.kt:36)
at net.mamoe.mirai.console.plugin.PluginManager.enablePlugin(PluginManager.kt:129)
at net.mamoe.mirai.console.internal.plugin.PluginManagerImpl.enableAllLoadedPlugins$mirai_console(PluginManagerImpl.kt:172)
at net.mamoe.mirai.console.internal.MiraiConsoleImplementationBridge.doStart$mirai_console(MiraiConsoleImplementationBridge.kt:214)
at net.mamoe.mirai.console.MiraiConsoleImplementation$Companion.start(MiraiConsoleImplementation.kt:276)
at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon(MiraiConsoleTerminalLoader.kt:152)
at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon$default(MiraiConsoleTerminalLoader.kt:151)
at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.main(MiraiConsoleTerminalLoader.kt:47)
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.bootMirai(Utility.java:83)
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.mozilla.javascript.MemberBox.invoke(MemberBox.java:138)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:226)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1692)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1013)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:412)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3578)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:107)
at org.mozilla.javascript.ArrowFunction.call(ArrowFunction.java:43)
at org.mozilla.javascript.InterfaceAdapter.invokeImpl(InterfaceAdapter.java:155)
at org.mozilla.javascript.InterfaceAdapter.lambda$invoke$0(InterfaceAdapter.java:105)
at org.mozilla.javascript.Context.call(Context.java:554)
at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:522)
at org.mozilla.javascript.InterfaceAdapter.invoke(InterfaceAdapter.java:105)
at org.mozilla.javascript.jdk18.VMBridge_jdk18$1.invoke(VMBridge_jdk18.java:126)
at com.sun.proxy.$Proxy4.run(Unknown Source)
at org.itxtech.mcl.script.ScriptManager.phaseBoot(ScriptManager.java:106)
at org.itxtech.mcl.Loader.lambda$start$3(Loader.java:176)
at org.itxtech.mcl.Loader.tryCatching(Loader.java:145)
at org.itxtech.mcl.Loader.start(Loader.java:176)
at org.itxtech.mcl.Loader.main(Loader.java:68)
Caused by: com.fasterxml.jackson.core.JsonParseException: Invalid UTF-8 start byte 0xbc
at [Source: (File); line: 4, column: 26]
at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:2337)
at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:710)
at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._reportInvalidInitial(UTF8StreamJsonParser.java:3606)
at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._reportInvalidChar(UTF8StreamJsonParser.java:3602)
at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._finishString2(UTF8StreamJsonParser.java:2545)
at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._finishAndReturnString(UTF8StreamJsonParser.java:2471)
at com.fasterxml.jackson.core.json.UTF8StreamJsonParser.getText(UTF8StreamJsonParser.java:302)
at com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:41)
at com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:11)
at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:324)
... 55 more2021-12-04 11:59:19 E/hundun.fleet.amiya: com.fasterxml.jackson.databind.JsonMappingException: Invalid UTF-8 start byte 0xbc
at [Source: (File); line: 7, column: 28] (through reference chain: java.util.concurrent.ConcurrentHashMap["7499841383"]->hundun.miraifleet.framework.starter.botlogic.function.weibo.domain.TopCardInfo["cardCache"]->hundun.miraifleet.framework.starter.botlogic.function.weibo.domain.WeiboCardCache["screenName"])
com.fasterxml.jackson.databind.JsonMappingException: Invalid UTF-8 start byte 0xbc
at [Source: (File); line: 7, column: 28] (through reference chain: java.util.concurrent.ConcurrentHashMap["7499841383"]->hundun.miraifleet.framework.starter.botlogic.function.weibo.domain.TopCardInfo["cardCache"]->hundun.miraifleet.framework.starter.botlogic.function.weibo.domain.WeiboCardCache["screenName"])
at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:390)
at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:349)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.wrapAndThrow(BeanDeserializerBase.java:1822)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:326)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:187)
at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:324)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:187)
at com.fasterxml.jackson.databind.deser.std.MapDeserializer._readAndBindStringKeyMap(MapDeserializer.java:609)
at com.fasterxml.jackson.databind.deser.std.MapDeserializer.deserialize(MapDeserializer.java:437)
at com.fasterxml.jackson.databind.deser.std.MapDeserializer.deserialize(MapDeserializer.java:32)
at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:322)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4593)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3453)
at hundun.miraifleet.framework.core.helper.repository.FileRepository.readDataList(FileRepository.java:82)
at hundun.miraifleet.framework.core.helper.repository.FileRepository.<init>(FileRepository.java:55)
at hundun.miraifleet.framework.core.helper.repository.MapDocumentRepository.<init>(MapDocumentRepository.java:35)
at hundun.miraifleet.framework.starter.botlogic.function.weibo.db.TopCardInfoRepository.<init>(TopCardInfoRepository.java:21)
at hundun.miraifleet.framework.starter.botlogic.function.weibo.WeiboFunction.<init>(WeiboFunction.java:70)
at hundun.miraifleet.arknights.amiya.botlogic.AmiyaBotLogic.<init>(AmiyaBotLogic.java:36)
at hundun.miraifleet.arknights.amiya.AmiyaPlugin.onEnable(AmiyaPlugin.java:34)
at net.mamoe.mirai.console.internal.plugin.JvmPluginInternal.internalOnEnable$mirai_console(JvmPluginInternal.kt:113)
at net.mamoe.mirai.console.internal.plugin.BuiltInJvmPluginLoaderImpl.enable(BuiltInJvmPluginLoaderImpl.kt:122)
at net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader$BuiltIn.enable(JvmPluginLoader.kt)
at net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader$BuiltIn.enable(JvmPluginLoader.kt:36)
at net.mamoe.mirai.console.plugin.PluginManager.enablePlugin(PluginManager.kt:129)
at net.mamoe.mirai.console.internal.plugin.PluginManagerImpl.enableAllLoadedPlugins$mirai_console(PluginManagerImpl.kt:172)
at net.mamoe.mirai.console.internal.MiraiConsoleImplementationBridge.doStart$mirai_console(MiraiConsoleImplementationBridge.kt:214)
at net.mamoe.mirai.console.MiraiConsoleImplementation$Companion.start(MiraiConsoleImplementation.kt:276)
at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon(MiraiConsoleTerminalLoader.kt:152)
at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon$default(MiraiConsoleTerminalLoader.kt:151)
at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.main(MiraiConsoleTerminalLoader.kt:47)
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.bootMirai(Utility.java:83)
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.mozilla.javascript.MemberBox.invoke(MemberBox.java:138)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:226)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1692)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1013)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:412)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3578)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:107)
at org.mozilla.javascript.ArrowFunction.call(ArrowFunction.java:43)
at org.mozilla.javascript.InterfaceAdapter.invokeImpl(InterfaceAdapter.java:155)
at org.mozilla.javascript.InterfaceAdapter.lambda$invoke$0(InterfaceAdapter.java:105)
at org.mozilla.javascript.Context.call(Context.java:554)
at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:522)
at org.mozilla.javascript.InterfaceAdapter.invoke(InterfaceAdapter.java:105)
at org.mozilla.javascript.jdk18.VMBridge_jdk18$1.invoke(VMBridge_jdk18.java:126)
at com.sun.proxy.$Proxy4.run(Unknown Source)
at org.itxtech.mcl.script.ScriptManager.phaseBoot(ScriptManager.java:106)
at org.itxtech.mcl.Loader.lambda$start$3(Loader.java:176)
at org.itxtech.mcl.Loader.tryCatching(Loader.java:145)
at org.itxtech.mcl.Loader.start(Loader.java:176)
at org.itxtech.mcl.Loader.main(Loader.java:68)
Caused by: com.fasterxml.jackson.core.JsonParseException: Invalid UTF-8 start byte 0xbc
at [Source: (File); line: 7, column: 28]
at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:2337)
at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:710)
at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._reportInvalidInitial(UTF8StreamJsonParser.java:3606)
at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._reportInvalidChar(UTF8StreamJsonParser.java:3602)
at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._finishString2(UTF8StreamJsonParser.java:2545)
at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._finishAndReturnString(UTF8StreamJsonParser.java:2471)
at com.fasterxml.jackson.core.json.UTF8StreamJsonParser.getText(UTF8StreamJsonParser.java:302)
at com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:41)
at com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:11)
at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:324)
... 58 more二次启动控制台会报这个错
-
@rickyliyiqi 发下这个文件的内容,我看看
data/hundun.fleet.amiya/WeiboFunction/repositories/WeiboUserInfoCacheRepository.json -
{
"7499841383" : {
"uid" : "7499841383",
"screenName" : "泰拉记事社",
"weiboContainerid" : "1076037499841383"
},
"6441489862" : {
"uid" : "6441489862",
"screenName" : "明日方舟朝陇山",
"weiboContainerid" : "1076036441489862"
},
"6279793937" : {
"uid" : "6279793937",
"screenName" : "明日方舟Arknights",
"weiboContainerid" : "1076036279793937"
}
} -
@hundun000 {
"7499841383" : {
"uid" : "7499841383",
"screenName" : "泰拉记事社",
"weiboContainerid" : "1076037499841383"
},
"6441489862" : {
"uid" : "6441489862",
"screenName" : "明日方舟朝陇山",
"weiboContainerid" : "1076036441489862"
},
"6279793937" : {
"uid" : "6279793937",
"screenName" : "明日方舟Arknights",
"weiboContainerid" : "1076036279793937"
}
} -
此回复已被删除! -
@rickyliyiqi
你的WeiboUserInfoCacheRepository.json看起来正常。这就怪了,我自己不论是在windows上测试,还是长期运行在linux上的,也是同样的订阅内容,都没有这个问题。以下求助万能的坛友:
-
上述的报错结合读取的文件来看,
TopCardInfoRepository.json [Source: (File); line: 7, column: 28]
和WeiboUserInfoCacheRepository.json[Source: (File); line: 4, column: 26]
都恰好是“泰拉记事社”的社
和"
之间,我想不到为什么这个位置会出现“Invalid UTF-8 start byte 0xbc”。 -
TopCardInfoRepository和WeiboUserInfoCacheRepository这两个类,序列化和反序列化都是使用同一个
com.fasterxml.jackson.databind.ObjectMapper
实例,该ObjectMapper实例应该是使用默认的utf-8编码,现在序列化时正常,反序列化出错,有什么可能的原因吗?
-
-
@rickyliyiqi 问下你那的“整点报时”功能正常吗?
因为整点报时读取配置时也是相同实现,ObjectMapper反序列化HourlyChatConfig.json,里面也有中文。 -
@hundun000 这个json我看不是utf-8的是ANSI的
-
@hundun000 正常的
-
@rickyliyiqi 在 fleet-amiya 阿米娅插件 中说:
@hundun000 这个json我看不是utf-8的是ANSI的
指的是WeiboUserInfoCacheRepository.json
-
@hundun000 我把文件改成utf-8的格式就不会报错了,可能是在weibofunction 刷新微博订阅时保存的格式忘记设置了。
-
@hundun000 TopCardInfoRepository.json不改成utf-8也会报错
-
@rickyliyiqi 嗯,所有由插件写出的文件,都会报错。
我看到代码里的具体原因了。不是忘设置了,是我以为只需要关注ObjectMapper,而jsonString.getBytes()时没指定编码。
晚点我改了更新一版。
-
@hundun000 谢谢大佬
-
@rickyliyiqi 新版发布在github了
-
@hundun000 谢谢
-