Jul 30, 2007

[Trac] 既存の Trac 0.9 のデータを Trac 0.10 に移行する

既存の Trac 0.9 環境を Trac 0.10 に移行したときの作業メモ。

yum でインストールして、trac-admin で既存データの upgrade を行うだけ。

# yum update trac.noarch
Loading "installonlyn" plugin
Setting up Update Process
Setting up repositories
    (SNIP)
Updated: trac.noarch 0:0.10.3.1-2.fc5
Complete!
# trac-admin /home/trac/myproject hotcopy /home/trac/myproject.backup
Hotcopying /home/trac/myproject to /home/trac/myproject.20070801 ... Hotcopy done.
# trac-admin /usr/local/beattrac upgrade --no-backup
Upgrade done.
# trac-admin /usr/local/beattrac wiki upgrade
 /usr/share/trac/wiki-default/TracGuide => TracGuide
  TracGuide already up to date.
 /usr/share/trac/wiki-default/TracBackup => TracBackup
 /usr/share/trac/wiki-default/TracRoadmap => TracRoadmap
 /usr/share/trac/wiki-default/TracIni => TracIni
 /usr/share/trac/wiki-default/TracAccessibility => TracAccessibility
 /usr/share/trac/wiki-default/TracUnicode => TracUnicode
 /usr/share/trac/wiki-default/TracInstall => TracInstall
 /usr/share/trac/wiki-default/TracEnvironment => TracEnvironment
 /usr/share/trac/wiki-default/InterMapTxt => InterMapTxt
 /usr/share/trac/wiki-default/TracQuery => TracQuery
 /usr/share/trac/wiki-default/TracReports => TracReports
 /usr/share/trac/wiki-default/TitleIndex => TitleIndex
  TitleIndex already up to date.
 /usr/share/trac/wiki-default/TracTicketsCustomFields => TracTicketsCustomFields
 /usr/share/trac/wiki-default/WikiPageNames => WikiPageNames
 /usr/share/trac/wiki-default/TracUpgrade => TracUpgrade
 /usr/share/trac/wiki-default/TracRss => TracRss
 /usr/share/trac/wiki-default/RecentChanges => RecentChanges
  RecentChanges already up to date.
 /usr/share/trac/wiki-default/WikiProcessors => WikiProcessors
 /usr/share/trac/wiki-default/TracSyntaxColoring => TracSyntaxColoring
 /usr/share/trac/wiki-default/TracPlugins => TracPlugins
 /usr/share/trac/wiki-default/TracPermissions => TracPermissions
 /usr/share/trac/wiki-default/TracChangeset => TracChangeset
 /usr/share/trac/wiki-default/TracRevisionLog => TracRevisionLog
 /usr/share/trac/wiki-default/TracFastCgi => TracFastCgi
 /usr/share/trac/wiki-default/TracTickets => TracTickets
 /usr/share/trac/wiki-default/TracLogging => TracLogging
  TracLogging already up to date.
 /usr/share/trac/wiki-default/WikiFormatting => WikiFormatting
 /usr/share/trac/wiki-default/TracLinks => TracLinks
 /usr/share/trac/wiki-default/TracTimeline => TracTimeline
 /usr/share/trac/wiki-default/TracSearch => TracSearch
 /usr/share/trac/wiki-default/CamelCase => CamelCase
 /usr/share/trac/wiki-default/TracBrowser => TracBrowser
 /usr/share/trac/wiki-default/TracImport => TracImport
 /usr/share/trac/wiki-default/WikiHtml => WikiHtml
 /usr/share/trac/wiki-default/TracWiki => TracWiki
 /usr/share/trac/wiki-default/TracCgi => TracCgi
 /usr/share/trac/wiki-default/TracStandalone => TracStandalone
 /usr/share/trac/wiki-default/WikiMacros => WikiMacros
 /usr/share/trac/wiki-default/TracInterfaceCustomization => TracInterfaceCustomization
 /usr/share/trac/wiki-default/TracModPython => TracModPython
 /usr/share/trac/wiki-default/WikiRestructuredTextLinks => WikiRestructuredTextLinks
 /usr/share/trac/wiki-default/TracNotification => TracNotification
 /usr/share/trac/wiki-default/TracSupport => TracSupport
 /usr/share/trac/wiki-default/WikiRestructuredText => WikiRestructuredText
 /usr/share/trac/wiki-default/InterWiki => InterWiki
 /usr/share/trac/wiki-default/TracAdmin => TracAdmin
 /usr/share/trac/wiki-default/SandBox => SandBox
  SandBox already up to date.
 /usr/share/trac/wiki-default/WikiNewPage => WikiNewPage
 /usr/share/trac/wiki-default/WikiDeletePage => WikiDeletePage
 /usr/share/trac/wiki-default/InterTrac => InterTrac
