@rainchan 我也有此问题,但是一直在下载而不是检测本地,必须手动打开离线构建才可以,否则每重启一次bot大约需要1分钟或者更多时间进行pom下载等操作,不知道具体原因如何。
Orisland 发布的帖子
-
RE: Gradle 总是在每次 build 下载 pom 文件
-
RE: Gradle 总是在每次 build 下载 pom 文件
@peanuuutz 暂时不清楚,我理解为一直在尝试获取版本更新(我关闭梯子后立即构建失败,显示get pom链接错误),但是目前这种方法勉强可以解决,暂时没有思考具体原因。
-
阿里ecs问题导致无法正常访问腾讯的聊天资源服务器,疑似ip被屏蔽
求解原因,本地测试正常通过,但是服务器上会在读取图片时卡在BufferedImage,然后就没了,也没有抛异常也没有任何反应。
根本读不上去,本地端测试没有任何问题,服务器所以图片一律失败,后续消息收发也是正常的,找不到原因,求解。
System.out.println("图片开始处理!"); String url = Image.Key.queryUrl(image); int[] rgb = new int[3]; InputStream inputStream = null; boolean flag = true; int num = 0; do { if (++num > 3){ throw new IOException(); } System.out.println("第"+num+"次尝试!"); try { inputStream = new URL(url).openStream(); flag = false; }catch (Exception e){ e.printStackTrace(); } }while (flag); System.out.println("图片input流获取完成!"); // assert inputStream != null : "错误,inputsteam为空!"; BufferedImage bi = ImageIO.read(inputStream); System.out.println("图片已读取缓冲区。");
-
RE: Gradle 总是在每次 build 下载 pom 文件
@peanuuutz 选择本地构建。
前提是你的本地已经成功进行过一次构建了,新加依赖的时候别忘了打开,否则下载会失败。 -
RE: 上传,发送图片抛出异常?
@karlatemp 没事了,这个图有问题,我本地打得开,但是除了本地其他的都打不开……
另请问,我这么上传图片发送是否比较合适?请问是否有其他更为合适或者常用的方式呢? -
RE: 上传,发送图片抛出异常?
@karlatemp 我尝试使用本地图片就全出错了,可以帮我找找原因吗?采用的url的input流才可以正常工作,但是本地图片是刚需,确定图片可以正常打开。
ExternalResource externalResource = ExternalResource.create(new File("/Users/zhaolong/Downloads/IMG_5785.jpg")); event.getFriend().Companion.sendImage(event.getFriend(), externalResource);
-
RE: 上传,发送图片抛出异常?
然后就变成了神秘的东西,地址打开就是空的,什么都没有。
该网页无法正常运作180.97.117.144 未发送任何数据。 ERR_EMPTY_RESPONSE
-
RE: 上传,发送图片抛出异常?
@karlatemp 在 上传,发送图片抛出异常? 中说:
于是更新版本后就变成了400错误,梯子也关了,但是依然不行。
2021-07-03 21:13:04 E/main: Exception in coroutine <unnamed> net.mamoe.mirai.event.ExceptionInEventHandlerException: Exception in EventHandler at net.mamoe.mirai.internal.event.JvmMethodListenersInternalKt$registerEventHandler$14$1.invoke(JvmMethodListenersInternal.kt:147) at net.mamoe.mirai.internal.event.JvmMethodListenersInternalKt$registerEventHandler$14$2.invokeSuspend(JvmMethodListenersInternal.kt:154) 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.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at net.mamoe.mirai.internal.event.JvmMethodListenersInternalKt$registerEventHandler$14$1.invoke(JvmMethodListenersInternal.kt:140) ... 7 more Caused by: io.ktor.client.features.ClientRequestException: Client request(http://htdata2.qq.com/cgi-bin/httpconn?htcmd=0x6ff0070&uin=2687717861&term=pc&ver=5603&filesize=1815167&range=0&ukey=**********************************************) invalid: 404 Not Found. Text: "" at io.ktor.client.features.DefaultResponseValidationKt$addDefaultResponseValidation$1$1.invokeSuspend(DefaultResponseValidation.kt:39) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at io.ktor.utils.io.internal.CancellableReusableContinuation.resumeWith(CancellableReusableContinuation.kt:93) at io.ktor.utils.io.ByteBufferChannel.resumeReadOp(ByteBufferChannel.kt:2151) at io.ktor.utils.io.ByteBufferChannel.tryTerminate$ktor_io(ByteBufferChannel.kt:408) at io.ktor.utils.io.ByteBufferChannel.close(ByteBufferChannel.kt:155) at io.ktor.utils.io.CoroutinesKt$launchChannel$1.invoke(Coroutines.kt:143) at io.ktor.utils.io.CoroutinesKt$launchChannel$1.invoke(Coroutines.kt) at kotlinx.coroutines.InvokeOnCompletion.invoke(JobSupport.kt:1385) at kotlinx.coroutines.JobSupport.notifyCompletion(JobSupport.kt:1520) at kotlinx.coroutines.JobSupport.completeStateFinalization(JobSupport.kt:323) at kotlinx.coroutines.JobSupport.finalizeFinishingState(JobSupport.kt:240) at kotlinx.coroutines.JobSupport.tryMakeCompletingSlowPath(JobSupport.kt:903) at kotlinx.coroutines.JobSupport.tryMakeCompleting(JobSupport.kt:860) at kotlinx.coroutines.JobSupport.makeCompletingOnce$kotlinx_coroutines_core(JobSupport.kt:825) at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:111) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) ... 5 more Suppressed: java.lang.IllegalStateException: cannot upload private image, failed on all servers. at net.mamoe.mirai.internal.contact.AbstractUser.uploadImage$suspendImpl(AbstractUser.kt:251) at net.mamoe.mirai.internal.contact.AbstractUser$uploadImage$1.invokeSuspend(AbstractUser.kt) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.internal.ScopeCoroutine.afterResume(Scopes.kt:32) at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:113) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:191) at io.ktor.util.pipeline.SuspendFunctionGun.access$resumeRootWith(SuspendFunctionGun.kt:15) at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:86) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:191) at io.ktor.util.pipeline.SuspendFunctionGun.access$resumeRootWith(SuspendFunctionGun.kt:15) at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:86) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:191) at io.ktor.util.pipeline.SuspendFunctionGun.access$resumeRootWith(SuspendFunctionGun.kt:15) at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:86) 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.DispatchedTaskKt.resume(DispatchedTask.kt:178) at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:166) at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:362) at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:396) at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:388) at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:293) at kotlinx.coroutines.ResumeAwaitOnCompletion.invoke(JobSupport.kt:1408) ... 13 more Suppressed: java.lang.IllegalStateException: cannot upload private image, failed on all servers. at net.mamoe.mirai.internal.network.highway.Highway.uploadResourceBdh(Highway.kt:452) at net.mamoe.mirai.internal.network.highway.Highway$uploadResourceBdh$1.invokeSuspend(Highway.kt) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.internal.ScopeCoroutine.afterResume(Scopes.kt:32) at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:113) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith(DispatchedContinuation.kt:266) at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith$default(DispatchedContinuation.kt:263) at kotlinx.coroutines.internal.ScopeCoroutine.afterCompletion(Scopes.kt:27) at kotlinx.coroutines.JobSupport.continueCompleting(JobSupport.kt:933) at kotlinx.coroutines.JobSupport.access$continueCompleting(JobSupport.kt:28) at kotlinx.coroutines.JobSupport$ChildCompletion.invoke(JobSupport.kt:1152) ... 13 more Suppressed: java.lang.IllegalStateException: cannot upload private image, failed on all servers. ... 25 more Suppressed: java.lang.IllegalStateException: cannot upload private image, failed on all servers. ... 25 more Caused by: java.lang.IllegalStateException: highway transfer failed, error 82 at net.mamoe.mirai.internal.network.highway.HighwayKt.sendReceiveHighway(Highway.kt:360) at net.mamoe.mirai.internal.network.highway.HighwayKt$sendReceiveHighway$1.invokeSuspend(Highway.kt) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) ... 5 more Caused by: java.lang.IllegalStateException: highway transfer failed, error 83 at net.mamoe.mirai.internal.network.highway.HighwayKt.sendReceiveHighway(Highway.kt:360) at net.mamoe.mirai.internal.network.highway.HighwayKt$sendReceiveHighway$1.invokeSuspend(Highway.kt) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) ... 5 more Suppressed: java.lang.IllegalStateException: highway transfer failed, error 83 ... 8 more Suppressed: java.lang.IllegalStateException: highway transfer failed, error 83 ... 8 more Suppressed: java.lang.IllegalStateException: highway transfer failed, error 83 ... 8 more Caused by: java.lang.IllegalStateException: highway transfer failed, error 82 at net.mamoe.mirai.internal.network.highway.HighwayKt.sendReceiveHighway(Highway.kt:360) at net.mamoe.mirai.internal.network.highway.HighwayKt$sendReceiveHighway$1.invokeSuspend(Highway.kt) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) ... 5 more Suppressed: java.lang.IllegalStateException: highway transfer failed, error 82 ... 8 more Suppressed: java.lang.IllegalStateException: highway transfer failed, error 82 ... 8 more Suppressed: java.lang.IllegalStateException: highway transfer failed, error 82 ... 8 more Caused by: io.ktor.client.features.ClientRequestException: Client request(http://180.97.117.144:443/cgi-bin/httpconn?htcmd=0x6ff0070&uin=2687717861&term=pc&ver=5603&filesize=1815167&range=0&ukey=**********************************************) invalid: 404 Not Found. Text: "" at io.ktor.client.features.DefaultResponseValidationKt$addDefaultResponseValidation$1$1.invokeSuspend(DefaultResponseValidation.kt:39) at io.ktor.client.features.DefaultResponseValidationKt$addDefaultResponseValidation$1$1.invoke(DefaultResponseValidation.kt) at io.ktor.client.features.HttpCallValidator.validateResponse(HttpCallValidator.kt:54) at io.ktor.client.features.HttpCallValidator$Companion$install$3.invokeSuspend(HttpCallValidator.kt:129) at io.ktor.client.features.HttpCallValidator$Companion$install$3.invoke(HttpCallValidator.kt) at io.ktor.client.features.HttpSend$Feature$install$1.invokeSuspend(HttpSend.kt:99) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) ... 25 more Suppressed: io.ktor.client.features.ClientRequestException: Client request(http://123.150.76.171:80/cgi-bin/httpconn?htcmd=0x6ff0070&uin=2687717861&term=pc&ver=5603&filesize=1815167&range=0&ukey=**********************************************) invalid: 404 Not Found. Text: "" ... 32 more Suppressed: io.ktor.client.features.ClientRequestException: Client request(http://59.36.121.64:8080/cgi-bin/httpconn?htcmd=0x6ff0070&uin=2687717861&term=pc&ver=5603&filesize=1815167&range=0&ukey=**********************************************) invalid: 404 Not Found. Text: "" ... 32 more Suppressed: io.ktor.client.features.ClientRequestException: Client request(http://183.3.233.225:443/cgi-bin/httpconn?htcmd=0x6ff0070&uin=2687717861&term=pc&ver=5603&filesize=1815167&range=0&ukey=**********************************************) invalid: 404 Not Found. Text: "" ... 32 more >
-
上传,发送图片抛出异常?
不太清楚是什么原因导致的。
2021-07-03 20:42:58 E/main: Exception in coroutine <unnamed> net.mamoe.mirai.event.ExceptionInEventHandlerException: Exception in EventHandler at net.mamoe.mirai.internal.event.JvmMethodListenersInternalKt$registerEventHandler$14$1.invoke(JvmMethodListenersInternal.kt:147) at net.mamoe.mirai.internal.event.JvmMethodListenersInternalKt$registerEventHandler$14$2.invokeSuspend(JvmMethodListenersInternal.kt:154) 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.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at net.mamoe.mirai.internal.event.JvmMethodListenersInternalKt$registerEventHandler$14$1.invoke(JvmMethodListenersInternal.kt:140) ... 7 more Caused by: java.lang.IllegalStateException: para error at net.mamoe.mirai.internal.contact.AbstractUser.uploadImage$suspendImpl(AbstractUser.kt:193) at net.mamoe.mirai.internal.contact.AbstractUser$uploadImage$1.invokeSuspend(AbstractUser.kt) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.internal.ScopeCoroutine.afterResume(Scopes.kt:32) at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:113) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:178) at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:166) at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:362) at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:396) at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:388) at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:293) at kotlinx.coroutines.ResumeAwaitOnCompletion.invoke(JobSupport.kt:1408) at kotlinx.coroutines.JobSupport.completeStateFinalization(JobSupport.kt:318) at kotlinx.coroutines.JobSupport.tryFinalizeSimpleState(JobSupport.kt:295) at kotlinx.coroutines.JobSupport.tryMakeCompleting(JobSupport.kt:853) at kotlinx.coroutines.JobSupport.makeCompleting$kotlinx_coroutines_core(JobSupport.kt:803) at kotlinx.coroutines.CompletableDeferredImpl.complete(CompletableDeferred.kt:92) at net.mamoe.mirai.internal.network.handler.QQAndroidBotNetworkHandler$PacketListener.complete(QQAndroidBotNetworkHandler.kt) at net.mamoe.mirai.internal.network.handler.QQAndroidBotNetworkHandler.handlePacket(QQAndroidBotNetworkHandler.kt:635) at net.mamoe.mirai.internal.network.handler.QQAndroidBotNetworkHandler$generifiedParsePacket$2.invokeSuspend(QQAndroidBotNetworkHandler.kt:603) at net.mamoe.mirai.internal.network.handler.QQAndroidBotNetworkHandler$generifiedParsePacket$2.invoke(QQAndroidBotNetworkHandler.kt) at net.mamoe.mirai.internal.network.protocol.packet.KnownPacketFactories.handleIncomingPacket$mirai_core(PacketFactory.kt:284) at net.mamoe.mirai.internal.network.protocol.packet.KnownPacketFactories.parseIncomingPacket(PacketFactory.kt:246) at net.mamoe.mirai.internal.network.handler.QQAndroidBotNetworkHandler.generifiedParsePacket(QQAndroidBotNetworkHandler.kt:594) at net.mamoe.mirai.internal.network.handler.QQAndroidBotNetworkHandler.parsePacket(QQAndroidBotNetworkHandler.kt:589) at net.mamoe.mirai.internal.network.handler.QQAndroidBotNetworkHandler$parsePacketAsync$1.invokeSuspend(QQAndroidBotNetworkHandler.kt:571) ... 6 more >
上传图片的部分代码:
ExternalResource.Companion.uploadAsImage(externalResource, event.getSubject());
我尝试使用sendAsImage方法时会抛出相同错误,不知道原因如何,求教。
-
java版command相关问题
java版的command到底怎么用啊……
照着例子搞了半天,发现一直在缺变量,但是例子里压根就没写
然鹅实际上例子里的变量哪来的我都不知道emmm
初始化给了两个变量根本不行,这个例子给我整傻了……
24K萌新求解。
参考链接