WARN org.javacord.core.util.gateway.DiscordWebSocketAdapter连接到websocket {shard = 0}时发生错误

时间:2018-08-05 10:48:31

标签: java raspberry-pi discord raspberry-pi2

我最近开始制造不和谐的机器人。我制作了一个可以在笔记本电脑上完美运行的机器人,但是当我尝试在树莓派上运行它时,它就无法正常工作。这是错误代码。您能告诉我问题是什么以及如何解决吗?

WARN org.javacord.core.util.gateway.DiscordWebSocketAdapter An error occurred while connecting to websocket {shard=0} 
 java.util.concurrent.CompletionException: javax.net.ssl.SSLException: java.lang.IllegalStateException
    at java.util.concurrent.CompletableFuture.reportJoin(CompletableFuture.java:375)
    at java.util.concurrent.CompletableFuture.join(CompletableFuture.java:1934)
    at org.javacord.core.util.gateway.DiscordWebSocketAdapter.getGateway(DiscordWebSocketAdapter.java:241)
    at org.javacord.core.util.gateway.DiscordWebSocketAdapter.connect(DiscordWebSocketAdapter.java:297)
    at org.javacord.core.util.gateway.DiscordWebSocketAdapter.<init>(DiscordWebSocketAdapter.java:176)
    at org.javacord.core.DiscordApiImpl.lambda$new$4(DiscordApiImpl.java:407)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: javax.net.ssl.SSLException: java.lang.IllegalStateException
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
    at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1949)
    at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1906)
    at sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1889)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1410)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
    at okhttp3.internal.connection.RealConnection.connectTls(RealConnection.java:299)
    at okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.java:268)
    at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:160)
    at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:256)
    at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:134)
    at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:113)
    at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
    at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
    at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
    at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:125)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
    at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:212)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
    at org.javacord.core.DiscordApiImpl.lambda$new$1(DiscordApiImpl.java:394)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
    at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)
    at okhttp3.RealCall.execute(RealCall.java:77)
    at org.javacord.core.util.rest.RestRequest.executeBlocking(RestRequest.java:375)
    at org.javacord.core.util.ratelimit.RatelimitManager.lambda$queueRequest$8(RatelimitManager.java:150)
    ... 5 more
Caused by: java.lang.IllegalStateException
    at sun.security.ec.ECDHKeyAgreement.deriveKey(Native Method)
    at sun.security.ec.ECDHKeyAgreement.engineGenerateSecret(ECDHKeyAgreement.java:130)
    at sun.security.ec.ECDHKeyAgreement.engineGenerateSecret(ECDHKeyAgreement.java:163)
    at javax.crypto.KeyAgreement.generateSecret(KeyAgreement.java:648)
    at sun.security.ssl.ECDHCrypt.getAgreedSecret(ECDHCrypt.java:102)
    at sun.security.ssl.ClientHandshaker.serverHelloDone(ClientHandshaker.java:1061)
    at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:348)
    at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1026)
    at sun.security.ssl.Handshaker.process_record(Handshaker.java:961)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1062)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
    ... 33 more

它没有确切提到发生在哪一行,但是我很确定它发生在这里: DiscordApi api =新的DiscordApiBuilder()。setToken(“ has_a_valid_token”).login()。join(); 令牌有效

0 个答案:

没有答案