#

Posted in Trac | このエントリーをはてなブックマークに追加 | この記事をクリップ! livedoor クリップ |

Jul 26, 2007

[Trac] 静的リソースの trac.ini での指定方法

Trac の静的リソースには、個々の Trac インスタンス毎のものと、同一サーバ上の全 Trac から参照されるものの二種類がある。 それぞれストレージ上の設置場所が異なるので、trac.ini では指定方法をかえなければならない。 今回はロゴを変更したかったので、Trac インスタンス単位のリソースとして画像を設置してみた。

静的リソースの trac.ini での指定方法

Trac インスタンス毎のリソース
ストレージの "/usr/share/trac/htdocs/" が trac.ini の "common/" に相当する。
全 Trac から参照されるのリソース
ストレージの "$TRAC_ENVIRONMENT_HOME/htdocs/" が trac.ini の "site/" に相当する。
http://www.example.com/trac/wiki/TracInterfaceCustomization

Change the src setting to site/ followed by the name of your image file. The width and height settings should be modified to match your image's dimensions (the Trac chrome handler uses "site/" for files within the project directory htdocs and "common/" for the common ones).

ロゴの登録方法

$TRAC_ENVIRONMENT_HOME/htdocs/logo.png という名前でロゴ画像を設置し、trac.ini に

[header_logo]
height = -1
link = site/logo.png
を指定する。

Posted in Trac | このエントリーをはてなブックマークに追加 | この記事をクリップ! livedoor クリップ |

Jul 24, 2007

[Apple] Mac 用アプリケーションメモ

生まれて初めて Mac OS を使い始めたわけだが。 とりあえず困るのは Windows で手に馴染んでいたアプリケーションの代わりになるものがあるかどうかということ。 というわけで、知り合いの Mac OS 使いの方の助力を仰いで、Windows で良く使うアプリケーションの Mac OS 版(?) を教えてもらった。

Jedit X ( ← 秀丸エディタ)
http://www.artman21.net/product/JeditX/index.html
シイラ ( ← Sleipnir)
http://shiira.jp/
Fugu ( ← WinScp)
http://rsug.itd.umich.edu/software/fugu/
TinkerTool ( ← 窓の手)
http://www.bresink.de/osx/TinkerTool.html

Posted in Apple | このエントリーをはてなブックマークに追加 | この記事をクリップ! livedoor クリップ |

Jul 20, 2007

[Trac] Trac チケット起票時の "Assign to" フィールドをコンボボックス化する

Trac のチケットを起票する際、デフォルトでは "Assign to" フィールドは TextField になっている。 そのため、担当者のアカウント名を調べて入力するという作業が必要になる。 これが意外と面倒なので、"Assign to" を選択式に設定してみた。

設定方法

設定は非常に簡単。 $TRAC_HOME/myproject/conf/trac.ini の [ticket] セクションにある restrict_owner を false → true に変更するだけ。 この設定はデフォルトで false になっている。

[ticket]
restrict_owner = true

詳細情報

Trac の Help から関連情報を転載。 コンボボックスにプロジェクトメンバーが表示されない場合、下記の通り当該メンバーに Setting の変更などを行ってもらい、Trac セッションを作成する必要がある。

Assign-to as Drop-Down List
If the list of possible ticket owners is finite, you can change the assign-to ticket field from a text input to a drop-down list. This is done by setting the restrict_owner option of the [ticket] section in trac.ini to “true”. In that case, Trac will use the list of all users who have logged in and set their email address to populate the drop-down field.
To appear in the dropdown list, a user needs be registered with the project, i.e. a user session should exist in the database. Such an entry is automatically created in the database the first time the user submits a change in the project, for example when editing the user's details in the Settings page. Also, the user must have TICKET_MODIFY permissions.

Posted in Trac | このエントリーをはてなブックマークに追加 | この記事をクリップ! livedoor クリップ |

Jul 19, 2007

[Trac] Trac の XML-RPC API にチャレンジ

Trac XML-RPC Plugin
http://trac-hacks.org/wiki/XmlRpcPlugin
root/xmlrpcplugin/0.10/tracrpc/api.py
http://trac-hacks.org/browser/xmlrpcplugin/0.10/tracrpc/api.py

