您是否曾經使用JMXTrans監控您的weblogic服務器?JMXTrans&WebLogic
與以下配置:
{
"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
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;
爲什麼你的目錄有「/」和「\」?如果您處於UNIX環境中,$ {JAVA_HOME} \ lib \ tools.jar應該是$ {JAVA_HOME} /lib/tools.jar –