Description
Deleting an adapter instance under "my adapters" after previously stopping adapter throws an error. Problem is that stopping an adapter already removes the adapter id stored in a RunningAdapterInstances. Delete option also is performed via the stopAdapter() endpoint where the error is thrown.
See: Link to source code
private void stopAdapter(AdapterDescription adapterDescription) throws AdapterException { String elementId = adapterDescription.getElementId(); IAdapter<?> adapter = RunningAdapterInstances.INSTANCE.removeAdapter(elementId); if (adapter == null) { throw new AdapterException("Adapter with id " + elementId + " was not found in this container and cannot be stopped."); } adapter.stopAdapter(); }
streampipes_extensions-all-jvm_1 | 11:17:31.453 SP [XNIO-1 task-2] ERROR o.a.s.c.c.w.r.AdapterWorkerResource - Error while stopping adapter with id urn:streampipes.apache.org:spi:org.apache.streampipes.connect.iiot.adapters.simulator.machine:3e308fee-a75a-4feb-9b2f-76f304a9fcdf streampipes_extensions-all-jvm_1 | org.apache.streampipes.connect.api.exception.AdapterException: Adapter with id urn:streampipes.apache.org:spi:org.apache.streampipes.connect.iiot.adapters.simulator.machine:3e308fee-a75a-4feb-9b2f-76f304a9fcdf was not found in this container and cannot be stopped. streampipes_extensions-all-jvm_1 | at org.apache.streampipes.connect.container.worker.management.AdapterWorkerManagement.stopAdapter(AdapterWorkerManagement.java:84) streampipes_extensions-all-jvm_1 | at org.apache.streampipes.connect.container.worker.management.AdapterWorkerManagement.stopStreamAdapter(AdapterWorkerManagement.java:50) streampipes_extensions-all-jvm_1 | at org.apache.streampipes.connect.container.worker.rest.AdapterWorkerResource.stopStreamAdapter(AdapterWorkerResource.java:86) streampipes_extensions-all-jvm_1 | at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) streampipes_extensions-all-jvm_1 | at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) streampipes_extensions-all-jvm_1 | at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) streampipes_extensions-all-jvm_1 | at java.base/java.lang.reflect.Method.invoke(Unknown Source) streampipes_extensions-all-jvm_1 | at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52) streampipes_extensions-all-jvm_1 | at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:124) streampipes_extensions-all-jvm_1 | at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:167) streampipes_extensions-all-jvm_1 | at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:176) streampipes_extensions-all-jvm_1 | at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:79) streampipes_extensions-all-jvm_1 | at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:475) streampipes_extensions-all-jvm_1 | at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:397) streampipes_extensions-all-jvm_1 | at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:81) streampipes_extensions-all-jvm_1 | at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:255) streampipes_extensions-all-jvm_1 | at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248) streampipes_extensions-all-jvm_1 | at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244) streampipes_extensions-all-jvm_1 | at org.glassfish.jersey.internal.Errors.process(Errors.java:292) streampipes_extensions-all-jvm_1 | at org.glassfish.jersey.internal.Errors.process(Errors.java:274) streampipes_extensions-all-jvm_1 | at org.glassfish.jersey.internal.Errors.process(Errors.java:244) streampipes_extensions-all-jvm_1 | at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265) streampipes_extensions-all-jvm_1 | at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:234) streampipes_extensions-all-jvm_1 | at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:684) streampipes_extensions-all-jvm_1 | at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:394) streampipes_extensions-all-jvm_1 | at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:346) streampipes_extensions-all-jvm_1 | at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:366) streampipes_extensions-all-jvm_1 | at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:319) streampipes_extensions-all-jvm_1 | at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:205) streampipes_extensions-all-jvm_1 | at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74) streampipes_extensions-all-jvm_1 | at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129) streampipes_extensions-all-jvm_1 | at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) streampipes_extensions-all-jvm_1 | at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) streampipes_extensions-all-jvm_1 | at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) streampipes_extensions-all-jvm_1 | at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) streampipes_extensions-all-jvm_1 | at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) streampipes_extensions-all-jvm_1 | at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) streampipes_extensions-all-jvm_1 | at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) streampipes_extensions-all-jvm_1 | at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) streampipes_extensions-all-jvm_1 | at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84) streampipes_extensions-all-jvm_1 | at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) streampipes_extensions-all-jvm_1 | at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68) streampipes_extensions-all-jvm_1 | at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) streampipes_extensions-all-jvm_1 | at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68) streampipes_extensions-all-jvm_1 | at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:117) streampipes_extensions-all-jvm_1 | at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) streampipes_extensions-all-jvm_1 | at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) streampipes_extensions-all-jvm_1 | at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) streampipes_extensions-all-jvm_1 | at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) streampipes_extensions-all-jvm_1 | at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60) streampipes_extensions-all-jvm_1 | at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77) streampipes_extensions-all-jvm_1 | at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43) streampipes_extensions-all-jvm_1 | at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) streampipes_extensions-all-jvm_1 | at io.undertow.servlet.handlers.SendErrorPageHandler.handleRequest(SendErrorPageHandler.java:52) streampipes_extensions-all-jvm_1 | at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) streampipes_extensions-all-jvm_1 | at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:275) streampipes_extensions-all-jvm_1 | at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:79) streampipes_extensions-all-jvm_1 | at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:134) streampipes_extensions-all-jvm_1 | at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:131) streampipes_extensions-all-jvm_1 | at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48) streampipes_extensions-all-jvm_1 | at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) streampipes_extensions-all-jvm_1 | at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:255) streampipes_extensions-all-jvm_1 | at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:79) streampipes_extensions-all-jvm_1 | at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:100) streampipes_extensions-all-jvm_1 | at io.undertow.server.Connectors.executeRootHandler(Connectors.java:387) streampipes_extensions-all-jvm_1 | at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:852) streampipes_extensions-all-jvm_1 | at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35) streampipes_extensions-all-jvm_1 | at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2019) streampipes_extensions-all-jvm_1 | at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1558) streampipes_extensions-all-jvm_1 | at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1449) streampipes_extensions-all-jvm_1 | at org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1280) streampipes_extensions-all-jvm_1 | at java.base/java.lang.Thread.run(Unknown Source)