WebSphere Application Server Version 6.1 Feature Pack for Web Services   
             オペレーティング・システム: AIX , HP-UX, i5/OS, Linux, Solaris, Windows, Windows Vista, z/OS

             目次と検索結果のパーソナライズ化

Java Web Start 用アプリケーション・クライアント・ランタイム依存コンポーネントの準備

Java Web Start (JWS) を使用して J2EE アプリケーション・クライアントのアプリケーションおよび/またはシン・アプリケーション・クライアントのアプリケーションを起動するには、 IBM 提供の Java ランタイム環境、WebSphere Application Server のアプリケーション・クライアントにバンドルされる ライブラリー JAR ファイルおよびプロパティー・ファイルが JWS にインストールされている必要があります。 この項目では、アプリケーション・クライアント・インストールからアプリケーション・クライアント・ランタイム依存コンポーネントを作成するステップを記載します。 アプリケーション・サーバーにインストール可能な Web アーカイブ・リソー ス (WAR) ファイルとしてパッケージされています。

始める前に

クライアント・アプリケーションがデプロイするプラットフォームの WebSphere Application Server のアプリケーション・クライアントをインストールします。 複数のプラットフォームにクライアント・アプリケーションをデプロイする必要がある場合、 アプリケーション・クライアント・ランタイム依存コンポーネントは、 クライアント・アプリケーションがサポートする各プラットフォーム用に別々に作成される必要があります。

[Windows] [Linux] 例えば、クライアント・アプリケーションを Windows プラットフォームと Linux プラットフォームの両方にデプロイする場合、このタスクのステップに従い、WebSphere Application Server for Windows のアプリケーション・クライアントがインストールされている Windows プラットフォーム・マシンで Windows のアプリケーション・クライアント・ランタイム依存コンポーネントを作成します。 次に、このタスクのステップを繰り返して、WebSphere Application Server for Linux のアプリケーション・クライアントがインストールされている Linux プラットフォーム・マシンで Linux のアプリケーション・クライアント・ランタイム依存コンポーネントを 作成します。

プロシージャー

  1. クライアント・アプリケーションがサポートするオペレーティング・システムのために WebSphere Application Server のアプリケーション・クライアントをインストールします。

    [Windows] C:¥Program Files¥IBM¥WebSphere¥AppClient ディレクトリーでアプリケーション・クライアントをインストールします。

  2. ディレクトリーをインストール bin ディレクトリーに変更します。
    [Windows] 以下に例を示します。
    CD C:¥Program files¥IBM¥WebSphere¥AppClient¥bin
  3. buildClientRuntime ツールを実行して、一時ディレクトリーにアプリケーション・クライアント・ランタイム JAR ファイルを生成します。これには、Java 2 Runtime Environment、アプリケーション・クライアント・ランタイム・プロパティー、 SSL 鍵ストアおよびトラストストア・ファイル、およびアプリケーション・クライアント・ランタイム・ライブラリー JAR ファイルが含まれます。
    [Windows] 例えば、バージョン 6.1 をご使用の場合:
    buildClientRuntime C:¥WebApp1¥runtime¥WASClient6.1_windows.jar 

    J2EE アプリケーション・クライアントのアプリケーションではなく、 シン・アプリケーション・クライアントのアプリケーションでのみ使用するアプリケーション・クライアント・ランタイム JAR ファイルを作成している場合、アプリケーション・クライアント・ランタイム・ライブラリー JAR ファイルを除くことによって、生成される JAR ファイルのサイズを減らすことができます。 追加のパラメーターが buildClientRuntime ツールに渡されます。

    [Windows] 例えば、バージョン 6.1 をご使用の場合:
    buildClientRuntime C:¥WebApp1¥runtime¥WASClient6.1_windows.jar                    buildThin
    
  4. WebSphereClientRuntimeInstaller.jar ファイルを、上記のステップで生成した JAR ファイルと同じロケーションにコピーします。 この JAR ファイルは、WebSphere Application Server クライアント・インストールの JWS ディレクトリーにあります。
    [Windows] 以下に例を示します。
    copy ..¥JWS¥WebSphereClientRuntimeInstaller.jar   C:¥WebApp1¥runtime
  5. Java 2 SDK jarsigner ユーティリティーを使用して、 上記のステップから作成された JAR ファイルに署名します。
    [Windows] 例えば、バージョン 6.1 をご使用の場合:
    cd C:¥WebApp1¥runtime
    
    jarsigner -keystore myKeystore -storepass myPassword
                    WASClient6.1_windows.jar myKeyAliasName
    
    jarsigner -keystore myKeystore -storepass myPassword
                    WebSphereClientRuntimeInstaller.jar myKeyAliasName
    
    [AIX HP-UX Linux Solaris Windows] [i5/OS]
    1. また、このステップでは、myKeystore などの鍵ストア・ファイルを作成する必要があります。
    2. また、myKeystore ファイルのための自己署名証明書を作成する必要があります。
      注: HP プラットフォームで JAR 署名ツールを実行する場合、 jarsigner コマンドに -J"-Xmx256m" フラグを追加し、 使用可能なヒープ・サイズを増やして、エラー、OutOfMemoryError を防ぎます。 ヘルプについては、 以下の例を参照してください。
      jarsigner -J"-Xmx256m" -keystore myKeystore -storepass myPassword 
                      WebSphereClientRuntimeInstaller.jar myKeyAliasName
  6. アプリケーション・クライアント・ランタイム・インストーラー JNLP 記述子ファイルまたは JavaServer Pages (JSP) ファイルが以前のステップと同じ一時ディレクトリーに動的に生成されている場合、それを作成します。 このトピックの例のセクションにあるサンプルの JNLP ファイルを参照してください。
  7. 2 つの署名された JAR ファイルおよびアプリケーション・クライアント・ランタイム・インストーラー JNLP 記述子ファイルを WAR ファイルにパッケージします。 この WAR ファイルは、アプリケーション・サーバーにデプロイできる EAR ファイルにパッケージされます。

