[ 
https://issues.apache.org/jira/browse/CAMEL-8841?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14585502#comment-14585502
 ] 

Claus Ibsen commented on CAMEL-8841:
------------------------------------

the context name is not required to be unique in the entire jvm and also end 
users can configure an explict name such as myCamel etc. Where as management 
name must be unique in the JVM. Therefore these 2 can differ. 

> camel:context-inflight returns 'Object name cannot be null'
> -----------------------------------------------------------
>
>                 Key: CAMEL-8841
>                 URL: https://issues.apache.org/jira/browse/CAMEL-8841
>             Project: Camel
>          Issue Type: Bug
>          Components: karaf, tooling
>    Affects Versions: 2.15.1, 2.15.2
>         Environment: Karaf 3.0.3
>            Reporter: Martin Lichtin
>             Fix For: 2.16.0, 2.15.3
>
>
> {noformat}
> karaf> camel:context-inflight myCamelContext
> Error executing command: Object name cannot be null 
> karaf> log:exception-display
> javax.management.RuntimeOperationsException: Object name cannot be null
>         at 
> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.isRegistered(DefaultMBeanServerInterceptor.java:569)[:1.8.0_45]
>         at 
> com.sun.jmx.mbeanserver.JmxMBeanServer.isRegistered(JmxMBeanServer.java:638)[:1.8.0_45]
>         at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_45]
>         at java.lang.reflect.Method.invoke(Method.java:497)[:1.8.0_45]
>         at 
> org.apache.karaf.management.boot.KarafMBeanServerBuilder$MBeanInvocationHandler.invoke(KarafMBeanServerBuilder.java:80)[karaf-jmx-boot.jar:]
>         at com.sun.proxy.$Proxy0.isRegistered(Unknown Source)[:]
>         at 
> org.apache.camel.commands.AbstractLocalCamelController.browseInflightExchanges(AbstractLocalCamelController.java:186)
>         at 
> org.apache.camel.commands.ContextInflightCommand.performContextCommand(ContextInflightCommand.java:56)
>         at 
> org.apache.camel.commands.AbstractContextCommand.executeLocal(AbstractContextCommand.java:74)
>         at 
> org.apache.camel.commands.AbstractContextCommand.execute(AbstractContextCommand.java:42)
>         at 
> org.apache.camel.karaf.commands.ContextInflight.doExecute(ContextInflight.java:40)
>         at 
> org.apache.karaf.shell.console.AbstractAction.execute(AbstractAction.java:33)[25:org.apache.karaf.shell.console:3.0.3]
>         at 
> org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:39)[25:org.apache.karaf.shell.console:3.0.3]
>         at 
> org.apache.karaf.shell.commands.basic.AbstractCommand.execute(AbstractCommand.java:33)[25:org.apache.karaf.shell.console:3.0.3]
>         at Proxy199cb572_c6d4_4d06_851e_3f55b795651b.execute(Unknown 
> Source)[:]
>         at Proxy199cb572_c6d4_4d06_851e_3f55b795651b.execute(Unknown 
> Source)[:]
>         at 
> org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[25:org.apache.karaf.shell.console:3.0.3]
>         at 
> org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)[25:org.apache.karaf.shell.console:3.0.3]
>         at 
> org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)[25:org.apache.karaf.shell.console:3.0.3]
>         at 
> org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[25:org.apache.karaf.shell.console:3.0.3]
>         at 
> org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[25:org.apache.karaf.shell.console:3.0.3]
>         at 
> org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[25:org.apache.karaf.shell.console:3.0.3]
>         at 
> org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:92)
>         at 
> org.apache.karaf.shell.console.impl.jline.ConsoleImpl.run(ConsoleImpl.java:208)
>         at 
> org.apache.karaf.shell.ssh.ShellFactoryImpl$ShellImpl$1.runConsole(ShellFactoryImpl.java:158)[52:org.apache.karaf.shell.ssh:3.0.3]
>         at 
> org.apache.karaf.shell.ssh.ShellFactoryImpl$ShellImpl$1$1.run(ShellFactoryImpl.java:133)
>         at java.security.AccessController.doPrivileged(Native 
> Method)[:1.8.0_45]
>         at 
> org.apache.karaf.jaas.modules.JaasHelper.doAs(JaasHelper.java:57)[26:org.apache.karaf.jaas.modules:3.0.3]
>         at 
> org.apache.karaf.shell.ssh.ShellFactoryImpl$ShellImpl$1.run(ShellFactoryImpl.java:129)[52:org.apache.karaf.shell.ssh:3.0.3]
> Caused by: java.lang.IllegalArgumentException: Object name cannot be null
>         ... 30 more
> {noformat}
> I think when combining the object name
>             Set<ObjectName> set = mBeanServer.queryNames(new 
> ObjectName(agent.getMBeanObjectDomainName() + 
> ":type=services,name=DefaultInflightRepository,*"), null);
> The ":context=context-name" part seems missing.
> The query should be something like
> org.apache.camel:context=<context-name>,type=services,name=DefaultInflightRepository
>  



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to