Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/oracle/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何监控Weblogic 12上的统一分布式队列_Java_Oracle_Jms_Weblogic12c - Fatal编程技术网

Java 如何监控Weblogic 12上的统一分布式队列

Java 如何监控Weblogic 12上的统一分布式队列,java,oracle,jms,weblogic12c,Java,Oracle,Jms,Weblogic12c,我需要监视WebLogic服务器上配置的统一分布式队列:12.1.3.0.0。 查看Oracle文档,似乎可以通过“JMSDestinationRuntimeMBean”类监视JMS模块中统一分布的队列资源的统计信息 链接如下: 下面是我的代码: Hashtable<String, String> h = new Hashtable<String, String>(); h.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.j

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

链接如下:

下面是我的代码:

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());
Hashtable h=新的Hashtable();
h、 put(Context.INITIAL\u Context\u工厂,“weblogic.jndi.WLInitialContextFactory”);
h、 put(Context.PROVIDER_URL,“t3://localhost:7001”);
h、 put(Context.SECURITY_PRINCIPAL,“weblogic”);
h、 put(Context.SECURITY_凭证,“weblogic123”);
InitialContext ctx=新的InitialContext(h);
Destination queue=(Destination)ctx.lookup(“jms/MyQueue”);
JMSDestinationRuntimeMBean destMBean=JMSRuntimeHelper.getJMSDestinationRuntimeMBean(ctx,队列);
System.out.println(“计数:+destMBean.getMessagesCurrentCount());
在执行时,我在
getJMSDestinationRuntimeMBean
方法上得到了这个异常:

weblogic.jms.common.JMSException:找不到jms目标运行时mbean


我曾尝试在一个简单的队列(非分布式)上执行该代码,但效果很好。

我找到了两种方法。您可以找到更多详细信息,并很高兴找到了解决方案。谷歌
weblogicjmxjms
,这里有很多例子