Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] Show a relevant error message when trying to use eval with an invalid script enging #1501

Closed
3 tasks done
ramboozer opened this issue Mar 9, 2024 · 2 comments
Labels
Milestone

Comments

@ramboozer
Copy link

ramboozer commented Mar 9, 2024

Bug Description

Eval not working
Version 0.4.0

Steps to Reproduce

DM or in channel
.eval jda.guilds

Expected Result

I expect it to list the servers it in currently in.

Debug Output

`System Properties:
java.version = 20.0.1
java.vm.name = Java HotSpot(TM) 64-Bit Server VM
java.vm.specification.version = 20
java.runtime.name = Java(TM) SE Runtime Environment
java.runtime.version = 20.0.1+9-29
java.specification.version = 20
os.arch = amd64
os.name = Windows 10

JMusicBot Information:
Version = 0.4.0
Owner =
Prefix = .
AltPrefix = null
MaxSeconds = 0
NPImages = false
SongInStatus = true
StayInChannel = true
UseEval = true
UpdateAlerts = true

Dependency Information:
JDA Version = 4.4.1_353
JDA-Utilities Version = 3.0.5
Lavaplayer Version = 727959e9f621fc457b3a5adafcfffb55fdeaa538-SNAPSHOT

Runtime Information:
Total Memory = 40
Used Memory = 23

Discord Information:
ID =
Guilds = 3
Users = 18`

Additional Info

[16:40:19] [ERROR] [JDA]: One of the EventListeners had an uncaught exception
java.lang.NullPointerException: Cannot invoke "javax.script.ScriptEngine.put(String, Object)" because "se" is null
at com.jagrosh.jmusicbot.commands.owner.EvalCmd.execute(EvalCmd.java:46)
at com.jagrosh.jdautilities.command.Command.run(Command.java:323)
at com.jagrosh.jdautilities.command.impl.CommandClientImpl.onMessageReceived(CommandClientImpl.java:557)
at com.jagrosh.jdautilities.command.impl.CommandClientImpl.onEvent(CommandClientImpl.java:445)
at net.dv8tion.jda.api.hooks.InterfacedEventManager.handle(InterfacedEventManager.java:96)
at net.dv8tion.jda.internal.hooks.EventManagerProxy.handleInternally(EventManagerProxy.java:88)
at net.dv8tion.jda.internal.hooks.EventManagerProxy.handle(EventManagerProxy.java:70)
at net.dv8tion.jda.internal.JDAImpl.handleEvent(JDAImpl.java:160)
at net.dv8tion.jda.internal.handle.MessageCreateHandler.handleInternally(MessageCreateHandler.java:123)
at net.dv8tion.jda.internal.handle.SocketHandler.handle(SocketHandler.java:36)
at net.dv8tion.jda.internal.requests.WebSocketClient.onDispatch(WebSocketClient.java:952)
at net.dv8tion.jda.internal.requests.WebSocketClient.onEvent(WebSocketClient.java:839)
at net.dv8tion.jda.internal.requests.WebSocketClient.handleEvent(WebSocketClient.java:817)
at net.dv8tion.jda.internal.requests.WebSocketClient.onBinaryMessage(WebSocketClient.java:991)
at com.neovisionaries.ws.client.ListenerManager.callOnBinaryMessage(ListenerManager.java:385)
at com.neovisionaries.ws.client.ReadingThread.callOnBinaryMessage(ReadingThread.java:276)
at com.neovisionaries.ws.client.ReadingThread.handleBinaryFrame(ReadingThread.java:996)
at com.neovisionaries.ws.client.ReadingThread.handleFrame(ReadingThread.java:755)
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)

Checklist

@jagrosh
Copy link
Owner

jagrosh commented Mar 9, 2024

This is because you're running java version 20, and the script engine we use was removed by that version. Try installing an older version (ideally 11).

@jagrosh jagrosh changed the title [Bug Report] Title Here [Bug Report] Show a relevant error message when trying to use eval with an invalid script enging Mar 11, 2024
@jagrosh
Copy link
Owner

jagrosh commented Mar 11, 2024

Renaming this because a stopgap solution for this is to print an error when attempting to run the eval command instead of only printing a stacktrace to the console.

@jagrosh jagrosh added the bug label Mar 11, 2024
@jagrosh jagrosh added this to the 0.4.1 milestone Mar 15, 2024
@jagrosh jagrosh mentioned this issue Mar 30, 2024
4 tasks
@jagrosh jagrosh closed this as completed May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants