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

:quit causes RuntimeException #117

Open
gyscos opened this issue Mar 1, 2017 · 1 comment
Open

:quit causes RuntimeException #117

gyscos opened this issue Mar 1, 2017 · 1 comment

Comments

@gyscos
Copy link

gyscos commented Mar 1, 2017

Exits with return code 1:

$ java -jar build/libs/javarepl-dev.jar
Welcome to JavaREPL version dev (OpenJDK 64-Bit Server VM, Java 1.8.0_121)
Type expression to evaluate, :help for more options or press tab to auto-complete.
Connected to local instance at http://localhost:38214
java> :quit
Exception in thread "main" java.lang.RuntimeException: { expected, j encountered.
	at javarepl.internal.totallylazy.parser.Failure.exception(Failure.java:76)
	at javarepl.internal.totallylazy.parser.Failure.value(Failure.java:72)
	at javarepl.internal.totallylazy.json.Json.map(Json.java:20)
	at javarepl.client.JavaREPLClient.execute(JavaREPLClient.java:72)
	at javarepl.Main.main(Main.java:66)

Terminating...
1 $

Note: Ctrl-D also exits the shell, but without the exception.

@gyscos
Copy link
Author

gyscos commented May 8, 2017

Seems to be because the client receives the following response instead of valid JSON:

java.net.ConnectException: Connection refused (Connection refused)
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
	at java.net.Socket.connect(Socket.java:589)
	at sun.net.NetworkClient.doConnect(NetworkClient.java:175)
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
	at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:781)
	at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:647)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1569)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
	at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
	at javarepl.internal.utterlyidle.Status.status(Status.java:81)
	at javarepl.internal.utterlyidle.handlers.ClientHttpHandler.sendHttpRequest(ClientHttpHandler.java:197)
	at javarepl.internal.utterlyidle.handlers.ClientHttpHandler.handle(ClientHttpHandler.java:178)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at javarepl.internal.totallylazy.reflection.Methods.invoke(Methods.java:91)
	at javarepl.internal.totallylazy.reflection.Methods.lambda$invokeOn$92(Methods.java:98)
	at javarepl.internal.totallylazy.functions.Functions.call(Functions.java:47)
	at javarepl.internal.totallylazy.Callers.call(Callers.java:91)
	at javarepl.internal.totallylazy.Some.map(Some.java:74)
	at javarepl.internal.totallylazy.Dispatcher.invokeOption(Dispatcher.java:71)
	at javarepl.internal.totallylazy.multi.methodOption(multi.java:44)
	at javarepl.internal.utterlyidle.handlers.ClientHttpHandler.handle(ClientHttpHandler.java:145)
	at javarepl.internal.utterlyidle.handlers.ClientHttpHandler.handle(ClientHttpHandler.java:131)
	at javarepl.client.JavaREPLClient.execute(JavaREPLClient.java:67)
	at javarepl.Main.main(Main.java:66)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant