discord-jda / JDA

Java wrapper for the popular chat & VOIP service: Discord https://discord.com
Apache License 2.0
4.33k stars 735 forks source link

java.lang.NoClassDefFoundError: net/dv8tion/jda/core/exceptions/RateLimitedException #529

Closed BL19 closed 7 years ago

BL19 commented 7 years ago

I am "trying" to write a small discord bot. But when i try to run it i get

java.lang.NoClassDefFoundError: net/dv8tion/jda/core/exceptions/RateLimitedException
Caused by: java.lang.ClassNotFoundException: net.dv8tion.jda.core.exceptions.RateLimitedException
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_131]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:101) ~[spigot.jar:git-Spigot-596221b-9a1fc1e]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86) ~[spigot.jar:git-Spigot-596221b-9a1fc1e]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_131]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_131]
        ... 17 more

i cant figure out what the problem is..

kantenkugel commented 7 years ago

Run a built jar? If so, you are not properly exporting the dependencies (eg JDA) into the jar file

BL19 commented 7 years ago

Should I do a "JAR file" or "Runnable JAR file"?

kantenkugel commented 7 years ago

Runnable if you don't want to specify the Main class every time you run the jar via console.

Take a look at some examples online on how to shade/include the dependencies into the jar

BL19 commented 7 years ago

How do I do if id like it to run in a bukkit/spigot plugin?

kantenkugel commented 7 years ago

Then you probably don't have a main class and therefor no need for runnable jar.

Including dependencies in jar is still the same and required

BL19 commented 7 years ago

I dont get the error if i run it as a runnable (not a bukkit/spigot plugin)

BL19 commented 7 years ago

Does JDA support discord categorys?

BL19 commented 7 years ago
[Info] [JDA]: Login Successful!
 [Info] [JDASocket]: Connected to WebSocket
 [Fatal] [JDASocket]: Received a channel for a guild that isn't a text or voice channel. JSON: {"permission_overwrites":[],"name":"Text Channels","bitrate":64000,"position":0,"id":"370193911794237441","user_limit":0,"type":4}
 [Fatal] [JDASocket]: Received a channel for a guild that isn't a text or voice channel. JSON: {"permission_overwrites":[],"name":"Voice Channels","bitrate":64000,"position":0,"id":"370193911794237443","user_limit":0,"type":4}
[15:52:28] [Fatal] [JDASocket]: Received a channel for a guild that isn't a text or voice channel (ChannelPass). JSON: {"permission_overwrites":[],"name":"Text Channels","bitrate":64000,"position":0,"id":"370193911794237441","user_limit":0,"type":4}
 [Fatal] [JDASocket]: Encountered an exception:
 [Fatal] [JDASocket]: java.lang.RuntimeException: Got permission_override for unknown channel with id: 370193911794237441
    at net.dv8tion.jda.core.entities.EntityBuilder.createGuildChannelPass(EntityBuilder.java:394)
    at net.dv8tion.jda.core.entities.EntityBuilder.createGuildFirstPass(EntityBuilder.java:281)
    at net.dv8tion.jda.core.handle.GuildCreateHandler.handleInternally(GuildCreateHandler.java:39)
    at net.dv8tion.jda.core.handle.SocketHandler.handle(SocketHandler.java:38)
    at net.dv8tion.jda.core.requests.WebSocketClient.handleEvent(WebSocketClient.java:770)
    at net.dv8tion.jda.core.requests.WebSocketClient.onTextMessage(WebSocketClient.java:500)
    at net.dv8tion.jda.core.requests.WebSocketClient.onBinaryMessage(WebSocketClient.java:803)
    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

Well..

kantenkugel commented 7 years ago

Update to the latest JDA version. You can find the version at the top of the readme, on bintray and in our CI

Almighty-Alpaca commented 7 years ago

First of all, pls use code blocks (I just did that for you). Second, yes. Update.

kantenkugel commented 7 years ago

@Almighty-Alpaca did you add codeblock for him? don't see it

Almighty-Alpaca commented 7 years ago

Github won't let me... > The content you are editing has changed. Please try again.

edit: worked now

kantenkugel commented 7 years ago

the initial message? cuz i changed that 15mins ago

Almighty-Alpaca commented 7 years ago

was talking about the one right above my first message in this conversation

MinnDevelopment commented 7 years ago

Please join our discord server for questions like these.