[jboss-user] [JBoss Messaging] - Re: Queue MessageCount - JMX Help

kemplin do-not-reply at jboss.com
Thu May 24 17:00:03 EDT 2007


Thanks for your response.  I searched the forums prior to sending in my message, but didn't find the articles you pointed me to.  I think I'm making progress, but am still coming up short.  

My applications are external to JBoss.  I'm able to send/receive messages without any problem.  However, my sender app wants to monitor the number of messages in the queue via JMX.  From the links you pointed me to, I think my problem was mostly descriptor related.  I now have:

<mbean code="org.jboss.jms.server.destination.QueueService"
  | 	name="jboss.messaging.destination:service=Queue,name=MyQueue"
  | 	xmbean-dd="xmdesc/Queue-xmbean.xml">
  | 	<depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
  | 	<depends>jboss.message:service=PostOffice</depends>
  | 	...snip security part guest read write
  | </mbean>    
  | 
  | <mbean code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
  |       name="jboss.jmx:type=adaptor,name=MyQueueTarget,protocol=jrmp,service=proxyFactory">
  |       <depends optional-attribute-name="InvokerName">jboss:service=invoker,type=jrmp</depends>
  |       <depends optional-attribute-name="TargetName">
  | 	jboss.messaging.destination:service=Queue,name=MyQueue
  |       </depends>
  |       <attribute name="JndiName">MyQueueMBean</attribute>
  |       <attribute name="InvokeTargetMethod">true</attribute>
  |       <attribute name="ExportedInterfaces">org.jboss.jms.server.destination.QueueMBean</attribute>
  |       <attribute name="ClientInterceptors">
  |           <interceptors>
  |              <interceptor>org.jboss.proxy.ClientMethodInterceptor</interceptor>
  |              <interceptor>org.jboss.proxy.SecurityInterceptor</interceptor>
  |              <interceptor>org.jboss.jmx.connector.invoker.client.InvokerAdaptorClientInterceptor</interceptor>
  |              <interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>
  |           </interceptors>
  |       </attribute>
  |    </mbean>
  | 
Inside my code, Its really simple:

  | mBeanServer = (MBeanServerConnection) ctx.lookup("jmx/rmi/RMIAdaptor");
  | org.jboss.jms.serer.destination.QueueMBean qmbean = (org.jboss.jms.server.destination.QueueMBean) ctx.lookup("MyQueueMBean");

System.out.println(qmbean) --> JRMPInvokerProxy

When I attempt to do a qmbean.getMessageCount() I get an IllegalStateException:  Failed to find method for hash:..... and it then prints the methods available on a QueueMBean.

I *have* searched the forum and this error seems to imply a jar related problem.  I have ensured that my version of jboss-messaging-client.jar is one provided in messaging 1.2.0sp1.  I have looked at the dates on the QueueMBean class within that jar, and they match the dates/size of the QueueMBean located in the jboss/server/messaging/deploy/jboss-messaging.sar/jboss-messaging.jar.

One post I read at http://www.jboss.com/index.html?module=bb&op=viewtopic&t=92737 says that there was a problem with old JMX classes bundled in the jboss-messaging-client.jar.  I removed those and it still doesn't work.  

The jboss-messaging-client.jar is the first jar in my classpath.

At this point, I'm not sure where the incompatibility is.  Any ideas?

Thanks.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048486#4048486

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4048486



More information about the jboss-user mailing list