gpt4 book ai didi

java - 如何修复java中的NoSuchMethodError

转载 作者:行者123 更新时间:2023-12-02 06:24:49 25 4
gpt4 key购买 nike

我正在尝试运行 JDA Discord Bot,但收到此错误:

[JDA MainWS-ReadThread] INFO net.dv8tion.jda.core.requests.WebSocketClient - Connected to WebSocket
[JDA MainWS-ReadThread] ERROR net.dv8tion.jda.core.requests.WebSocketClient - There was an error in the WebSocket connection
java.lang.NoSuchMethodError: org.json.JSONArray.iterator()Ljava/util/Iterator;
at net.dv8tion.jda.core.requests.WebSocketClient.updateTraces(WebSocketClient.java:165)
at net.dv8tion.jda.core.requests.WebSocketClient.onEvent(WebSocketClient.java:797)
at net.dv8tion.jda.core.requests.WebSocketClient.handleEvent(WebSocketClient.java:745)
at net.dv8tion.jda.core.requests.WebSocketClient.onBinaryMessage(WebSocketClient.java:903)
at com.neovisionaries.ws.client.ListenerManager.callOnBinaryMessage(ListenerManager.java:368)
at com.neovisionaries.ws.client.ReadingThread.callOnBinaryMessage(ReadingThread.java:270)
at com.neovisionaries.ws.client.ReadingThread.handleBinaryFrame(ReadingThread.java:990)
at com.neovisionaries.ws.client.ReadingThread.handleFrame(ReadingThread.java:749)
at com.neovisionaries.ws.client.ReadingThread.main(ReadingThread.java:108)
at com.neovisionaries.ws.client.ReadingThread.runMain(ReadingThread.java:64)
at com.neovisionaries.ws.client.WebSocketThread.run(WebSocketThread.java:45)

我找不到问题所在,

我已经在 J​​DA GitHub 上询问过,但他们说我必须获取我已经拥有的最新 org.json。所以我很困惑。

希望有人能帮助我。

最佳答案

事实上,org.json.JSONArray.iterator()从一开始就不存在,但是was added later .

您的pom.xml看起来不错,但是引用库中有json-simple-1.1.1 .jar 而不是 json-20180813.jar

右键单击项目并选择Maven > 更新项目...

关于java - 如何修复java中的NoSuchMethodError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55798564/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com