Strutsフレームワーク
ようこそ
トップページ
キックスタートFAQ
ユーザガイド
リソース
私たちは誰でしょう
ダウンロード
バイナリ
ソースコード
はじめよう
インストール
リリースノート
APIドキュメント
メーリングリスト
バグ データベース
開発者ガイド
Beanタグ
HTMLタグ
Logicタグ
Templateタグ
Digester
Utilities
タグライブラリ ドキュメント
Beanタグ
HTMLタグ
Logicタグ
Templateタグ
現在の開発
インストール(ナイトリビルド)
リリースノート(ナイトリビルド)
APIドキュメント(ナイトリビルド)
ワークフローの提案
TODOリスト
Installing Struts with your servlet container

Strutsをサーブレットコンテナにインストールする

Weblogic 5.1 (service pack 8)

  • Obtain and install the Xerces XML parser (problems have been reported with the Sun reference implementation). Put xerces.jar in your WebLogic system path.

  • Xerces XML パーサーを取得してインストールしてください (Sunのリファレンス実装では問題が発生することがレポートされています)。 WebLogicのシステムパスに xerces.jar を配置してください。
  • Obtain and unpack the Struts binary distribution (this procedure assumes it was extracted to c:\jakarta-struts).

  • Strutsのバイナリディストリビューションを取得して展開してください (この文章は以後、Strutsが c:\jakarta-strutsに配置されていると仮定しています)。
  • Add an entry to weblogic.properties for each of the Struts web applications that you would like to configure. For example, to make the struts-example application available, add the following line to weblogic.properties:
    weblogic.httpd.webApp.strutsexample=
    c:/jakarta-struts/webapps/struts-example.war

  • weblogic.properties に構成したいStruts Webアプリケーションのエントリーを追加してください。 例えばstruts-exampleアプリケーションを動作させるためには、以下の記述を weblogic.properties に追加します:
    weblogic.httpd.webApp.strutsexample=
    c:/jakarta-struts/webapps/struts-example.war
  • You do not need to include struts.jar or any of the application specific classes in the WebLogic classpath, since this will be done automatically (unless deploying an unpacked web archive- see below).

  • struts.jarや他のアプリケーションが必要とするクラスへの参照は自動的に設定されるため、 WebLogicクラスパスに追加する必要はありません (展開してしまったWebアーカイブを配備しない限り - 以下を参照して下さい)。
  • Start WebLogic server and point your web browser to the struts application. For example, to connect to the example application added in step 3:
    http://localhost:7001/strutsexample

  • WebLogicサーバーを起動してWebブラウザからStrutsアプリケーションを参照してください 例えばステップ3で登録したサンプルアプリケーションを参照するためには以下のアドレスにアクセスします:
    http://localhost:7001/strutsexample
  • This example application depends on the Struts specific resource file ApplicationResources.properties to be present on the classpath. However, WebLogic only extracts *.class files from the archive so this file will not be found, resulting in an error the first time it is needed- something similar to: javax.servlet.ServletException: runtime failure in custom tag 'message'. Steps 6 & 7 will need to be performed for this application, and any other that relies on ApplicationResources.properties.

  • このサンプルアプリケーションはクラスパスに置かれるStrutsの詳細情報を記述したリソースファイル ApplicationResources.properties に依存します。 しかしWebLogicは *.class ファイルのみをアーカイブから取り出すのでこのファイルは検出されず、 最初にアクセスしたときには何かが足りないという以下のようなエラーとなります:
    javax.servlet.ServletException: runtime failure in custom tag 'message'
    ステップ6とステップ7はこのアプリケーションや他の ApplicationResources.properties を利用している全てのアプリケーションで必要となります。
  • Extract ApplicationResources.properties from the *.war file, and manually copy it to the respective package in the _tmp_war_ directory WebLogic created for this application. Again referring to the struts-example application, this would be:
    c:\jakarta-struts\webapps\WEB-INF\_tmp_war_strutsexample

  • ApplicationResources.properties を *.war ファイルから取り出し、WebLogicがアプリケーション内に作成する それぞれのパッケージの中の _tmp_war_ ディレクトリに手動でコピーします。 struts-exampleを例にあげると以下のディレクトリとなります:
    c:\jakarta-struts\webapps\WEB-INF\_tmp_war_strutsexample
  • Restart WebLogic. You will now be able to run the application:
    http://localhost:7001/strutsexample

  • WebLogicを再起動してください。以下のアドレスからアプリケーションを動作させることが出来るはずです:
    http://localhost:7001/strutsexample

The above steps should be followed for applications deployed as *.war files. For unpacked web applications, configuration involves adding both struts.jar and /WEB-INF/classes to the WebLogic classpath. For this reason, I would suggest deploying applications as war files to WebLogic. However, the same example application can be successfully deployed in extracted format by modifying weblogic.properties (assuming the war was extracted to directory webapps/struts-example):