Trac 0.10.3 の XML-RPC API

Trac XML-RPC Plugin を導入すると、http://example.com/mytrac/xmlrpc (Trac のトップ画面の URL に /xmlrpc を付加する)で API を閲覧することができる。 Trac 0.10.3 に 0.10 用の XML-RPC Plugin を導入した環境では下記の API が使用できる。


wiki
Function Description Permission required
struct wiki.getRecentChanges(dateTime.iso8601 since) Get list of changed pages since timestamp WIKI_VIEW
int wiki.getRPCVersionSupported() Returns 2 with this version of the Trac API. WIKI_VIEW
string wiki.getPage(string pagename, int version=None) Get the raw Wiki text of page, latest version. WIKI_VIEW
string wiki.getPageVersion(string pagename, int version=None) Get the raw Wiki text of page, latest version. WIKI_VIEW
string wiki.getPageHTML(string pagename, int version=None) Return page in rendered HTML, latest version. WIKI_VIEW
string wiki.getPageHTMLVersion(string pagename, int version=None) Return page in rendered HTML, latest version. WIKI_VIEW
array wiki.getAllPages() Returns a list of all pages. The result is an array of utf8 pagenames. WIKI_VIEW
struct wiki.getPageInfo(string pagename, int version=None) Returns information about the given page. WIKI_VIEW
struct wiki.getPageInfoVersion(string pagename, int version=None) Returns information about the given page. WIKI_VIEW
boolean wiki.putPage(string pagename, string content, struct attributes) writes the content of the page. WIKI_CREATE
array wiki.listAttachments(string pagename) Lists attachments on a given page. WIKI_VIEW
base64 wiki.getAttachment(string path) returns the content of an attachment. WIKI_VIEW
boolean wiki.putAttachment(string path, base64 data) (over)writes an attachment. Returns True if successful.This method is compatible with WikiRPC. putAttachmentEx has a more extensive set of (Trac-specific) features. WIKI_MODIFY
boolean wiki.putAttachmentEx(string pagename, string filename, string description, base64 data, boolean replace=True) Attach a file to a Wiki page. Returns the (possibly transformed) filename of the attachment. Use this method if you don't care about WikiRPC compatibility. WIKI_MODIFY
boolean wiki.deleteAttachment(string path) Delete an attachment. WIKI_DELETE
array wiki.listLinks(string pagename) Not implemented WIKI_VIEW
string wiki.wikiToHtml(string text) Render arbitrary Wiki text as HTML. WIKI_VIEW

search - Search Trac.
Function Description Permission required
array search.getSearchFilters() Retrieve a list of search filters with each element in the form (name, description). SEARCH_VIEW
array search.performSearch(string query, array filters=[]) Perform a search using the given filters. Defaults to all if not provided. Results are returned as a list of tuples in the form (href, title, date, author, excerpt). SEARCH_VIEW

ticket.milestone - Interface to ticket milestone objects.
Function Description Permission required
array ticket.milestone.getAll() Get a list of all ticket milestone names. TICKET_VIEW
struct ticket.milestone.get(string name) Get a ticket milestone. TICKET_VIEW
int ticket.milestone.delete(string name) Delete a ticket milestone TICKET_ADMIN
int ticket.milestone.create(string name, struct attributes) Create a new ticket milestone with the given attributes. TICKET_ADMIN
int ticket.milestone.update(string name, struct attributes) Update ticket milestone with the given attributes. TICKET_ADMIN

ticket.severity - Interface to ticket severity.
Function Description Permission required
array ticket.severity.getAll() Get a list of all ticket severity names. TICKET_VIEW
string ticket.severity.get(string name) Get a ticket severity. TICKET_VIEW
int ticket.severity.delete(string name) Delete a ticket severity TICKET_ADMIN
int ticket.severity.create(string name, string value) Create a new ticket severity with the given value. TICKET_ADMIN
int ticket.severity.update(string name, string value) Update ticket severity with the given value. TICKET_ADMIN

ticket.type - Interface to ticket type.
Function Description Permission required
array ticket.type.getAll() Get a list of all ticket type names. TICKET_VIEW
string ticket.type.get(string name) Get a ticket type. TICKET_VIEW
int ticket.type.delete(string name) Delete a ticket type TICKET_ADMIN
int ticket.type.create(string name, string value) Create a new ticket type with the given value. TICKET_ADMIN
int ticket.type.update(string name, string value) Update ticket type with the given value. TICKET_ADMIN

system - Core of the XML-RPC system.
Function Description Permission required
array system.multicall(array signatures) Takes an array of XML-RPC calls encoded as structs of the form (in a Pythonish notation here): {'methodName': string, 'params': array} XML_RPC
array system.listMethods() This method returns a list of strings, one for each (non-system) method supported by the XML-RPC server. XML_RPC
string system.methodHelp(string method) This method takes one parameter, the name of a method implemented by the XML-RPC server. It returns a documentation string describing the use of that method. If no such string is available, an empty string is returned. The documentation string may contain HTML markup. XML_RPC
array system.methodSignature(string method) This method takes one parameter, the name of a method implemented by the XML-RPC server. It returns an array of possible signatures for this method. A signature is an array of types. The first of these types is the return type of the method, the rest are parameters. XML_RPC
array system.getAPIVersion() Returns a list with two elements. First element is the major version number, second is the minor. Changes to the major version indicate API breaking changes, while minor version changes are simple additions, bug fixes, etc. XML_RPC

ticket.resolution - Interface to ticket resolution.
Function Description Permission required
array ticket.resolution.getAll() Get a list of all ticket resolution names. TICKET_VIEW
string ticket.resolution.get(string name) Get a ticket resolution. TICKET_VIEW
int ticket.resolution.delete(string name) Delete a ticket resolution TICKET_ADMIN
int ticket.resolution.create(string name, string value) Create a new ticket resolution with the given value. TICKET_ADMIN
int ticket.resolution.update(string name, string value) Update ticket resolution with the given value. TICKET_ADMIN

ticket.priority - Interface to ticket priority.
Function Description Permission required
array ticket.priority.getAll() Get a list of all ticket priority names. TICKET_VIEW
string ticket.priority.get(string name) Get a ticket priority. TICKET_VIEW
int ticket.priority.delete(string name) Delete a ticket priority TICKET_ADMIN
int ticket.priority.create(string name, string value) Create a new ticket priority with the given value. TICKET_ADMIN
int ticket.priority.update(string name, string value) Update ticket priority with the given value. TICKET_ADMIN

ticket.component - Interface to ticket component objects.
Function Description Permission required
array ticket.component.getAll() Get a list of all ticket component names. TICKET_VIEW
struct ticket.component.get(string name) Get a ticket component. TICKET_VIEW
int ticket.component.delete(string name) Delete a ticket component TICKET_ADMIN
int ticket.component.create(string name, struct attributes) Create a new ticket component with the given attributes. TICKET_ADMIN
int ticket.component.update(string name, struct attributes) Update ticket component with the given attributes. TICKET_ADMIN

ticket.version - Interface to ticket version objects.
Function Description Permission required
array ticket.version.getAll() Get a list of all ticket version names. TICKET_VIEW
struct ticket.version.get(string name) Get a ticket version. TICKET_VIEW
int ticket.version.delete(string name) Delete a ticket version TICKET_ADMIN
int ticket.version.create(string name, struct attributes) Create a new ticket version with the given attributes. TICKET_ADMIN
int ticket.version.update(string name, struct attributes) Update ticket version with the given attributes. TICKET_ADMIN

ticket - An interface to Trac's ticketing system.
Function Description Permission required
array ticket.query(string qstr="status!=closed") Perform a ticket query, returning a list of ticket ID's. TICKET_VIEW
array ticket.getRecentChanges(dateTime.iso8601 since) Returns a list of IDs of tickets that have changed since timestamp. TICKET_VIEW
array ticket.getAvailableActions(int id) Returns the actions that can be performed on the ticket. TICKET_VIEW
array ticket.get(int id) Fetch a ticket. Returns [id, time_created, time_changed, attributes]. TICKET_VIEW
int ticket.create(string summary, string description, struct attributes={}, boolean notify=False) Create a new ticket, returning the ticket ID. TICKET_CREATE
array ticket.update(int id, string comment, struct attributes={}, boolean notify=False) Update a ticket, returning the new ticket in the same form as getTicket(). TICKET_APPEND
int ticket.delete(int id) Delete ticket with the given id. TICKET_ADMIN
struct ticket.changeLog(int id, int when=0) Return the changelog as a list of tuples of the form (time, author, field, oldvalue, newvalue, permanent). While the other tuple elements are quite self-explanatory, the permanent flag is used to distinguish collateral changes that are not yet immutable (like attachments, currently). TICKET_VIEW
array ticket.listAttachments(int ticket) Lists attachments for a given ticket. Returns (filename, description, size, time, author) for each attachment. TICKET_VIEW
base64 ticket.getAttachment(int ticket, string filename) returns the content of an attachment. TICKET_VIEW
string ticket.putAttachment(int ticket, string filename, string description, base64 data, boolean replace=True) Add an attachment, optionally (and defaulting to) overwriting an existing one. Returns filename. TICKET_APPEND
boolean ticket.deleteAttachment(int ticket, string filename) Delete an attachment. TICKET_ADMIN
array ticket.getTicketFields() Return a list of all ticket fields fields. TICKET_VIEW

