This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch camel-4.18.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-4.18.x by this push:
     new 4cfb582c1e10 camel-salesforce: Fix NPE in maven plugin codegen due to 
missing worker pool (#24141)
4cfb582c1e10 is described below

commit 4cfb582c1e108e31bc2d9d9aa998fc0d5ba2418a
Author: Salvatore Mongiardo <[email protected]>
AuthorDate: Fri Jun 19 20:07:39 2026 +0200

    camel-salesforce: Fix NPE in maven plugin codegen due to missing worker 
pool (#24141)
    
    AbstractSalesforceExecution.createHttpClient() used the test-only
    SalesforceHttpClient(SslContextFactory.Client) constructor which sets
    workerPool to null. When AbstractClientBase.onComplete() calls
    httpClient.getWorkerPool().execute(), this causes a NullPointerException.
    
    The NPE is swallowed by Jetty's response handling, so the callback never
    fires and the plugin times out with "Timeout waiting for getGlobalObjects".
    
    Fix: use the production 3-arg constructor that accepts CamelContext and
    ExecutorService, matching what SalesforceComponent.createHttpClient() does.
    The pool is automatically cleaned up by SalesforceHttpClient.doStop().
---
 .../component/salesforce/codegen/AbstractSalesforceExecution.java    | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/components/camel-salesforce/camel-salesforce-codegen/src/main/java/org/apache/camel/component/salesforce/codegen/AbstractSalesforceExecution.java
 
b/components/camel-salesforce/camel-salesforce-codegen/src/main/java/org/apache/camel/component/salesforce/codegen/AbstractSalesforceExecution.java
index d770ba9fa661..043e09e5a35f 100644
--- 
a/components/camel-salesforce/camel-salesforce-codegen/src/main/java/org/apache/camel/component/salesforce/codegen/AbstractSalesforceExecution.java
+++ 
b/components/camel-salesforce/camel-salesforce-codegen/src/main/java/org/apache/camel/component/salesforce/codegen/AbstractSalesforceExecution.java
@@ -22,6 +22,7 @@ import java.security.GeneralSecurityException;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
+import java.util.concurrent.ExecutorService;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.component.salesforce.SalesforceHttpClient;
@@ -245,7 +246,9 @@ public abstract class AbstractSalesforceExecution {
 
             SecurityUtils.adaptToIBMCipherNames(sslContextFactory);
 
-            httpClient = new SalesforceHttpClient(sslContextFactory);
+            ExecutorService workerPool = 
camelContext.getExecutorServiceManager()
+                    .newSingleThreadExecutor(this, "SalesforceHttpClient");
+            httpClient = new SalesforceHttpClient(camelContext, workerPool, 
sslContextFactory);
         } catch (GeneralSecurityException | IOException e) {
             throw new RuntimeException("Error creating default SSL context: " 
+ e.getMessage(), e);
         }

Reply via email to