Project: springxd
Issue XD-1938: Shell completion crashes
The XD shell completion crashes on: job launch --name gives {noformat} xd:>job launch --name Exception in thread "Spring Shell" java.lang.IllegalStateException: Could not determine kind: tab-completion-count-1 existing-job disable-string-converter org.springframework.xd.shell.converter.CompletionConverter.determineKind(CompletionConverter.java:109) org.springframework.xd.shell.converter.CompletionConverter.getAllPossibleValues(CompletionConverter.java:69) org.springframework.shell.core.SimpleParser.completeAdvanced(SimpleParser.java:857) org.springframework.shell.core.ParserCompleter.complete(ParserCompleter.java:47) jline.console.ConsoleReader.complete(ConsoleReader.java:3077) jline.console.ConsoleReader.readLine(ConsoleReader.java:2501) jline.console.ConsoleReader.readLine(ConsoleReader.java:2162) jline.console.ConsoleReader.readLine(ConsoleReader.java:2150) org.springframework.shell.core.JLineShell.promptLoop(JLineShell.java:522) org.springframework.shell.core.JLineShell.run(JLineShell.java:179) java.lang.Thread.run(Thread.java:744) {noformat} Moreover, seems completion generally crashes when the server is not up (which was taken care of previously if I'm not mistaken): xd:>job destroy --name {noformat} Exception in thread "Spring Shell" org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://localhost:9393/jobs/definitions?size=10000&deployments=true":Connection refused; nested exception is java.net.ConnectException: Connection refused org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:561) org.springframework.web.client.RestTemplate.execute(RestTemplate.java:506) org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:243) org.springframework.xd.rest.client.impl.JobTemplate.list(JobTemplate.java:121) org.springframework.xd.rest.client.impl.JobTemplate.list(JobTemplate.java:40) org.springframework.xd.shell.converter.ExistingXDEntityConverter.getAllPossibleValues(ExistingXDEntityConverter.java:72) org.springframework.shell.core.SimpleParser.completeAdvanced(SimpleParser.java:857) org.springframework.shell.core.ParserCompleter.complete(ParserCompleter.java:47) jline.console.ConsoleReader.complete(ConsoleReader.java:3077) jline.console.ConsoleReader.readLine(ConsoleReader.java:2501) jline.console.ConsoleReader.readLine(ConsoleReader.java:2162) jline.console.ConsoleReader.readLine(ConsoleReader.java:2150) org.springframework.shell.core.JLineShell.promptLoop(JLineShell.java:522) org.springframework.shell.core.JLineShell.run(JLineShell.java:179) java.lang.Thread.run(Thread.java:744) Caused by: java.net.ConnectException: Connection refused java.net.PlainSocketImpl.socketConnect(Native Method) java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) java.net.Socket.connect(Socket.java:579) java.net.Socket.connect(Socket.java:528) sun.net.NetworkClient.doConnect(NetworkClient.java:180) sun.net.www.http.HttpClient.openServer(HttpClient.java:432) sun.net.www.http.HttpClient.openServer(HttpClient.java:527) sun.net.www.http.HttpClient.(HttpClient.java:211) sun.net.www.http.HttpClient.New(HttpClient.java:308) sun.net.www.http.HttpClient.New(HttpClient.java:326) sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:996) sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:932) sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:850) org.springframework.http.client.SimpleBufferingClientHttpRequest.executeInternal(SimpleBufferingClientHttpRequest.java:78) org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:48) org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:52) {noformat}
Story points: 2