You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2023/01/30 12:25:00 UTC

[jira] [Resolved] (CAMEL-18954) camel-micrometer - NPE on spring boot

     [ https://issues.apache.org/jira/browse/CAMEL-18954?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-18954.
---------------------------------
    Resolution: Fixed

> camel-micrometer - NPE on spring boot
> -------------------------------------
>
>                 Key: CAMEL-18954
>                 URL: https://issues.apache.org/jira/browse/CAMEL-18954
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-micrometer
>    Affects Versions: 3.20.1
>            Reporter: Andreas Klug
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 3.20.2, 3.21.0, 4.0
>
>         Attachments: repro.zip
>
>
> Hello everyone,
> Unfortunately when I’m testing a route containing a micrometer endpoint on Camel 3.20.1 using Spring Boot, then I’m getting a
> {code:java}
> java.lang.NullPointerException: null
>         at org.apache.camel.component.micrometer.eventnotifier.MicrometerExchangeEventNotifierNamingStrategy.getTags(MicrometerExchangeEventNotifierNamingStrategy.java:53)
>         at org.apache.camel.component.micrometer.eventnotifier.MicrometerExchangeEventNotifier.handleDoneEvent(MicrometerExchangeEventNotifier.java:105)
>        at org.apache.camel.component.micrometer.eventnotifier.MicrometerExchangeEventNotifier.notify(MicrometerExchangeEventNotifier.java:75)
>         […]
> {code}
>  
> The exception only occurs in case I’m using:
> {code:java}
> producer.send(ExchangeBuilder.anExchange(context).withBody("hello").build());{code}
> It’s working fine in case of
> {code:java}
> producer.sendBody(“hello”);{code}
> For both statements, in 3.18.3 it’s working fine – in any case, meaning in 3.18.3 and 3.20.1, the ExchangeBuilder.anExchange(context).withBody("hello").build().getEndpointFrom() is null, however, only in 3.20.1 it looks like that getEndpointFrom() indirectly causes the NPE in [line 53|https://github.com/apache/camel/blob/1d7da244fadca57b4054cc0defb70a70923c06f4/components/camel-micrometer/src/main/java/org/apache/camel/component/micrometer/eventnotifier/MicrometerExchangeEventNotifierNamingStrategy.java#L53].
> Pls. find a repo case attached.[^repro.zip]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)