diff --git a/containers/helidon/src/main/java/org/glassfish/jersey/helidon/HelidonHttpContainerBuilder.java b/containers/helidon/src/main/java/org/glassfish/jersey/helidon/HelidonHttpContainerBuilder.java index c9d1d35ac1..cdb97b8141 100644 --- a/containers/helidon/src/main/java/org/glassfish/jersey/helidon/HelidonHttpContainerBuilder.java +++ b/containers/helidon/src/main/java/org/glassfish/jersey/helidon/HelidonHttpContainerBuilder.java @@ -19,6 +19,7 @@ import io.helidon.common.tls.Tls; import io.helidon.common.tls.TlsConfig; +import io.helidon.config.Config; import io.helidon.webserver.WebServerConfig; import io.helidon.webserver.http.HttpRouting; import jakarta.ws.rs.core.Application; @@ -136,7 +137,8 @@ public Object parentContext() { public HelidonHttpContainer build() { configureBaseUri(); - webServerBuilder.routing(configureRouting()); + webServerBuilder.config(Config.global()) + .routing(configureRouting()); this.tls = configureTls(); if (this.tls != null) { webServerBuilder.tls(this.tls); diff --git a/containers/helidon/src/main/java/org/glassfish/jersey/helidon/HelidonJerseyRoutingService.java b/containers/helidon/src/main/java/org/glassfish/jersey/helidon/HelidonJerseyRoutingService.java index 52e0c5be7d..ef4b82b3bc 100644 --- a/containers/helidon/src/main/java/org/glassfish/jersey/helidon/HelidonJerseyRoutingService.java +++ b/containers/helidon/src/main/java/org/glassfish/jersey/helidon/HelidonJerseyRoutingService.java @@ -73,8 +73,6 @@ class HelidonJerseyRoutingService implements HttpService { private static final System.Logger LOGGER = System.getLogger(HelidonJerseyRoutingService.class.getName()); private static final Type REQUEST_TYPE = (new GenericType>() { }).getType(); private static final Type RESPONSE_TYPE = (new GenericType>() { }).getType(); - private static final Set INJECTION_MANAGERS = Collections.newSetFromMap(new WeakHashMap<>()); - private final HelidonJerseyBridge bridge; private HelidonJerseyRoutingService(HelidonJerseyBridge bridge) { this.bridge = bridge; @@ -114,16 +112,13 @@ public void routing(HttpRules rules) { @Override public void beforeStart() { appHandler().onStartup(container()); - INJECTION_MANAGERS.add(appHandler().getInjectionManager()); } @Override public void afterStop() { try { final InjectionManager ij = appHandler().getInjectionManager(); - if (INJECTION_MANAGERS.remove(ij)) { - appHandler().onShutdown(bridge.getContainer()); - } + appHandler().onShutdown(bridge.getContainer()); } catch (Exception e) { if (LOGGER.isLoggable(System.Logger.Level.DEBUG)) { LOGGER.log(System.Logger.Level.DEBUG, "Exception during shutdown of Jersey", e); diff --git a/containers/helidon/src/test/java/org/glassfish/jersey/helidon/AbstractHelidonServerTester.java b/containers/helidon/src/test/java/org/glassfish/jersey/helidon/AbstractHelidonServerTester.java index 046c73d117..89fa7bbe03 100644 --- a/containers/helidon/src/test/java/org/glassfish/jersey/helidon/AbstractHelidonServerTester.java +++ b/containers/helidon/src/test/java/org/glassfish/jersey/helidon/AbstractHelidonServerTester.java @@ -41,7 +41,6 @@ public abstract class AbstractHelidonServerTester { */ protected final int getPort() { if (server != null) { - System.out.println(server.port()); return server.port(); } diff --git a/test-framework/providers/helidon-http/src/test/java/org/glassfish/jersey/test/helidon/AvailablePortHelidonTest.java b/test-framework/providers/helidon-http/src/test/java/org/glassfish/jersey/test/helidon/AvailablePortHelidonTest.java index e7bdb0eebc..a362cbf30c 100644 --- a/test-framework/providers/helidon-http/src/test/java/org/glassfish/jersey/test/helidon/AvailablePortHelidonTest.java +++ b/test-framework/providers/helidon-http/src/test/java/org/glassfish/jersey/test/helidon/AvailablePortHelidonTest.java @@ -51,7 +51,7 @@ public String get() { @Override protected DeploymentContext configureDeployment() { - forceSet(TestProperties.CONTAINER_PORT, "8080"); + forceSet(TestProperties.CONTAINER_PORT, "-1"); //Default not defined port in Helidon is -1 return DeploymentContext.builder(new ResourceConfig(TestResource.class)).build(); }