ticket.status - Interface to ticket status.
Function Description Permission required
array ticket.status.getAll() Get a list of all ticket status names. TICKET_VIEW
string ticket.status.get(string name) Get a ticket status. TICKET_VIEW
int ticket.status.delete(string name) Delete a ticket status TICKET_ADMIN
int ticket.status.create(string name, string value) Create a new ticket status with the given value. TICKET_ADMIN
int ticket.status.update(string name, string value) Update ticket status with the given value. TICKET_ADMIN

Java から Trac XML-RPC API にアクセスしてみる

試しに Java から Trac 上の Ticket を取得してみた。 ライブラリをインストールするのが面倒だったので、自前で HTTP コネクションを張っている。

サンプルコード

public void testTracApi() throws Exception {

  URL url = new URL("http://example.com/trac/xmlrpc");
  HttpURLConnection con = (HttpURLConnection) url.openConnection();
  con.setDoOutput(true);
  con.setDoInput(true);
  con.setRequestMethod("POST");
  con.addRequestProperty("content-type", "text/xml");
  OutputStream os = null;

  try {
    os = con.getOutputStream();
    String request = 
      "<methodCall>\n" + 
      "  <methodName>ticket.get</methodName>\n" +
      "  <params>" + 
      "  <param><value><int>3</int></value></param>" + 
      "  </params>" + 
      "</methodCall>\n";
    os.write(request.getBytes());
  } finally {
    if (os != null) {
      os.close();
    }
  }

  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  InputStream is = null;
  try {
    is = con.getInputStream();
    int ch = 0;
    while ((ch = is.read()) >= 0) {
      baos.write(ch);
    }
  } finally {
    if (is != null) {
      is.close();
    }
  }

  System.out.println("" + baos.toString("UTF-8"));
}

レスポンス

<?xml version='1.0'?>
<methodResponse>
<params>
<param>
<value><array><data>
<value><int>3</int></value>
<value><int>1179403566</int></value>
<value><int>1179403566</int></value>
<value><struct>
<member>
<name>status</name>
<value><string>new</string></value>
</member>
<member>
<name>description</name>
<value><string>基本的な設定を行う。</string></value>
</member>
<member>
<name>reporter</name>
<value><string>et</string></value>
</member>
<member>
<name>cc</name>
<value><string></string></value>
</member>
<member>
<name>resolution</name>
<value><string></string></value>
</member>
<member>
<name>component</name>
<value><string>Continuum</string></value>
</member>
<member>
<name>summary</name>
<value><string>Continuum 設定</string></value>
</member>
<member>
<name>priority</name>
<value><string>major</string></value>
</member>
<member>
<name>keywords</name>
<value><string></string></value>
</member>
<member>
<name>version</name>
<value><string></string></value>
</member>
<member>
<name>milestone</name>
<value><string>[Continuum] M1</string></value>
</member>
<member>
<name>owner</name>
<value><string>me</string></value>
</member>
<member>
<name>type</name>
<value><string>task</string></value>
</member>
</struct></value>
</data></array></value>
</param>
</params>
</methodResponse>

Posted in Trac | このエントリーをはてなブックマークに追加 | この記事をクリップ! livedoor クリップ |

Jul 18, 2007

[WebService] XML-RPC 用 JavaScript ライブラリ

JavaScript で XML-RPC をサポートするライブラリをメモ。 結構揃っているので、クロスブラウザ、クロスプラットフォームの品質が高いものもありそう。

Mimic XML-RPC Client for Java Script(GPL)
http://sourceforge.net/projects/mimic-xmlrpc/
jsxmlRPC(BSD License)
http://sourceforge.net/projects/jsxmlrpc/
JS-RPC Client(GPL)
http://sourceforge.net/projects/jsrpc/
XML-RPC in Mozilla(Mozilla Public License)
http://www.mozilla.org/projects/xmlrpc/
vcXMLRPC(GPL)
http://www.vcdn.org/Public/XMLRPC/
Jamritas(独自ライセンス)
http://jamritas.sourceforge.net/
jsolait(LGPL)
http://jsolait.net/

