Project: springxd
Issue XD-1738: Stream destroy fails to remove if the underlying modules have been removed.
In short if you attempt to destroy a stream that has had its modules removed, the destroy will fail. 1) So if I create my own processor:x and use the processor in a stream. 2) I then shutdown the admin and container. 3) Delete the processor:x from the $XD_HOME/modules directory 4) Restart the admin and container. 5) if you do a stream list the stream that used the processor.x is still present. 6) but you can not delete the stream because of the exception below. [To Reproduce using Payload Conversion example] 1) Follow the instructions to install and use the myTupleProcessor module in a stream. 2) Now shutdown the admin and container 3) rm -rf $XD_HOME/modules/processor/myTupleProcessor.xml 4) rm -rf $XD_HOME/lib/payload-conversion.jar 5) Startup your admin and container 6) stream all destroy. Then type 'y' 6a) The shell will report ommand failed org.springframework.xd.rest.client.impl.SpringXDException: No content to map due to end-of-input at [Source: java.io.StringReader@5b8bd3d0; line: 1, column: 1] 6b) The Admin Server will report 11:59:43,543 ERROR http-nio-9393-exec-1 rest.RestControllerAdvice:199 - Caught exception while handling a request org.springframework.xd.dirt.zookeeper.ZooKeeperAccessException: No content to map due to end-of-input at [Source: java.io.StringReader@648849d5; line: 1, column: 1] org.springframework.xd.dirt.zookeeper.ZooKeeperUtils.wrapThrowable(ZooKeeperUtils.java:47) org.springframework.xd.dirt.zookeeper.ZooKeeperUtils.wrapThrowable(ZooKeeperUtils.java:31) org.springframework.xd.dirt.zookeeper.ZooKeeperUtils.wrapAndThrowIgnoring(ZooKeeperUtils.java:65) org.springframework.xd.dirt.module.store.ZooKeeperModuleDefinitionRepository.findByNameAndType(ZooKeeperModuleDefinitionRepository.java:95) org.springframework.xd.dirt.stream.XDStreamParser.resolveModuleType(XDStreamParser.java:300) org.springframework.xd.dirt.stream.XDStreamParser.determineType(XDStreamParser.java:196) org.springframework.xd.dirt.stream.XDStreamParser.parse(XDStreamParser.java:152) org.springframework.xd.dirt.stream.StreamDeployer.beforeDelete(StreamDeployer.java:116) org.springframework.xd.dirt.stream.StreamDeployer.beforeDelete(StreamDeployer.java:43) org.springframework.xd.dirt.stream.AbstractDeployer.delete(AbstractDeployer.java:246) org.springframework.xd.dirt.stream.AbstractDeployer.deleteAll(AbstractDeployer.java:169) org.springframework.xd.dirt.stream.AbstractInstancePersistingDeployer.deleteAll(AbstractInstancePersistingDeployer.java:100) org.springframework.xd.dirt.rest.XDController.deleteAll(XDController.java:110) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:606) org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215) org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749) org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689) org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961) org.springframework.web.servlet.FrameworkServlet.doDelete(FrameworkServlet.java:885) javax.servlet.http.HttpServlet.service(HttpServlet.java:653) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837) javax.servlet.http.HttpServlet.service(HttpServlet.java:728) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilter(WebRequestTraceFilter.java:115) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration$ApplicationContextFilterConfiguration$1.doFilterInternal(EndpointWebMvcAutoConfiguration.java:137) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) org.springframework.boot.actuate.autoconfigure.MetricFilterAutoConfiguration$MetricsFilter.doFilterInternal(MetricFilterAutoConfiguration.java:85) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:680) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004) org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1680) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) java.lang.Thread.run(Thread.java:724) Caused by: com.fasterxml.jackson.databind.JsonMappingException: No content to map due to end-of-input at [Source: java.io.StringReader@648849d5; line: 1, column: 1] com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:164) com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:3036) com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:2978) com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2098) org.springframework.xd.dirt.module.store.ZooKeeperModuleDefinitionRepository.findByNameAndType(ZooKeeperModuleDefinitionRepository.java:82)	... 61 more
Story points: 5