Dear Victor,
Feel happy as ur problem get solved... Well I tried the code sample which you 
have been written for  me but I am getting problem in it.



  | 
  |     String domain = "jboss.mq.destination";
  |     String service = "service=Queue";
  |     String name = "name=testQueue";
  |             
  |     String stringObjectName = domain + ":" + service + "," + name;
  |             
  |     MBeanServer server = MBeanServerLocator.locateJBoss();
  |             
  |     try{
  |             ObjectName queueObjectName = 
ObjectName.getInstance(stringObjectName);
  |             
  |             org.jboss.mq.server.jmx.QueueMBean queueMBean = 
  |                     (org.jboss.mq.server.jmx.QueueMBean) 
MBeanServerInvocationHandler.newProxyInstance(
  |                                     server,
  |                                     queueObjectName,
  |                                     
org.jboss.mq.server.jmx.QueueMBean.class,
  |                                     false
  |                             );
  |             
  |             logger.info("queue depth: " + queueMBean.getQueueDepth());
  |             
  |     }catch (Exception e){
  |             logger.info("cannot get depth of the queue: " + 
e.getMessage(),e);
  |     }       



After using it I am getting the error like :-------


java.lang.IllegalStateException: No 'jboss' MBeanServer found!
        at 
org.jboss.mx.util.MBeanServerLocator.locateJBoss(MBeanServerLocator.java:46)



So do  you have any idea on it

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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4031515
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to