smongiar opened a new pull request, #24140:
URL: https://github.com/apache/camel/pull/24140
## Summary
`AbstractSalesforceExecution.createHttpClient()` in the
`camel-salesforce-codegen` module uses 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:
```
Error getting global Objects: Timeout waiting for getGlobalObjects!
```
The stack trace visible in the build log is:
```
java.lang.NullPointerException: Cannot invoke
"java.util.concurrent.ExecutorService.execute(java.lang.Runnable)"
because the return value of
"org.apache.camel.component.salesforce.SalesforceHttpClient.getWorkerPool()" is
null
at
org.apache.camel.component.salesforce.internal.client.AbstractClientBase$1.onComplete(AbstractClientBase.java:266)
```
### Fix
Use the production 3-arg constructor that accepts `CamelContext` and
`ExecutorService`, matching what `SalesforceComponent.createHttpClient()`
already does. The worker pool is automatically cleaned up by
`SalesforceHttpClient.doStop()` when `ServiceHelper.stopAndShutdownServices()`
is called during disconnect.
### How was this tested
Built the `amqp-salesforce` example from `camel-spring-boot-examples` with
`-Dgenerate.dto=true` (which triggers the
`camel-salesforce-maven-plugin:generate` goal). Before the fix: `BUILD FAILURE`
with the NPE/timeout. After the fix: `BUILD SUCCESS` — Salesforce login, DTO
generation, compilation, and packaging all pass.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]