You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Vincent Paturet (Jira)" <ji...@apache.org> on 2025/04/28 12:29:00 UTC
[jira] [Commented] (CAMEL-22021) camel-test - NPE on DefaultMessage.typeConverter in CSB with AdviceWith happens randomly
[ https://issues.apache.org/jira/browse/CAMEL-22021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17947811#comment-17947811 ]
Vincent Paturet commented on CAMEL-22021:
-----------------------------------------
As far as I can see, it is always the same unit tests that fail, and they all start from pubsub, and they all use advice-with.
The error is triggered from a thread belonging to the pubsub thread pool (thead name = [GAX-n]).
I cannot confirm that it affects only unit tests: we did not take the risk to roll out this version in production before clarifying the root cause of this bug.
The bug can be reproduced with Camel 4.7.0. I cannot reproduce it with Camel 4.6.0.
> camel-test - NPE on DefaultMessage.typeConverter in CSB with AdviceWith happens randomly
> ----------------------------------------------------------------------------------------
>
> Key: CAMEL-22021
> URL: https://issues.apache.org/jira/browse/CAMEL-22021
> Project: Camel
> Issue Type: Bug
> Components: camel-spring-boot, camel-test
> Affects Versions: 4.8.6, 4.10.3, 4.11.0
> Reporter: Vincent Paturet
> Priority: Minor
>
> When upgrading from Camel 4.4.5 to Camel 4.8.6 or 4.10.3 or 4.11.0, some unit tests fail randomly with the following error:
> {code:java}
> java.lang.NullPointerException: Cannot invoke "org.apache.camel.TypeConverter.convertTo(java.lang.Class, org.apache.camel.Exchange, Object)" because "this.typeConverter" is null
> at org.apache.camel.support.DefaultMessage.getHeader(DefaultMessage.java:173)
> at org.apache.camel.processor.aggregate.AggregateProcessor.isCompleteAllGroups(AggregateProcessor.java:447)
> at org.apache.camel.processor.aggregate.AggregateProcessor.doProcess(AggregateProcessor.java:333)
> at org.apache.camel.processor.aggregate.AggregateProcessor.process(AggregateProcessor.java:319)
> at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.handleFirst(RedeliveryErrorHandler.java:440)
> at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:416)
> at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.doRun(DefaultReactiveExecutor.java:199)
> at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.executeReactiveWork(DefaultReactiveExecutor.java:189)
> at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.tryExecuteReactiveWork(DefaultReactiveExecutor.java:166)
> at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:148)
> at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:59)
> at org.apache.camel.processor.Pipeline.process(Pipeline.java:163)
> at org.apache.camel.impl.engine.CamelInternalProcessor.processNonTransacted(CamelInternalProcessor.java:347)
> at org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:323)
> at org.apache.camel.impl.engine.DefaultAsyncProcessorAwaitManager.process(DefaultAsyncProcessorAwaitManager.java:82)
> at org.apache.camel.support.AsyncProcessorSupport.process(AsyncProcessorSupport.java:32)
> at org.apache.camel.component.google.pubsub.consumer.CamelMessageReceiver.receiveMessage(CamelMessageReceiver.java:70)
> at com.google.cloud.pubsub.v1.MessageDispatcher$3.run(MessageDispatcher.java:552)
> at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
> at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
> at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
> at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
> at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
> at java.base/java.lang.Thread.run(Thread.java:1583){code}
> - The failure is random (once every 3-4 runs)
> - The unit tests use @CamelSpringBootTest and @UseAdviceWith and start the context manually: context.start()
> - The tests that fail seem to always use message aggregation (org.apache.camel.processor.aggregate.AggregateProcessor)
> The error being triggered randomly I cannot come up with a simple reproducer test case.
> I can share code and more details if needed.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)