JMXTrans和WebLogic
您是否曾经使用JMXTrans来监视weblogic服务器 使用以下配置:JMXTrans和WebLogic,weblogic,Weblogic,您是否曾经使用JMXTrans来监视weblogic服务器 使用以下配置: { "servers" : [ { "host": "a-pfg-admin.fr.net.intra", "port":9091, "url": "service:jmx:iiop://a-pfg-admin.fr.net.intra:9091/jn
{
"servers" : [ {
"host": "a-pfg-admin.fr.net.intra",
"port":9091,
"url": "service:jmx:iiop://a-pfg-admin.fr.net.intra:9091/jndi/weblogic.management.mbeanservers.runtime",
"username": "weblogic",
"password": "****",
"queries" : [ {
"outputWriters" : [ {
"@class" : "com.googlecode.jmxtrans.model.output.KeyOutWriter",
"settings" : {
"outputFile" : "/tmp/jmxtrans1.txt",
"maxLogFileSize" : "10MB",
"maxLogBackupFiles" : 200,
"debug" : true,
"typeNames" : ["name"]
}
} ],
"obj" : "java.lang:type=Memory",
"resultAlias": "heap",
"attr" : [ "HeapMemoryUsage", "NonHeapMemoryUsage" ]
}
]
} ]
}
我得到:
[28 Oct 2011 16:39:54] [ServerScheduler_Worker-8] 1020012 ERROR (com.googlecode.jmxtrans.jobs.ServerJob:39) - Error
java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:338)
at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248)
at com.googlecode.jmxtrans.util.JmxUtils.getServerConnection(JmxUtils.java:413)
at com.googlecode.jmxtrans.util.JmxConnectionFactory.makeObject(JmxConnectionFactory.java:30)
at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:1212)
at com.googlecode.jmxtrans.jobs.ServerJob.execute(ServerJob.java:36)
at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
Caused by: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:325)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1886)
at javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1856)
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:257)
即使我输入/etc/init.d/jmxtrans.sh
不幸的是,在服务器对象上设置url没有效果。这可能是对代码的一种增强 我不知道你为什么要弄乱类路径,但这也可能是你问题的一部分 您使用的是什么JDK 对不起,我没有weblogic方面的经验
我是jmxtrans的作者,它看起来像是在weblogic中查找java.naming.factory.initial环境属性 我从weblogic网站上得到了这张便条——试试看
属性java.naming.factory.initial用于指定如何创建InitialContext。要使用WebLogic JNDI,必须始终将java.naming.factory.initial属性设置为WebLogic.JNDI.WLInitialContextFactory。为什么目录中同时包含/和\?如果您在UNIX环境中,${JAVA\u HOME}\lib\tools.jar应该是${JAVA\u HOME}/lib/tools.jarI正在向您发送一封电子邮件,其中包含可能的weblogic修补程序。实际上,客户端应该使用一个特殊的设置来连接到Weblogic。我的补丁基于以下文件:
WL_HOME="/apps/WebLogic/10.3.2/AppServer"
JMXTRANS_OPTS="-Djava.class.path=${JAVA_HOME}\lib\tools.jar;${WL_HOME}/server/lib/wlfullclient.jar -Djmx.remote.protocol.provider.pkgs=weblogic.management.remote"
export JMXTRANS_OPTS;