結果

Web アプリケーションで、アプリケーション・クライアント・ランタイムと JRE 環境を提供する準備ができました。

<!-- This sample program applies to WebSphere Application Server, Version 6.1.
It is provided AS IS and may be used, executed, copied and modified 
without royalty payment by customer (a) for its own instruction and study, (b) in order 
to develop applications designed to run with an IBM WebSphere product, either for customer's 
own internal use or for redistribution by customer, as part of such an application, in 
customer's own products.

Product 5630-A36,  (C) COPYRIGHT International Business Machines Corp., 2005
All Rights Reserved * Licensed Materials - Property of IBM
-->

<%-- // to set the Last_Modified header so that the JNLP client will know whether to download
     // the JNLP file again and update the cached copy.
     String jspPath = application.getRealPath(request.getServletPath());
     java.io.File jspFile = new java.io.File(jspPath);
     long lastModified = jspFile.lastModified();
%><%    
      // locally declared variables
      String url=request.getRequestURL().toString(); 
      String jnlpCodeBase=url.substring(0,url.lastIndexOf('/'));
      String jnlpRefURL=url.substring(url.lastIndexOf('/')+1,url.length());

      // Need to set a JNLP mime type - if WebStart is installed on the client,
      // this header will induce the browser to drive the WebStart Client
      response.setContentType("application/x-java-jnlp-file");                            1
      response.setHeader("Cache-Control", null);
      response.setHeader("Set-Cookie", null);
      response.setHeader("Vary", null);
      response.setDateHeader("Last-Modified", lastModified);

      // An installer must reply with the version number for a given install
      if (response.containsHeader("x-java-jnlp-version-id"))
        response.setHeader("x-java-jnlp-version-id", "WASClient6.1.0");               2
      else
        response.addHeader("x-java-jnlp-version-id", "WASClient6.1.0");
%>
     
<?xml version="1.0" encoding="utf-8"?>

<!-- ============================================================== -->
<!-- TODO: change "codebase" to the actual url location of this jsp -->
<!-- ============================================================== -->

<jnlp spec="1.0+" 
codebase="http://YOUR_APP_SERVER:PORTNUMBER/WEBAPP_CONTEXT_ROOT/Runtime/WebSphereJre">

	<information>
  <title>Application Client Java Runtime Environment</title>
  <vendor>IBM</vendor>
  <icon href="icon.gif"/>
  <description>Application Client Java Runtime Environment</description>
  <description kind="short">Application Client JRE</description>
  <description kind="tooltip">Application Client JRE</description>
		  <offline-allowed/>
	</information>

	<security>
	<all-permissions/>
</security>

	<resources>
		<j2se version="1.4+"/><%-- The installer can use any 1.4 JRE --%> 3
 		<jar href="WebSphereClientRuntimeInstaller.jar" main="true"/>	4		

		<!-- JRE version registration with Web Start -->
		<property name="com.ibm.websphere.client.jre.version" value="WASClient6.1.0"/>	5	
	</resources>

	<resources os="Windows">	6	
<!-- ============================================================== -->
<!-- TODO: the property value for unix platform is "java/jre/bin/javaw" -->
<!--   and the "os" value match to your target client machine platform             -->
<!-- ============================================================== -->

			<jar href="WASClient6.1.0_Windows.jar"/>	7	
	
<!-- ============================================================== -->
<!-- TODO:  property value for unix platform is "java/jre/bin/javaw" -->
<!-- ============================================================== -->
<!-- relative path of the jre executable —->

			<property name="com.ibm.websphere.client.jre.launch.java"
	value="java¥jre¥bin¥javaw.exe"/>	8	
	
	</resources>
	<installer-desc main-class="com.ibm.websphere.client.installer.ClientRuntimeInstaller"/>
</jnlp>
  1. ブラウザーが JNLP ファイルを処理できるように、 ファイルを JNLP MIME タイプとして指定します。
  2. 応答として、HTTP ヘッダー・フィールドを以下のように設定して、こ のアプリケーション・クライアント・ランタイム依存コンポーネントの正確なバージョンを指定します: x-java-jnlp-version-id
  3. 必要な JRE バージョンを指定して、インストーラー・プログラムを実行します。
  4. ClientRuntimeInstaller クラスを含む、 インストーラー WebSphereClientRuntimeInstaller.jar ファイルを指定します。
  5. アプリケーション・クライアント・ランタイム依存コンポーネントのバージョンを定義するシステム・プロパティーを指定します。 このバージョンは、JNLP クライアントに登録されています。
  6. 特定プラットフォーム用のリソースを指定します。サポートされるクライアント・アプリケーション・プラットフォームはそれぞれ、独自の JAR ファイルを必要とします。
  7. アプリケーション・クライアント・ランタイム依存コンポーネント JAR ファイルを指定します。
  8. クライアント・アプリケーション用の JVM を開始するために呼び出すプログラムを指定します。

次の作業

Java Web Start 用アプリケーション・クライアント・ランタイム・ライブラリー・コンポーネントの準備



サブトピック
buildClientRuntime ツール
ClientRuntimeInstaller クラス
関連概念
Web アプリケーション
関連タスク
Java Web Start 用アプリケーション・クライアント・ランタイム・ライブラリー・コンポーネントの準備
タスク・トピック    

ご利用条件 | フィードバック

最終更新: Jan 21, 2008 4:10:06 PM EST
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.wsfep.multiplatform.doc/info/ae/ae/tcli_jrerun.html