You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by oscarfh2 <os...@gmail.com> on 2011/01/24 13:07:09 UTC

Accessing Servicemix 4.2 via JMX - Objectname incorrect

Hi!
I had a this code which worked nicely in my servicemix 3.3 platform:

		ObjectName activeMQ = new
ObjectName("org.apache.activemq:BrokerName=localhost,Type=Broker");
		BrokerViewMBean mbean = (BrokerViewMBean)
MBeanServerInvocationHandler.newProxyInstance(connection, activeMQ,
BrokerViewMBean.class, true);
		
		for (ObjectName name : mbean.getQueues()) {
			QueueViewMBean queueMbean = (QueueViewMBean)
MBeanServerInvocationHandler.newProxyInstance(connection, name,
QueueViewMBean.class, true);

			// queueViewBeanCache.put(cacheKey, queueMbean);
			System.out.println(queueMbean.getName() + ": " +
queueMbean.getQueueSize() + " messages");
			// return queueMbean;
		}
		// return null;

We are now migrating to servicemix 4.2, and it doesn't work anymore. When
the method mbean.getQueues() is called, I get an exception: 
java.lang.reflect.UndeclaredThrowableException
	at $Proxy0.getQueues(Unknown Source)
	at
ActiveMQJMXConnectionTest.getMsgNumber(ActiveMQJMXConnectionTest.java:34)
	at ActiveMQJMXConnectionTest.main(ActiveMQJMXConnectionTest.java:21)
Caused by: javax.management.InstanceNotFoundException:
org.apache.activemq:BrokerName=localhost,Type=Broker

I now that there is a big change between the servicemix 3.3 and 4.2, so I
imagine that the structure changed and because of that, the objectname is
not valid anymore.
I am looking for the current one online, but I can't find it.

I am sorry  I am posting so many questions, but I am new to these
technologies and I am having some problems getting started with them.

Tks,
Oscar
-- 
View this message in context: http://activemq.2283324.n4.nabble.com/Accessing-Servicemix-4-2-via-JMX-Objectname-incorrect-tp3233852p3233852.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.