Mule ESB 3.7起動
Mule 3.7がリリースされているので、そちらを試してみたいと思います。
Mule 3.7のダウンロード
以前のエントリでは、Enterprise版のダウンロードページにしか行けずに、そちらで検証していました。 Enterprise版ではトライアル期間が終わると次のようなエラーが出て、起動できなくなります。
ERROR 2015-08-04 16:22:59,527 [main] com.mulesource.licm.impl.TrueLicenseHelper: Couldn't validate license key! Invalid license
Community Editionのダウンロードはこちらで行けそう。
Muleの起動
ダウンロードしたファイルを解凍。
$ unzip mule-standalone-3.7.0.zip
実行ファイルがあるところまで移動して、
$ cd mule-standalone-3.7.0/bin/ $ ls additional.groovy launcher.bat mule launcher launcher.conf mule.bat
muleコマンドを実行
$ ./mule
起動ログ
$ ./mule MULE_HOME is set to /Users/rsogo/work/mule-standalone-3.7.0 Running in console (foreground) mode by default, use Ctrl-C to exit... MULE_HOME is set to /Users/rsogo/work/mule-standalone-3.7.0 Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 Running Mule... --> Wrapper Started as Console Launching a JVM... Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 Starting the Mule Container... Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved. WARNING - Unable to load the Wrapper's native library because none of the following files: libwrapper-macosx-x86-64.dylib libwrapper-macosx-universal-64.dylib libwrapper.dylib could be located on the following java.library.path: /Users/rsogo/work/mule-standalone-3.7.0/bin/%LD_LIBRARY_PATH% /Users/rsogo/work/mule-standalone-3.7.0/lib/boot Please see the documentation for the wrapper.java.library.path configuration property. System signals will not be handled correctly. INFO 2015-08-04 16:46:04,937 [WrapperListener_start_runner] org.mule.module.launcher.MuleContainer: ********************************************************************** * Mule ESB and Integration Platform * * Version: 3.7.0 Build: 725cbc8a * * MuleSoft, Inc. * * For more information go to http://www.mulesoft.org * * * * Server started: 15/08/04 16:46 * * JDK: 1.7.0_71 (mixed mode) * * OS: Mac OS X (10.10.4, x86_64) * * Host: Ryohei-no-MacBook-Pro.local (192.168.11.5) * ********************************************************************** INFO 2015-08-04 16:46:04,941 [WrapperListener_start_runner] org.mule.module.launcher.coreextension.DefaultMuleCoreExtensionManager: Initializing core extensions INFO 2015-08-04 16:46:04,941 [WrapperListener_start_runner] org.mule.module.launcher.coreextension.DefaultMuleCoreExtensionManager: Starting core extensions INFO 2015-08-04 16:46:04,955 [WrapperListener_start_runner] org.mule.module.launcher.DefaultArchiveDeployer: ================== New Exploded Artifact: default INFO 2015-08-04 16:46:04,963 [WrapperListener_start_runner] org.mule.module.launcher.MuleSharedDomainClassLoader: Using domain dir /Users/rsogo/work/mule-standalone-3.7.0/domains/default for domain default INFO 2015-08-04 16:46:05,013 [WrapperListener_start_runner] org.mule.module.launcher.MuleDeploymentService: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + Started domain 'default' + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ INFO 2015-08-04 16:46:05,020 [WrapperListener_start_runner] org.mule.module.launcher.DefaultArchiveDeployer: ================== New Exploded Artifact: default INFO 2015-08-04 16:46:05,044 [WrapperListener_start_runner] org.mule.module.launcher.application.DefaultMuleApplication: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + New app 'default' + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ INFO 2015-08-04 16:46:09,459 [WrapperListener_start_runner] org.mule.module.launcher.MuleDeploymentService: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + Started app 'default' + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ INFO 2015-08-04 16:46:09,462 [WrapperListener_start_runner] org.mule.module.launcher.DeploymentDirectoryWatcher: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + Mule is up and kicking (every 5000ms) + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ INFO 2015-08-04 16:46:09,533 [WrapperListener_start_runner] org.mule.module.launcher.StartupSummaryDeploymentListener: ********************************************************************** * - - + DOMAIN + - - * - - + STATUS + - - * ********************************************************************** * default * DEPLOYED * ********************************************************************** ******************************************************************************************************* * - - + APPLICATION + - - * - - + DOMAIN + - - * - - + STATUS + - - * ******************************************************************************************************* * default * default * DEPLOYED * *******************************************************************************************************
Mule ESB 3.7のDatabase Connectorを試す1(設定とSELECT)
デプロイ
mule-config.xmlをappsの下に作ったdatabaseフォルダに置きます。
$ pwd /Users/rsogo/work/mule-standalone-3.7.0/apps/database $ ls mule-config.xml
デプロイ時ログ
おぉ、成功。
******************************************************************************************************* * - - + APPLICATION + - - * - - + DOMAIN + - - * - - + STATUS + - - * ******************************************************************************************************* * default * default * DEPLOYED * * database * default * DEPLOYED * *******************************************************************************************************
JDBC Driverの配置
- Database Driverになにもやってない状態で
http://localhost:8081/
にアクセスすると次のようなエラーがでた。
org.mule.module.db.internal.domain.connection.ConnectionCreationException: java.sql.SQLException: Error trying to load driver: oracle.jdbc.Driver : oracle.jdbc.Driver (java.sql.SQLException). Message payload is of type: NullPayload
Oracle Database 12c Release 1 JDBC Driver Downloads
自分の環境はJDK1.7を使っているので、ojdbc7.jar
。
{MULE_HOME}/lib/user/
配下に置く。
$ ls lib/user/ README.txt mule-tests-functional-3.7.0.jar xmlunit-1.5.jar junit-4.11.jar ojdbc7.jar
StackOverflowかどこかに{MULE_HOME}/lib/mule/
に置けって言っている人がいるけど、それだと動かなかった。
- DriverはOKで、コネクションが確立できない場合のログ。
org.mule.module.db.internal.domain.connection.ConnectionCreationException: java.sql.SQLException: Cannot get connection for URL jdbc:oracle:thin:{User}/{Password}@localhost:{SID} : No suitable driver found for jdbc:oracle:thin:{User}/{Password}@localhost:{SID} (java.sql.SQLException). Message payload is of type: NullPayload
実行
Muleを実行しているマシンのhttp://locahost:8081/
にアクセスしてみる。
上手く行っていると、データベースに検索した結果がJSONに変換されたレスポンスが見られる。
続きを次のエントリで書いています。 begirama.hatenablog.com