WebSphere Application Server Liberty プロファイルでの Web アプリケーションのデプロイ

Rational® Publishing Engine Web アプリケーションを、IBM® DB2® を使用する WebSphere® Application Server Liberty 上でデプロイできます。

始める前に

Web アプリケーションをデプロイする前に、WebSphere Application Server Liberty と、RPE リモート・サービス・フィーチャーを備えた Rational Publishing Engine をインストールする必要があります。

手順

  1. Web アプリケーションの Liberty プロファイル・サーバーを作成します
  2. com.ibm.rpe.web.app.ear ファイルをデプロイします。これを行うには、このファイルを RPE_HOME¥remote-services ディレクトリーから Liberty の apps ディレクトリーにコピーします。 WebSphere Application Server Liberty 製品資料の『Liberty プロファイルへの Web アプリケーションのデプロイ』を参照してください。
  3. 16K ページおよび UTF-8 コード・セットを持つ、Web アプリケーション用のデータベースを作成します。 データベースの作成については、IBM DB2 製品資料を参照してください。
  4. VCAP_SERVICES 変数を設定します。
    • Windows の場合: 次のテキストを <Liberty_install_dir>¥bin¥server.bat ファイルに追加します。
      set VCAP_SERVICES={"sqldb":[{}]}
    • Linux の場合: 次のテキストを <Liberty_install_dir>¥bin¥server.sh ファイルに追加します。
      export VCAP_SERVICES={"sqldb":[{}]}
  5. (オプション) rpeng.war ファイルおよび dgaas.war ファイルを異なるアプリケーション・サーバーまたはマシンにデプロイした場合は、DGAAS_URL 変数を設定する必要があります。 com.ibm.rpe.web.app.ear ファイルをデプロイした場合は、このステップをスキップできます。
    • Windows の場合: 次のテキストを <Liberty_install_dir>¥bin¥server.bat ファイルに追加します。
      set DGAAS_URL="http://[server IP]:[port]/dgaas/"
    • Linux の場合: 次のテキストを <Liberty_install_dir>¥bin¥server.sh ファイルに追加します。
      export DGAAS_URL="http://[server IP]:[port]/dgaas/" 
  6. server.xml ファイルを編集して、Liberty プロファイルのデータベース接続を構成します。
    1. 以下のフィーチャーを追加します。
      <featureManager>
                 <feature>jsp-2.2</feature> 
                 <feature>servlet-3.0</feature> 
                 <feature>appSecurity-2.0</feature> 
                 <feature>jndi-1.0</feature>   
                 <feature>jpa-2.0</feature>  
                 <feature>jdbc-4.0</feature>
          </featureManager>
    2. JDBC ドライバー JAR ファイルまたは圧縮ファイルのロケーションを指す共有ライブラリーを定義します。
      <jdbcDriver id="db2-lib">
                 <library>
                     <fileset caseSensitive="false" dir="C:¥Program Files¥IBM¥SQLLIB¥java"/>  
                 </library> 
                </jdbcDriver>
    3. rpeng および dgaas データ・ソースについて、JDBC ドライバーを使用するデータ・ソースをデータベース接続詳細とともに定義します。
      <dataSource id="rpeng" jdbcDriverRef="db2-lib" jndiName="jdbc/RPENG_DB">
                 <properties.db2.jcc databaseName="databasename" password="password" serverName="ipaddress" user="db2admin"/>
                </dataSource> 
               <id="DGAAS_DB" jdbcDriverRef="db2-lib" jndiName="jdbc/DGAAS_DB">
                 <properties.db2.jcc databaseName="databasename" password="password" serverName="ipaddress" user="db2admin"/>
                </dataSource> 
    WebSphere Application Server Liberty 製品資料の『Liberty プロファイルでのデータベース接続の構成』を参照してください。
  7. server.xml ファイルに次の項目を追加して、http://server:port/dgaas/debug を有効にします。
    <classloading useJarUrls="true"/>
  8. server.xml ファイルに次の項目を追加して、セッション・マネージャーが無許可の要求に応答したときに、UnauthorizedSessionRequestException エラー・メッセージを出す代わりにセッションを無効にします。
    <httpSession invalidateOnUnauthorizedSessionRequestException="true"></httpSession>
  9. 次の構成を server.xml ファイルに追加します。 id 属性と name 属性はオプションです。 Liberty はデフォルトで apps ディレクトリーを調べるため、location 属性は完全修飾でなくても構いません。
    <application id="" name="rpeng" type="ear" location="[Liberty_install_dir]¥usr¥servers¥rpeng¥apps¥com.ibm.rpe.web.app.ear" >
         <classloader apiTypeVisibility="spec,ibm-api,api"/>
    </application>
    .ear ファイルではなく rpeng.war ファイルと dgaas.war ファイルをデプロイした場合は、1 つではなく 2 つのアプリケーション項目を追加する必要があります。
    <application id="" name="rpeng" location="rpeng.war" type="war>
         <classloader commonLibraryRef="rcl" apiTypeVisibility="spec,ibm-api,api"/>
    </application>
    <application id="" name="dgaas" location="dgaas.war" type="war>
         <classloader commonLibraryRef="rcl" apiTypeVisibility="spec,ibm-api,api"/>
    </application>
  10. ご使用の構成設定を、このトピックの最後 (『例』セクション) に用意されている server.xml の例と比べて、確認してください。
  11. ライセンス変数を設定します。『TELELOGIC_LICENSE_FILE 環境変数の検証』を参照してください。
  12. Liberty プロファイルを開始します。 文書生成の実行時に、すべてのアセットおよびデータがデータベースに保管されます。

