OSGiインフラストラクチャ構成

GlassFishアプリケーションサーバーのバージョン3.x以降はOSGiアーキテクチャを使用します。デフォルトで、OSGiコンテナは、ブートストラップクラスの委譲のための特別なモデルに従います。コンテナの CLASSPATHclassloader に指定されていないクラスは、ブートストラップ に委譲されないため、クラス用の OSGi コンテナを構成する必要があります。

GlassFishスタートアップ設定」と「GlassFish OSGi Configuration per Domain」を参照してください。

OSGi コンテナが を識別できるようにするには、次のパッケージプレフィックスを指定します。

CODE
org.osgi.framework.bootdelegation=com.singularity.*

このプレフィックスは、クラスが表示されるように通常のブート委譲モデルに従います。

すでにブートの委譲が行われている場合には、"com.singularity.*" を既存のパスにカンマで区切って追加します。例:

CODE
org.osgi.framework.bootdelegation=com.sun.btrace., com.singularity

Eclipse Equinoxの構成

Eclipse Equinoxの構成
環境に合わせて Eclipse Equinox を構成する。
オプション 説明
GlassfishでEclipse Equinoxを実行している場合、
  1. <glassfish install directory>/glassfish/osgi/equinox/configuration にある config.ini ファイルを開く。
  2. config.ini ファイルに次のパッケージプレフィックスを追加する。
    CODE
    org.osgi.framework.bootdelegation=com.singularity.*
WebSphere Application Server Liberty プロファイルの下でEclipse Equinoxを実行している場合、
  1. JVM ディレクトリ <WLP_home>/usr/servers/<server_name> で bootstrap.properties ファイルを開き、編集する。<WLP_home>/usr/servers/<server_name>
  2. 次のコード行を追加する。
    CODE
    org.osgi.framework.bootdelegation=com.singularity.*
Getting Started with Equinox」を参照してください。

Apache Slingの構成

  1. sling.properties ファイルを開く。
    sling.properties の場所は、Java プラットフォームにより異なります。sling.propertiesSun/Oracle の実装では、<java.home>/lib ファイルは にあります。
  2. sling.properties ファイルに次のパッケージプレフィックスを追加する。
    CODE
    org.osgi.framework.bootdelegation=com.singularity.*

JIRAまたはConfluenceを構成

JIRA 5.1.8 以降および Confluence 5.3 以降の場合

  1. 編集のために起動スクリプト(catalina.sh)を開く。
  2. start コマンドブロックを探す。
    CODE
    elif [ "$1" = "start" ] ; then
  3. 次の Java システムプロパティを既存のプロパティに添えて両方の else ブロックに追加する。
    CODE
    -Datlassian.org.osgi.framework.bootdelegation.extra=com.singularity.*
  4. 実行モードで起動されたアプリケーションをインストゥルメント化するために、実行コマンドブロックにもプロパティを追加する。
    例:コマンドブロックの実行
  5. コメントライン「Execute The Requested Command」の前に、次のように新しい Java オプションとして –javaagent 引数をファイルに追加します。
    • Linux
      CODE
      JAVA_OPTS="$JAVA_OPTS -javaagent:<agent_home>/javaagent.jar"
    • Windows
      CODE
      set JAVA_OPTS=%JAVA_OPTS% -javaagent:"Drive:<agent_home>\javaagent.jar"
  6. アプリケーションを再起動します。

他のOSGiベースのコンテナを構成

他の OSGi ベースのランタイムコンテナの場合、次のパッケージプレフィックスを適切な OSGi 構成に追加します。

CODE
file.org.osgi.framework.bootdelegation=com.singularity.*

Configure Apache Karaf

  1. Open the custom.properties file for Karaf.
    It is located at $KARAF_HOME/etc/custom.properties . $KARAF_HOME is the path to the folder where Karaf is installed.
  2. Add this package prefix to the custom.properties file:
    CODE
    org.osgi.framework.bootdelegation=com.singularity.*
    重要: >All the values specified in the custom.properties file will override the default values specified in the /etc/config.properties file. So, ensure that you include the default values of org.osgi.framework.bootdelegation from the config.properties file to the custom.properties file.

    Once configured, all applications based on Java Agent Supported Frameworks that are running on Apache Karaf can be instrumented and seen on the Controller UI.