Hi everybody,

I'm running apache-camel (3.7.2) 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 vm-Endpoint.

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?

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.

I tested it, by using the context directly from the route, and it works for me.

If there is no specific reason, to use the Endpoint-Context, I suggest
to create a Jira ticket with a related PR.

Best regards,
Joerg


Here's the stacktrace:
java.lang.NullPointerException: Cannot invoke
"org.apache.camel.api.management.mbean.ManagedRouteMBean.getExchangesTotal()"
because "mr" is null
        at 
org.apache.camel.commands.AbstractLocalCamelController.getRoutes(AbstractLocalCamelController.java:291)
~[?:?]
        at 
org.apache.camel.commands.AbstractLocalCamelController.getRoutes(AbstractLocalCamelController.java:306)
~[?:?]
        at 
org.apache.camel.commands.AbstractLocalCamelController.getRoutes(AbstractLocalCamelController.java:271)
~[?:?]
        at 
org.apache.camel.commands.RouteListCommand.execute(RouteListCommand.java:54)
~[?:?]
        at org.apache.camel.karaf.commands.RouteList.execute(RouteList.java:39)
~[?:?]
        at 
org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:84)
~[?:?]
        at 
org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68)
~[?:?]
        at 
org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86)
~[?:?]
        at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:599)
~[?:?]
        at 
org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:526)
~[?:?]
        at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:415)
~[?:?]
        at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:416) ~[?:?]
        at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229) ~[?:?]
        at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59) ~[?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
~[?:?]
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
~[?:?]
        at java.lang.Thread.run(Thread.java:832) [?:?]

Reply via email to