JMXで接続してキュー内のメッセージを全削除しようとpurgeを呼び出した時点でエラーが。名前とかタイプはjconsoleで確認したんだがなぁ。

javax.management.InstanceNotFoundException: org.apache.activemq:Type=Broker,BrokerName=localhost,destinationType=Queue,destinationName=TweetQueue
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(Unknown Source)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getClassLoaderFor(Unknown Source)
	at com.sun.jmx.mbeanserver.JmxMBeanServer.getClassLoaderFor(Unknown Source)
	at javax.management.remote.rmi.RMIConnectionImpl$5.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.management.remote.rmi.RMIConnectionImpl.getClassLoaderFor(Unknown Source)
	at javax.management.remote.rmi.RMIConnectionImpl.invoke(Unknown Source)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
	at sun.rmi.transport.Transport$1.run(Unknown Source)
	at sun.rmi.transport.Transport$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Unknown Source)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$240(Unknown Source)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$$Lambda$1/33549129.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
	at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
	at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
	at sun.rmi.server.UnicastRef.invoke(Unknown Source)
	at com.sun.jmx.remote.internal.PRef.invoke(Unknown Source)
	at javax.management.remote.rmi.RMIConnectionImpl_Stub.invoke(Unknown Source)
	at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.invoke(Unknown Source)
	at javax.management.MBeanServerInvocationHandler.invoke(Unknown Source)
	at com.sun.proxy.$Proxy1.purge(Unknown Source)
	at nekora.jms.JMSQueueClear.cleanUp(JMSQueueClear.java:67)
	at nekora.jms.JMSQueueClear.main(JMSQueueClear.java:46)

Apache 5.8 changed the name of JMX MBeans which means Active Mq won't find the MBeans it is looking for (hence instance not found exception). I tried discovering queues with Active MQ 5.1 and it worked.

There is nothing you can do to fix it. The author of Hermes JMS would have to update the code to support Active MQ 5.8+

http://stackoverflow.com/questions/22654832/instancenotfoundexception-when-trying-to-discover-queues-in-hermes-jms

の事例が似ているな。ちなみに5.10.1を使っている。
http://stackoverflow.com/questions/15837853/accessing-apache-activemq-via-jmx-throws-exception
にオブジェクト名が変わったと
http://activemq.apache.org/activemq-580-release.html
Typeではなくてtypeとかこまごま。

→結局、ObjectNameのコンストラクタに渡す文字列が不正確だったらしい。jconsoleで欲しいのを表示してObjectNameの値をコピペ(欄をダブルクリックで選択可能になる)したら実行時に上記エラーはでなくなった。
要は即値で書くと

    ObjectName queue_name = new ObjectName("org.apache.activemq:type=Broker,brokerName=localhost,destinationType=Queue,destinationName=TweetQueue");

のようになる。
ここの文字列の指定は大文字小文字合わせて一字一句大変厳密なモノのようだ。typeやbrokerName等の要素の順番も同じにすべきだろう。

→接続はできてpurgeも呼べたが、実際にはパージされない。jconsoleでやった時と同じだ。