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 2021/02/17 08:20:00 UTC

[jira] [Resolved] (CAMEL-16225) camel-karaf - route-list command fail with NPE

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

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

> camel-karaf - route-list command fail with NPE
> ----------------------------------------------
>
>                 Key: CAMEL-16225
>                 URL: https://issues.apache.org/jira/browse/CAMEL-16225
>             Project: Camel
>          Issue Type: Bug
>          Components: karaf
>    Affects Versions: 3.7.0, 3.7.1, 3.7.2, 3.8.0
>            Reporter: Jörg Jansen
>            Priority: Minor
>             Fix For: 3.9.0
>
>
> I'm running apache-camel within a apache-karaf container.
> Now I recognized the problem, that the route-list command failed, with
> the following scenario:
> I have route configured where bundle1 reads the data from a file and
> forwards the content to a route of bundle 2, using a *VmEndpoint*.
> After startup the route-list command works fine, but as soon as an
> incoming message has been processed, the command failed with a
> NullPointerException.
> I think the problem is located in the DefaultManagementObjectNameStrategy.
> Here I can see, the in method getObjectNameForRoute(..)
> The camelContext is picked from the Endpoint.
> Is there a special reason, why it is not read from the provided route directly?
>  
> {code:java}
> @Override
> public ObjectName getObjectNameForRoute(org.apache.camel.Route route) throws MalformedObjectNameException {
>     Endpoint ep = route.getEndpoint();
>     String id = route.getId();
>     StringBuilder buffer = new StringBuilder();
>     buffer.append(domainName).append(":");
>     buffer.append(KEY_CONTEXT + "=").append(getContextId(ep.getCamelContext())).append(",");
>     buffer.append(KEY_TYPE + "=" + TYPE_ROUTE + ",");
>     buffer.append(KEY_NAME + "=").append(ObjectName.quote(id));
>     return createObjectName(buffer);
> } {code}
> As in my test-case the context of the endpoint and route differ, this
> seems to be the reason, why the JMX-object could not be resolved.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)