Hi Scott, The activemq:query command is implemented by AMQ and still uses "service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi" as the default JMX URL.
Whereas since the switch-over to karaf, SMX4 itself now exposes a JMX connector with a different URL, having the context changed from "jmxrmi" to "karaf-<instance_name>" (i.e. "karaf-root" in general). So to use the activemq:query command, you'll simply need to specify the correct JMX details as follows: ka...@root> activemq:query --jmxurl service:jmx:rmi:///jndi/rmi://localhost:1099/karaf-root --jmxuser karaf --jmxpassword karaf -QTopic=* --view EnqueueCount,DequeueCount Alternatively just use the --jmxlocal option to indicate that the local (as opposed to potentially remote) MBeanServer should be used, i.e.: ka...@root> activemq:query --jmxlocal -QTopic=* --view EnqueueCount,DequeueCount Both approaches worked fine for me in an ESB RC1 kit. Cheers, Eoghan 2010/1/7 Scott Parkerson <[email protected]> > Greetings, all. > > I tried checking the stats on the embedded ActiveMQ in the latest > ServiceMix 4, and I'm getting odd responses back from activemq:query: > > ka...@root> activemq:query > null > ka...@root> activemq:query -QTopic=* --view EnqueueCount,DequeueCount > Connecting to JMX URL: service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi > ERROR: java.lang.RuntimeException: Failed to execute query task. > Reason: java.io.IOException: Failed to retrieve RMIServer stub: > javax.naming.NameNotFoundException: jmxrmi > java.lang.RuntimeException: Failed to execute query task. Reason: > java.io.IOException: Failed to retrieve RMIServer stub: > javax.naming.NameNotFoundException: jmxrmi > at > org.apache.activemq.console.command.QueryCommand.runTask(QueryCommand.java:120) > at > org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57) > at > org.apache.activemq.console.command.AbstractJmxCommand.execute(AbstractJmxCommand.java:292) > at > org.apache.servicemix.activemq.commands.ActiveMQCommandSupport.doExecute(ActiveMQCommandSupport.java:48) > at > org.apache.felix.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:41) > at > org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:34) > at > org.apache.felix.gogo.runtime.shell.CommandProxy.execute(CommandProxy.java:45) > at > org.apache.felix.gogo.runtime.shell.Closure.execute(Closure.java:211) > at > org.apache.felix.gogo.runtime.shell.Closure.executeStatement(Closure.java:146) > at org.apache.felix.gogo.runtime.shell.Pipe.run(Pipe.java:91) > at > org.apache.felix.gogo.runtime.shell.Closure.execute(Closure.java:75) > at > org.apache.felix.gogo.runtime.shell.CommandSessionImpl.execute(CommandSessionImpl.java:71) > at > org.apache.felix.karaf.shell.console.jline.Console.run(Console.java:174) > at java.lang.Thread.run(Thread.java:619) > java.io.IOException: Failed to retrieve RMIServer stub: > javax.naming.NameNotFoundException: jmxrmi > > Not sure what is wrong, other than (perhaps) the RMI stuff is busted. > > Also, isn't there supposed to be a web console for ActiveMQ in the > latest ServiceMix (as well as a web console for ServiceMix in > general)? Not sure where I heard that from. > > --sgp >
