From b9a4b07db57b5dbcd8aece445c6abc0147c51797 Mon Sep 17 00:00:00 2001 From: Jeroen Benckhuijsen Date: Mon, 17 Aug 2026 21:13:25 +0200 Subject: [PATCH 1/2] Add GraalVM native-image support to azure-core-http-jdk-httpclient --- sdk/core/azure-core-http-jdk-httpclient/CHANGELOG.md | 2 ++ .../native-image.properties | 1 + .../azure-core-http-jdk-httpclient/reflect-config.json | 8 ++++++++ 3 files changed, 11 insertions(+) create mode 100644 sdk/core/azure-core-http-jdk-httpclient/src/main/resources/META-INF/native-image/com.azure/azure-core-http-jdk-httpclient/native-image.properties create mode 100644 sdk/core/azure-core-http-jdk-httpclient/src/main/resources/META-INF/native-image/com.azure/azure-core-http-jdk-httpclient/reflect-config.json diff --git a/sdk/core/azure-core-http-jdk-httpclient/CHANGELOG.md b/sdk/core/azure-core-http-jdk-httpclient/CHANGELOG.md index 8eb0539dd5fb..a5dc5a923ede 100644 --- a/sdk/core/azure-core-http-jdk-httpclient/CHANGELOG.md +++ b/sdk/core/azure-core-http-jdk-httpclient/CHANGELOG.md @@ -8,6 +8,8 @@ ### Bugs Fixed +- Added GraalVM native-image metadata (`reflect-config.json`, `native-image.properties`) so `JdkHttpClientProvider` is discoverable via `ServiceLoader` and its `GlobalJdkAsyncHttpClient` holder initializes at run time under a native image, mirroring the existing support in `azure-core-http-netty`. Previously, an application built with this module as its `HttpClientProvider` under GraalVM native-image would fail at run time with `IllegalStateException: no default HttpClient provider ... found`. + ### Other Changes ## 1.1.6 (2026-08-12) diff --git a/sdk/core/azure-core-http-jdk-httpclient/src/main/resources/META-INF/native-image/com.azure/azure-core-http-jdk-httpclient/native-image.properties b/sdk/core/azure-core-http-jdk-httpclient/src/main/resources/META-INF/native-image/com.azure/azure-core-http-jdk-httpclient/native-image.properties new file mode 100644 index 000000000000..290e31eb7ef0 --- /dev/null +++ b/sdk/core/azure-core-http-jdk-httpclient/src/main/resources/META-INF/native-image/com.azure/azure-core-http-jdk-httpclient/native-image.properties @@ -0,0 +1 @@ +Args=--initialize-at-run-time=com.azure.core.http.jdk.httpclient.JdkHttpClientProvider$GlobalJdkAsyncHttpClient diff --git a/sdk/core/azure-core-http-jdk-httpclient/src/main/resources/META-INF/native-image/com.azure/azure-core-http-jdk-httpclient/reflect-config.json b/sdk/core/azure-core-http-jdk-httpclient/src/main/resources/META-INF/native-image/com.azure/azure-core-http-jdk-httpclient/reflect-config.json new file mode 100644 index 000000000000..8acfb7c29e70 --- /dev/null +++ b/sdk/core/azure-core-http-jdk-httpclient/src/main/resources/META-INF/native-image/com.azure/azure-core-http-jdk-httpclient/reflect-config.json @@ -0,0 +1,8 @@ +[ + { + "name": "com.azure.core.http.jdk.httpclient.JdkHttpClientProvider", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true + } +] From f32857b8d3a05dd6aad6cf8c10945957bab8a792 Mon Sep 17 00:00:00 2001 From: Jeroen Benckhuijsen Date: Mon, 17 Aug 2026 21:34:41 +0200 Subject: [PATCH 2/2] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- sdk/core/azure-core-http-jdk-httpclient/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/core/azure-core-http-jdk-httpclient/CHANGELOG.md b/sdk/core/azure-core-http-jdk-httpclient/CHANGELOG.md index a5dc5a923ede..f3bcb29cfb4f 100644 --- a/sdk/core/azure-core-http-jdk-httpclient/CHANGELOG.md +++ b/sdk/core/azure-core-http-jdk-httpclient/CHANGELOG.md @@ -8,7 +8,7 @@ ### Bugs Fixed -- Added GraalVM native-image metadata (`reflect-config.json`, `native-image.properties`) so `JdkHttpClientProvider` is discoverable via `ServiceLoader` and its `GlobalJdkAsyncHttpClient` holder initializes at run time under a native image, mirroring the existing support in `azure-core-http-netty`. Previously, an application built with this module as its `HttpClientProvider` under GraalVM native-image would fail at run time with `IllegalStateException: no default HttpClient provider ... found`. +- Added GraalVM native-image metadata (`reflect-config.json`, `native-image.properties`) so `JdkHttpClientProvider` is discoverable via `ServiceLoader` and its `GlobalJdkAsyncHttpClient` holder initializes at run time under a native image, mirroring the existing support in `azure-core-http-netty`. Previously, an application built with this module as its `HttpClientProvider` under GraalVM native-image could fail at run time with an `IllegalStateException` indicating that the default HttpClient provider could not be found on the classpath. ### Other Changes