diff --git a/server-common/src/main/java/org/a2aproject/sdk/server/tasks/BasePushNotificationSender.java b/server-common/src/main/java/org/a2aproject/sdk/server/tasks/BasePushNotificationSender.java index 53f1a38d3..b781c5705 100644 --- a/server-common/src/main/java/org/a2aproject/sdk/server/tasks/BasePushNotificationSender.java +++ b/server-common/src/main/java/org/a2aproject/sdk/server/tasks/BasePushNotificationSender.java @@ -56,7 +56,15 @@ protected BasePushNotificationSender() { @Inject public BasePushNotificationSender(PushNotificationConfigStore configStore) { - this.httpClient = A2AHttpClientFactory.create(); + // Make sure the TCCL is one of the platform ones before the ServiceLoader + // in A2AHttpClientFactory's static initializer + ClassLoader originalTccl = Thread.currentThread().getContextClassLoader(); + try { + Thread.currentThread().setContextClassLoader(BasePushNotificationSender.class.getClassLoader()); + this.httpClient = A2AHttpClientFactory.create(); + } finally { + Thread.currentThread().setContextClassLoader(originalTccl); + } this.configStore = configStore; }