I am attempting to get access to a Queue via JMX so I can check to see the number of
messages (MessageCount).
I created the queue upon startup of JBoss by copying the default demo Queues in
destinations-service.xml
<mbean code="org.jboss.jms.server.destinatiosn.QueueService"
name="jboss.messaging.destination:service=Queue,name=myqueue
xmbean-dd="xmdesc/Queue-xmbean.xml">
<depends
optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer
jboss.message:service=PostOffice
Inside my code I have the following:
Properties props = new Propeties();
| props.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
| props.setProperty(Context.URL_PKG_PREFIXES,
"org.jboss.naming:org.jnp.interfaces");
| props.setProperty(Context.PROVIDER_URL, "jnp://localhost:1099");
|
| InitialContext ctx = new InitialContext(props);
|
| Object o = ctx.lookup("jmx/rmi/RMIAdaptor");
the object that is returned is a JRMPInvokerProxy, when I expected to get back an
RMIAdaptor (as per all the examples I've seen).
Does anyone know why I'm getting this class? I expected to get an RMIAdaptor.
If I cast it as an RMIAdaptor and then invoke the method:
rmiAdaptor.getAttribute("jboss.messaging.destination:service=Queue,name=myqueue",
"MessageCount")
|
I get an UnmarshalException....ClassNotFoundException
org.jboss.jmx.connector.invoker.client.InvokerAdaptorException (no security manager: RMI
class loader disabled).
If someone can help, I'd really appreciate it. As you can tell, I'm new to JMX
and trying to figure this out. If you have an example of getting the message count,
I'd *really* appreciate it :-)
| In my classpath, I have jboss-messaging-client.jar.
| I'm using JBoss 4.0.5,
| messaging 1.2.0sp1,
| and JDK 6.
|
|
| thanks.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048058#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...