2011-10-28 8 views
0

weblogicサーバーを監視するためにJMXTransを使用したことがありますか?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; 
+0

ディレクトリに「/」と「\」の両方があるのはなぜですか?あなたがUNIX環境にいる場合、$ {JAVA_HOME} \ lib \ tools.jarは$ {JAVA_HOME} /lib/tools.jarになるはずです –

答えて

0

に入れたとしても、次の設定で

残念ながら、ServerオブジェクトにURLを設定しても効果はありません。これはおそらくコードに加えることができる/増強すべきものです。

なぜ私はクラスパスを使いこなしているのか分かりませんが、それも問題の一部になる可能性があります。

どのJDKをお使いですか?

申し訳ありませんが、私はweblogicに関する経験はありません。

(私はjmxtransの著者だ)

+0

weblogic用の可能性のあるパッチを電子メールで送信します。 実際には、クライアントはWeblogicに接続するために特別な設定を使用する必要があります。 私のパッチは、次の文書に基づいています。http://download.oracle.com/docs/cd/E13222_01/wls/docs90/jmx/accessWLS.html –

0

エラーからそれはそれは、WebLogic内のjava.naming.factory.initial環境プロパティを探しているように見えます。

weblogicサイトからこのノートを入手しました - これを試してください java.naming.factory.initialプロパティは、InitialContextの作成方法を指定するために使用します。 WebLogic JNDIを使用するには、java.naming.factory.initialプロパティをweblogic.jndi.WLInitialContextFactoryに設定する必要があります。