如何在Weblogic 12

时间:2015-08-07 10:51:27

标签: java oracle jms weblogic12c

我需要监视在WebLogic Server上配置的统一分布式队列:12.1.3.0.0。 查看Oracle文档似乎可以通过“JMSDestinationRuntimeMBean”类监视JMS模块中统一分布式队列资源的统计信息。

这里的链接: http://docs.oracle.com/cd/E13222_01/wls/docs100/jms_admin/manage_msg.html#wp1125870

在我的代码下面:

Hashtable<String, String> h = new Hashtable<String, String>();
h.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
h.put(Context.PROVIDER_URL, "t3://localhost:7001");
h.put(Context.SECURITY_PRINCIPAL, "weblogic");
h.put(Context.SECURITY_CREDENTIALS, "weblogic123");         

InitialContext ctx = new InitialContext(h);

Destination queue = (Destination) ctx.lookup("jms/MyQueue");    

JMSDestinationRuntimeMBean destMBean = JMSRuntimeHelper.getJMSDestinationRuntimeMBean(ctx, queue);

System.out.println("count: " + destMBean.getMessagesCurrentCount());

执行时,我在getJMSDestinationRuntimeMBean方法上得到了这个例外:

weblogic.jms.common.JMSException: JMS Destination runtime mbean not found

我试图在一个简单的队列上执行该代码(不是分布式的)并且它可以工作。

0 个答案:

没有答案