Posted in WebService | このエントリーをはてなブックマークに追加 | この記事をクリップ! livedoor クリップ |

Jul 17, 2007

[WebService] XML-RPC メモ

XML-RPC に関する情報をメモ。 例によって Google 先生の覚えが良いものを適当に列挙しただけ。 技術資料をざっと眺めてみたが、単純なので実装はかなり簡単そう。

技術資料

XML-RPC.com
http://www.xmlrpc.com/
XML-RPC Specification
http://www.xmlrpc.com/spec
Wikipedia - XML-RPC
http://ja.wikipedia.org/wiki/XML-RPC
XML-RPC for Newbies
http://www.scripting.com/davenet/1998/07/14/xmlRpcForNewbies.html
XML-RPC HOWTO
http://www.linux.or.jp/JF/JFdocs/XML-RPC-HOWTO/

XML-RPC が使用できる公開サービス

XEP-0009: Jabber-RPC
http://www.xmpp.org/extensions/xep-0009.html
Movable Type で使える XML-RPC API
http://www.na.rim.or.jp/~tsupo/program/blogTool/mt_xmlRpc.html
tDiary ドキュメント - xmlrpc.rb
http://docs.tdiary.org/ja/?xmlrpc.rb
XML-RPC for Wiki (FreeStyle Wiki 用の XML-RPC モジュール)
http://www.donzoko.net/cgi/fswiki_xmlrpc/
郵便専門ネットを XML-RPC で活用する
http://yubin.senmon.net/service/xmlrpc.html

XML-RPC 用ライブラリ(Java)

Apache XML-RPC
http://ws.apache.org/xmlrpc/
Crispy
http://sourceforge.net/projects/crispy/

Posted in WebService | このエントリーをはてなブックマークに追加 | この記事をクリップ! livedoor クリップ |

Jul 16, 2007

[AS] JBoss AS 4.2.0 の Windows サービス化にチャレンジ

JBoss AS 4.2.0 を Windows サービスとして登録する方法をメモ。 Getting Started with JBoss 4.0Running as a Service の情報が古く、少々戸惑ったが Java Service Wrapper を使用することで無事 JBoss AS 4.2.0 を Windows サービスとして登録できた。

Java Service Wrapper
http://wrapper.tanukisoftware.org/doc/english/integrate-simple-win.html
RunJBossAsAServiceOnWindows
http://jboss.org/wiki/Wiki.jsp?page=RunJBossAsAServiceOnWindows
Running Jboss as a Windows Service
http://www.theserverside.com/discussions/thread.tss?thread_id=21279

Java Service Wrapper を JBoss AS 4.2.0 にコピー

まず、Java Service Wrapper を %JBOSS_HOME% にコピーする。

> copy %WRAPPER_HOME%\bin\Wrapper.exe %JBOSS_HOME%\bin\
> copy %WRAPPER_HOME%\src\bin\App.bat.in %JBOSS_HOME%\bin\
> move %JBOSS_HOME%\bin\App.bat.in %JBOSS_HOME%\bin\JBoss.bat
> copy %WRAPPER_HOME%\src\bin\InstallApp-NT.bat.in %JBOSS_HOME%\bin\
> move %JBOSS_HOME%\bin\InstallApp-NT.bat.in %JBOSS_HOME%\bin\InstallJBoss-NT.bat
> copy %WRAPPER_HOME%\src\bin\UninstallApp-NT.bat.in %JBOSS_HOME%\bin\
> move %JBOSS_HOME%\bin\UninstallApp-NT.bat.in %JBOSS_HOME%\bin\UninstallJBoss-NT.bat
> copy %WRAPPER_HOME%\lib\Wrapper.DLL %JBOSS_HOME%\lib\
> copy %WRAPPER_HOME%\lib\wrapper.jar %JBOSS_HOME%\lib\
> md %JBOSS_HOME%\conf
> copy %WRAPPER_HOME%\src\conf\wrapper.conf.in %JBOSS_HOME%\conf\
> move %JBOSS_HOME%\src\conf\wrapper.conf.in %JBOSS_HOME%\conf\wrapper.conf

Java Service Wrapper の設定

%JBOSS_HOME%\conf\wrapper.conf を編集する。

