activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oscarfh2 <osca...@gmail.com>
Subject Accessing Servicemix 4.2 via JMX - Objectname incorrect
Date Mon, 24 Jan 2011 12:07:09 GMT

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.

Mime
View raw message