2007年7月17日火曜日

SOA ESB Muleメモ

■サンプルの実行

ひさしぶりにいじってみる
~/mule-1.4.1/examples/helloのサンプル

mule -config ./conf/hello-config.xml
だと、Webインタフェース無し、

mule -config ./conf/hello-http-config.xml
だと、設定だけでWebインタフェースが付与される。

2007年7月6日金曜日

pentahoメモ 「フィールド名の違い」エラー

[現象]
 インプット(元)とアウトプット(先)のテーブルのフィールド名が異なると継らない。

[対策]
 間にselect value を置いてマッピングを行う。
 Edit Stepボタンをクリックし、インプットフィールドの一覧を出す。
 そしてEdit Mappingボタンを押下する。
 そうすればマッピング画面が出てくる。

 ただし、updateは間にselect valueを置いてもマッピングが出てこないので注意
 Table outputならマッピングの際のフィールドが出てくる。

 本来なら、Updateをしたい場合にはどうしたら良いのか?

2007年7月5日木曜日

pentahoメモ 「数値が無効です」エラー

[現象]
テーブルのデータを移行するJobを作成したが、移行元と先でフィールドの属性が違うので
「数値が無効です」などのエラーが出ていた。

具体的にはSQL ServerのIntegerからOracleのvarcher2に値を引き継ぐ所で発生

[対策]
SQL serverから値を取得するTable inputで値を受けるフィールドの定義が
自動ではデータベースの型に合わせられるが、そこを自分で選択し直す。
わたしの場合には、Integerの所をStringに選択し直した。

SOA ESB Muleメモ

Ubuntu 7.04 - the Feisty Fawn -に ESBのmule-1.4.1入れて試す。

■インストール
 Tar.gzファイルを解凍した場所を以下の様に環境変数へ登録
 ※お試しなので適当に/home/rsos01を解凍場所とした。

export MULE_HOME=/home/rsos01/mule-1.4.1
export PATH=$PATH:$MULE_HOME/bin

■初期実行
 ~/mule-1.4.1/bin$ mule
で実行すると以下の様に表示されてくる。

Usage: /home/rsos01/mule-1.4.1/bin/mule { console | start | stop | restart | status | dump }
No command specified, running in console (foreground) mode by default, use Ctrl-C to exit...
Running Mule...
--> Wrapper Started as Console
Launching a JVM...


沢山の文字が流れて来て最終的にライセンス確認のプロンプトが出る。
当然yを押下
Do you accept the terms and conditions of this license agreement [y/n]?

Downloading http://www.ibiblio.org/maven2/javax/activation/activation/1.1/activation-1.1.jar ...


□エラー
1)プロキシーの設定エラー
(状況)
Exception in thread "main"
JVM exited while loading the application.
java.io.IOException: Unable to reach a remote repository, this is most likely because you are behind a firewall and have not configured your HTTP proxy settings in $MULE_HOME/conf/wrapper.conf.

ちなみに上記ログは以下のディレクトリにも出力される。
~/mule-1.4.1/logs

(対策)
$MULE_HOME/conf/wrapper.confの以下の箇所を修正
# Set these parameters for your HTTP proxy if behind a firewall
#wrapper.java.additional.3=-Dhttp.proxyHost=proxy.acme.com
#wrapper.java.additional.4=-Dhttp.proxyPort=8080

自分の環境にあわせて修正(以下は例)
# Set these parameters for your HTTP proxy if behind a firewall
wrapper.java.additional.3=-Dhttp.proxyHost=146.50.67.117
wrapper.java.additional.4=-Dhttp.proxyPort=3128

2)設定ファイル
ファイルのダウンロードはされたが、以下のようなメッセージ(警告)が出る。
WARN 2007-07-05 14:47:27,508 [WrapperSimpleAppMain] org.mule.MuleServer: A configuration file was not set, using default: mule-config.xml


*******************************************************************************
No config file specified and no config by the name of mule-config.xml
found on the classpath.

Usage: mule -config [-builder ]

mule-configuration - a URL for the Mule Config XML to use,
if not specified the config will be loaded from
the classpath

config-builder - a fully qualified class name of the builder to use
to configure Mule. For Spring-based configurations
a 'spring' (without quotes) shortcut is available.
*******************************************************************************

たしかに、オプション無しで起動している。
http://mule.codehaus.org/display/MULE/Starting+the+Server
に書いてある。
設定ファイルとはなんでしょうか?

少し気になるが、次のステップに続く・・・・

■サンプルアプリの起動
Echo Example サンプル

以下のディレクトリに移動
~/mule-1.4.1/examples/echo

以下のコマンドを実行
mule -config ./conf/echo-config.xml

※先ほどわからなかった設定ファイルが出てきました。こういうモノですね。

なにやら沢山出力されるが結局以下の表示がされる。
**********************************************************************
* Mule ESB and Integration Platform version 1.4.1 *
* MuleSource, Inc. *
* For more information go to http://mule.mulesource.org *
* *
* Server started: 3:56:22 午後 *
* Server ID: Mule_Echo_Sample *
* JDK: 1.4.2 (GNU libgcj 4.1.2 (Ubuntu 4.1.2-0ubuntu5)) *
* OS: Linux (2.6.20-16-generic, i386) *
* Host: itp21033 (127.0.1.1) *
* *
* Agents Running: *
* Mule Admin: accepting connections on tcp://localhost:60504 *
**********************************************************************
INFO 2007-07-05 15:56:24,487 [WrapperSimpleAppMain] org.mule.MuleServer: Mule Server initialized.

サンプルの説明にあるようにブラウザで以下の様に入力すると
http://localhost:8081/services/EchoUMO?method=echo&param=ThisIsEcho

ブラウザの画面に以下のようなレスポンスが帰ってくる。



   ThisIsEcho
  

 



とりあえず動作はしているが、、、
何が良いのかわからない、、、それはこれから

2007年7月4日水曜日

pentahoメモ

Ubuntu 7.04 - the Feisty Fawn -にpentaho Kettle - Spoon version 2.5.0を入れて色々試しながら気づいたメモ
・Table inputでJOINしたSQLは実行可能だが、Output filedsが取れない。
 単テーブルであれば表示される。
 そういうもの見たいなので、JOINの変わりにLookupを使いステップをつなぐ。
 フィールドはLookupの分が、それ以前のフィールドに追加されるので、
 結果的にJOINと同じ効果をえられる。

・変数を使っている場合にもフィールドの取得でエラーが発生する。
 変数の解決ができないのでSQLエラーとなるようです。
 その場合には、変数の部分をいったんコメント化するなどして
 SQLとして実行できるモノにし、フィールドを取得する。
 その後、コメントを解除して変数を使える様にする事
 しかし、、、、これが結構辛い
 なにか他に良い手がないかなぁ