タスクの結果

Rational Publishing Engine Web アプリケーションの最初のページ (http://server:port/rpeng/) をブラウザーで開くことによって、Web アプリケーションがデプロイされていることを確認できます。
要確認: UnauthorizedSessionRequestException エラー・メッセージが Web ブラウザーに表示された場合、次の項目を server.xml ファイルに追加する、前述の手順を完了していることを確認してください。
<httpSession invalidateOnUnauthorizedSessionRequestException="true"></httpSession>

Web アプリケーションをデプロイするように構成された server.xml ファイルの例:
<?xml version="1.0" encoding="UTF-8"?>
<server description="new server">
    <!-- Enable features -->
    <featureManager>
       <feature>jsp-2.2</feature>
       <feature>jndi-1.0</feature>
       <feature>jpa-2.0</feature>
       <feature>jdbc-4.0</feature>
       <feature>servlet-3.0</feature>
       <feature>appSecurity-2.0</feature>
    </featureManager>
    <!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" -->
    <httpEndpoint id="defaultHttpEndpoint" httpPort="9080" httpsPort="9443" host="localhost"/>
    <classloading useJarUrls="true"/>
    <!-- User creation-->
    <basicRegistry id="form" realm="WebRealm">
       <user name="rpe_user" password="xyz" />
       <user name="rpe_report_designer" password="xyz" />
       <user name="rpe_admin" password="xyz" />
    </basicRegistry>
    <application type="ear" location="C:¥IBM¥WebSphere¥Liberty¥usr¥servers¥rpeng¥apps¥com.ibm.rpe.web.app.ear">
       <classloader apiTypeVisibility="spec, ibm-api, api" commonLibraryRef="rcl" />
       <application-bnd>
          <security-role name="rpe_user">
             <user name="rpe_user" />
          </security-role>
          <security-role name="rpe_report_designer">
             <user name="rpe_report_designer" />
          </security-role>
          <security-role name="rpe_admin">
             <user name="rpe_admin" />
          </security-role>
       </application-bnd>
    </application>
    <httpSession invalidateOnUnauthorizedSessionRequestException="true"></httpSession>
    <!--Database Configuration -->
    <jdbcDriver id="db2-lib">
       <library>
          <fileset caseSensitive="false" dir="C:¥Program Files¥IBM¥SQLLIB¥java"/>  
       </library>
    </jdbcDriver>
    <dataSource id="rpeng" jdbcDriverRef="db2-lib" jndiName="jdbc/RPENG_DB">
       <properties.db2.jcc databaseName="databasename" password="password" serverName="ipaddress" user="db2admin"/>
    </dataSource>
    <dataSource id="DGAAS_DB" jdbcDriverRef="db2-lib" jndiName="jdbc/DGAAS_DB">
       <properties.db2.jcc databaseName="databasename" password="password" serverName="ipaddress" user="db2admin"/>
    </dataSource>
</server>

次のタスク

文書を生成するために文書生成サービス・テクノロジーを使用し、文書生成サービスのアセットと文書の保管インターフェースを提供する Newskeeper サンプル・アプリケーションを、必要に応じてデプロイして実行することができます。 詳しくは、『Newskeeper サンプルの実行』を参照してください。

http://server:port/rpeng/ ページにリストされる Rational Publishing Engine Web アプリケーションを構成します。各 URL の使用法および各フィーチャーを構成するタスクの説明については、『Web アプリケーション URL』を参照してください。