ここまでで説明した内容は *.war ファイルとして配備されたアプリケーションの導入方法です。 展開されたままのWebアプリケーションを登録する為には struts.jar/WEB-INF/classes への参照を WebLogic クラスパスに追加しなくてはなりません。 ですので、warファイルとしてWeblogicに配備する方法を推奨します。 しかし、weblogic.propertiesを以下のように編集することによって、同じサンプルアプリケーションを 展開された形で配備することが可能です(warの内容がが webapps/struts-example に展開されたと仮定します):

weblogic.httpd.webApp.strutsexample=
c:/jakarta-struts/webapps/struts-example/

And starting WebLogic with the updated WebLogic classpath. For example:


その後に、更新した WebLogic クラスパスにて WebLogic を起動します。以下はその例です:

c:\jdk1.3\bin\java -ms16m -mx64m
-classpath c:\weblogic\lib\weblogic510sp8boot.jar;


Additional Recommendations


推奨する追加設定

  • Servlet and JSP-Reloading should be turned off. First, you pay a performance penalty. Depending on the number of JSPs, the number of requests and the configured checking interval, the server will slow down. Second, with JSP- and Servlet reloading, one opens the door for various Weblogic classloader problems, that are difficult to diagnose, difficult to handle and often lead to lost HTTP-sessions.

  • ServletとJSPのリロード機能はOFFにしておくべきです。 第1にパフォーマンスの低下を招きます。JSPの数、リクエストの量、 設定の量に比例してサーバーの速度は低下します。 第2にJSPとServletのリロードはさまざまなWeblogicのクラスローダーの問題を引き起こします。 これは調査、再現が難しく、HTTPセッションの切断も招きます。
  • Set the name of the sessionid to JSESSIONID, if cookies are used for session tracking and to jsessionid, if sessions are URL-based. (There are additional problems related to URL-based sessions, caused from BEA's way to encode the session id (J2EE-incompatible) as query-param. Especially <bean:include> will not work with URL-based sessions yet. However, using the correct session name solves at least some problems.)

  • セッショントラッキングにクッキーが使用される場合には JSESSIONIDを、 URLベースの場合には jsessionid を、sessionid の名前として設定してください。 (更に、セッションIDをクエリパラメータとしてエンコードしてしまうBEA独自実装(J2EE-非準拠) によって引き起こされる、URLベースのセッションに関わる問題も存在します。 特に <bean:include> はURLベースのセッションでは現状動作しません。 しかし、正しいセッション名を使用することによって少なくともいくつかの問題は解決できます。)
  • Configure the JSP-Servlet registration in weblogic.properties for maximum J2EE-compliance and/or for maximum performance.

  • weblogic.properties内のJSP-Servletの登録方法を最大限に J2EE に準拠しつつ(/または) 最大限のパフォーマンスが出るように設定します。

The JSP-Servlet supports some initialization parameters that can be customized to get best performance, maximum compliance or (as shown below) easier debugging:


JSP-Servletはいくつかの初期化パラメータをサポートしていて、 より良いパフォーマンスを得たり、最大限に仕様に準拠させたり、(下記のように)デバッグをし易くするようにカスタマイズすることができます:

  weblogic.httpd.initArgs.*.jsp=\
       pageCheckSeconds=-1,\
        setEmptyStrings=false,\
         compileCommand=./_jspCompiler_.cmd,\
             workingDir=/weblogic/myserver/tmp_classfiles,\
          keepgenerated=true,\
                  debug=true,\
                verbose=true

In the above example, the batch file (_jspCompiler_.cmd) invokes jikes which results dramatically reduced startup times (jikes is about three times faster than javac.) The batchfile contains only a single line:


上記の例ではバッチファイル (_jspCompiler_.cmd) によって、劇的に起動時間の早い jikes に処理を依頼しています。 (jikesはIBMの公開しているJavaコンパイラで約3倍javacよりも速いといわれています) このバッチファイルには以下の1行のみを記述します:

@jikes -g -nowarn %*

The next configuration could be used when all tests have been done and speed is the major concern ...

以下の設定は、全てのテストが完了してスピードが第一用件となった時には有用かもしれません...


  
  weblogic.httpd.initArgs.*.jsp=\
       pageCheckSeconds=-1,\
        setEmptyStrings=false,\
         compileCommand=./_jspCompiler_.cmd,\
             workingDir=/weblogic/myserver/tmp_classfiles,\
          keepgenerated=false,\
                  debug=false,\
                verbose=false

... together with ...


... 下記バッチファイルとともに ...

@jikes -O -nowarn %*

Weblogic supports similar settings through <context-params> in web.xml (Please read the latest documentation at the BEA website for details.)


Weblogicはこれに似た設定を web.xml の中の <context-params> でサポートしています。 (詳細な内容についてはBEAWebサイトの最新のドキュメントを参照して下さい)

For additional issues, see also More fixes for WLS 5.1 SP8 from the Struts Developer mailing list


Struts開発者メーリングリスト内のMore fixes for WLS 5.1 SP8 に、追加情報がありますので参照してください。


  • 著者: Robert Hayden
  • 著者: Wong Kok Kai
  • 著者: Matthias Kerkhoff

インストールへ戻る


[訳注: これは日置 聡が翻訳しました。日本語訳に対するコメントがあれば、こちらに送って下さい。]
Copyright (c) 2000-2002, Apache Software Foundation