#********************************************************************
# Wrapper Properties
#********************************************************************
# Java Application
wrapper.java.command=c:/jdk1.5.0_12/bin/java

# Java Main class.  This class must implement the WrapperListener interface
#  or guarantee that the WrapperManager class is initialized.  Helper
#  classes are provided to do this for you.  See the Integration section
#  of the documentation for details.
wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp

# Java Classpath (include wrapper.jar)  Add class path elements as
#  needed starting from 1
wrapper.java.classpath.1=c:/jboss-4.2.0.GA/lib/wrapper.jar
wrapper.java.classpath.2=c:/jdk1.5.0_12/lib/tools.jar
wrapper.java.classpath.3=./run.jar

# Java Library Path (location of Wrapper.DLL or libwrapper.so)
wrapper.java.library.path.1=c:/jboss-4.2.0.GA/lib

# Java Additional Parameters
wrapper.java.additional.1=-server

# Initial Java Heap Size (in MB)
#wrapper.java.initmemory=3

# Maximum Java Heap Size (in MB)
#wrapper.java.maxmemory=64

# Application parameters.  Add parameters as needed starting from 1
wrapper.app.parameter.1=org.jboss.Main
wrapper.app.parameter.2=-b 0.0.0.0

#********************************************************************
# Wrapper Logging Properties
#********************************************************************
# Format of output for the console.  (See docs for formats)
wrapper.console.format=PM

# Log Level for console output.  (See docs for log levels)
wrapper.console.loglevel=INFO

# Log file to use for wrapper output logging.
wrapper.logfile=c:/jboss-4.2.0.GA/server/default/log/wrapper.log

# Format of output for the log file.  (See docs for formats)
wrapper.logfile.format=LPTM

# Log Level for log file output.  (See docs for log levels)
wrapper.logfile.loglevel=INFO

# Maximum size that the log file will be allowed to grow to before
#  the log is rolled. Size is specified in bytes.  The default value
#  of 0, disables log rolling.  May abbreviate with the 'k' (kb) or
#  'm' (mb) suffix.  For example: 10m = 10 megabytes.
wrapper.logfile.maxsize=0

# Maximum number of rolled log files which will be allowed before old
#  files are deleted.  The default value of 0 implies no limit.
wrapper.logfile.maxfiles=0

# Log Level for sys/event log output.  (See docs for log levels)
wrapper.syslog.loglevel=NONE

#********************************************************************
# Wrapper Windows Properties
#********************************************************************
# Title to use when running as a console
wrapper.console.title=JBoss Server

#********************************************************************
# Wrapper Windows NT/2000/XP Service Properties
#********************************************************************
# WARNING - Do not modify any of these properties when an application
#  using this configuration file has been installed as a service.
#  Please uninstall the service before modifying this section.  The
#  service can then be reinstalled.

# Name of the service
wrapper.ntservice.name=JBoss

# Display name of the service
wrapper.ntservice.displayname=JBoss Server

# Description of the service
wrapper.ntservice.description=JBoss Server

# Service dependencies.  Add dependencies as needed starting from 1
wrapper.ntservice.dependency.1=

# Mode in which the service is installed.  AUTO_START or DEMAND_START
wrapper.ntservice.starttype=AUTO_START

# Allow the service to interact with the desktop.
wrapper.ntservice.interactive=false
Java Service Wrapper の JMX サービスを JBoss AS に登録

%JBOSS_HOME%\server\default\deploy\java-service-wrapper-service.xml を作成する。

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE server>
<server>
    <mbean code="org.tanukisoftware.wrapper.jmx.WrapperManager"
           name="JavaServiceWrapper:service=WrapperManager"/>
    
    <mbean code="org.tanukisoftware.wrapper.jmx.WrapperManagerTesting"
           name="JavaServiceWrapper:service=WrapperManagerTesting"/>
</server>

JBoss AS 4.2.0 を Windows サービスとして登録

> cd %JBOSS_HOME%\bin
> InstallJBoss-NT.bat
  

JBoss AS 4.2.0 の起動と停止

起動は下記のコマンドで行う。

> net start JBoss
停止は下記のコマンドで行う。
> net stop JBoss

Posted in AS | このエントリーをはてなブックマークに追加 | この記事をクリップ! livedoor クリップ |

Jul 14, 2007

[Library] Ant から Subversion へのアクセスにチャレンジ

