diff --git a/sdk/core/azure-core-http-jdk-httpclient/CHANGELOG.md b/sdk/core/azure-core-http-jdk-httpclient/CHANGELOG.md index 8eb0539dd5fb..f3bcb29cfb4f 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 could fail at run time with an `IllegalStateException` indicating that the default HttpClient provider could not be found on the classpath. + ### 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 + } +]