diff --git a/src/main/java/com/atomgraph/linkeddatahub/Application.java b/src/main/java/com/atomgraph/linkeddatahub/Application.java index 45f13d90c..75c2177c6 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/Application.java +++ b/src/main/java/com/atomgraph/linkeddatahub/Application.java @@ -172,6 +172,7 @@ import com.github.jsonldjava.core.DocumentLoader; import com.github.jsonldjava.core.JsonLdOptions; import jakarta.inject.Inject; +import jakarta.inject.Named; import java.io.FileOutputStream; import java.io.UnsupportedEncodingException; import java.nio.charset.StandardCharsets; @@ -237,6 +238,7 @@ import org.glassfish.jersey.client.RequestEntityProcessing; import org.glassfish.jersey.media.multipart.MultiPartFeature; import org.glassfish.jersey.process.internal.RequestScoped; +import org.glassfish.jersey.server.BackgroundScheduler; import org.glassfish.jersey.server.ResourceConfig; import org.glassfish.jersey.server.filter.HttpMethodOverrideFilter; @@ -252,7 +254,7 @@ public class Application extends ResourceConfig private static final Logger log = LoggerFactory.getLogger(Application.class); - private @Inject ScheduledExecutorService idleConnectionMonitor; + private @Inject @BackgroundScheduler @Named("jersey-background-task-scheduler") ScheduledExecutorService idleConnectionMonitor; private final ExecutorService importThreadPool; private final ServletConfig servletConfig; private final EventBus eventBus = new EventBus(); @@ -1494,7 +1496,7 @@ public void releaseConnection(final HttpClientConnection managedConn, final Obje config.property(ClientProperties.FOLLOW_REDIRECTS, true); config.property(ClientProperties.REQUEST_ENTITY_PROCESSING, RequestEntityProcessing.BUFFERED); // https://stackoverflow.com/questions/42139436/jersey-client-throws-cannot-retry-request-with-a-non-repeatable-request-entity config.property(ApacheClientProperties.CONNECTION_MANAGER, conman); - + return ClientBuilder.newBuilder(). withConfig(config). sslContext(ctx).