チャレンジというほどのものでもない。 単に SvnAnt を使ってみただけ。 Ant 1.7.0 と簡単に連携できた。 これは便利。 ちょっと Ant で簡単なスクリプトを書くときに重宝しそう。

SvnAnt
http://subclipse.tigris.org/svnant.html
Apache Ant
http://ant.apache.org/

build.xml

<?xml version="1.0" encoding="UTF-8"?>

<project name="my project" default="checkout" basedir=".">

  <property name="workspace.dir" value="c:\workspace\myproject" />
  <property name="svn.userid"    value="scott" />
  <property name="svn.password"  value="tiger" />
  <property name="svn.url"       value="https://svn.example.com/svn/myproject/trunk" />
  <property name="svn.revision"  value="HEAD" />

  <path id="svnant.class.path">
    <fileset dir="${env.ANT_HOME}/antsvn/">
      <include name="*.jar" />
    </fileset>
  </path>

  <typedef resource="org/tigris/subversion/svnant/svnantlib.xml"
           classpathref="svnant.class.path"/>

  <target name="checkout">
    <delete dir="${workspace.dir}" />
    <mkdir dir="${workspace.dir}" />
    <svn username="${svn.userid}"
         password="${svn.password}">
      <checkout url="${svn.url}"
                revision="${svn.revision}"
                destPath="${workspace.dir}" />
    </svn>
  </target>
</project>

Posted in Library | このエントリーをはてなブックマークに追加 | この記事をクリップ! livedoor クリップ |

Jul 10, 2007

[Library] Apache Struts の Upgrade 方法をメモ

既存アプリケーションで使用している Apache Struts を Upgrade するときに便利なドキュメントがあったのでメモ。

StrutsUpgradeNotes10to12
http://wiki.apache.org/struts/StrutsUpgradeNotes10to12
StrutsUpgradeNotes11to124
http://wiki.apache.org/struts/StrutsUpgradeNotes11to124
StrutsUpgradeNotes124to127
http://wiki.apache.org/struts/StrutsUpgradeNotes124to127
StrutsUpgradeNotes127to128
http://wiki.apache.org/struts/StrutsUpgradeNotes127to128
StrutsUpgradeNotes128to129
http://wiki.apache.org/struts/StrutsUpgradeNotes128to129
StrutsUpgradeNotes12to13
http://wiki.apache.org/struts/StrutsUpgradeNotes12to13

Posted in Library | このエントリーをはてなブックマークに追加 | この記事をクリップ! livedoor クリップ |

Jul 05, 2007

[AS] JBoss AS 4.2.x に外部(loopback外)からアクセスする方法

JBoss AS 4.2.x はデフォルト状態では loopback address 以外からのアクセスを受け付けない様、仕様が変更されたらしい。 loopback address 以外から接続する場合は起動時に "-b" オプションを指定する必要がある。 Release Notes には書いてあるけれど、こういう影響の大きい変更はもう少し派手に情宣して欲しいな・・・。

JBoss AS 4.2.0.GA Release Notes
http://sourceforge.net/project/shownotes.php?group_id=22866&release_id=507793
JBossAS now binds its services to localhost (127.0.0.1) *by default*, instead of binding to all available interfaces (0.0.0.0). This was primarily done for security reasons because of concerns of users going to production without having secured their servers properly. To enable remote access by binding JBoss services to a particular interface, simply run jboss with the -b option, but be aware you still need to secure you server properly.

> run.bat --help

usage: run.bat [options]

options:
    -h, --help                    Show this help message
    -V, --version                 Show version information
    --                            Stop processing options
    -D<name>[=<value>]            Set a system property
    -d, --bootdir=<dir>           Set the boot patch directory; Must be absolute or url
    -p, --patchdir=<dir>          Set the patch directory; Must be absolute or url
    -n, --netboot=<url>           Boot from net with the given url as base
    -c, --configuration=<name>    Set the server configuration name
    -B, --bootlib=<filename>      Add an extra library to the front bootclasspath
    -L, --library=<filename>      Add an extra library to the loaders classpath
    -C, --classpath=<url>         Add an extra url to the loaders classpath
    -P, --properties=<url>        Load system properties from the given url
    -b, --host=<host or ip>       Bind address for all JBoss services
    -g, --partition=<name>        HA Partition name (default=DefaultDomain)
    -u, --udp=<ip>                UDP multicast address
    -l, --log=<log4j|jdk>         Specify the logger plugin type

Posted in AS | このエントリーをはてなブックマークに追加 | この記事をクリップ! livedoor クリップ |