You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2026/06/19 18:07:27 UTC

(camel) branch main updated: camel-salesforce: Fix NPE in maven plugin codegen due to missing worker pool (#24140)

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

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


The following commit(s) were added to refs/heads/main by this push:
     new 1f4fff504175 camel-salesforce: Fix NPE in maven plugin codegen due to missing worker pool (#24140)
1f4fff504175 is described below

commit 1f4fff5041750160539eb196a42ccab7beb74a58
Author: Salvatore Mongiardo <sm...@redhat.com>
AuthorDate: Fri Jun 19 20:07:20 2026 +0200

    camel-salesforce: Fix NPE in maven plugin codegen due to missing worker pool (#24140)
    
    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);
         }