1、測試"Sample 655: Message Relay - Basics"時,出現”Login failed! Please recheck Server URL and try again.“錯誤訊息
http://wso2.org/project/esb/java/4.0.3/docs/samples/misc_samples.html
狀況說明:
依照範例說明,將axis2.xml檔案中,
org.wso2.carbon.relay.ExpandingMessageFormatter
org.wso2.carbon.relay.BinaryRelayBuilder
這兩種Formatter與Builder之設定“取消註解”(生效)後,範例可以正常完成。
但是,登入Management Console後,卻無法登入,會跳出如下訊息的dialog
Login failed! Please recheck Server URL and try again.
若恢復原設定值,則又可以順利登入。(但是就無法達到想要的結果了)
此外,在Server Console上,有底下錯誤訊息:
Caused by: org.apache.axis2.AxisFault: namespace mismatch require http://authentication.services.core.carbon.wso2.org found http://ws.apache.org/commons/ns/payload
處理方式及原因說明:
由底下網址
http://docs.wso2.org/display/ESB403/Message+Relay+Module
可以看到一段說明,
This module is designed to be used by Admin Services that runs inside the ESB. All the admin services are running with content type: application/soap+xml. So if a user wants to use admin console and use the ESB for receiving messages with content type application/soap+xml, this module should be used.
所以,依照該網址上的步驟,啟用relay module之後,即可登入Carbon。
2、ESB部署到JBoss AP Server時 - 出現"Database Error - Table "UM_DIALECT" not found"錯誤訊息!
2012-03-01 09:17:12,104 ERROR [org.wso2.carbon.user.core.util.DatabaseUtil] (Start Level Event Dispatcher) Database Error - Table "UM_DIALECT" not found; SQL statement:
SELECT COUNT(UM_ID) FROM UM_DIALECT WHERE UM_TENANT_ID=? [42102-140]
org.h2.jdbc.JdbcSQLException: Table "UM_DIALECT" not found; SQL statement:
SELECT COUNT(UM_ID) FROM UM_DIALECT WHERE UM_TENANT_ID=? [42102-140]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
at org.h2.message.DbException.get(DbException.java:167)
處理方式及原因說明:
應該是資料庫的對應設定沒有設定正確,
檢查
1、registry.xml或usr-mgt.xml中,資料庫所在目錄設定不正確。
2、/etc/profile中的CARBON_HOME是否設定正確。或是,直接以export CARBON_HOME=<wso2主目錄>後,再啟動JBoss AP Server。
3、新增message processor時 - 出現"Couldn't find repository location './samples/axis2Client/client_repo'"錯誤訊息!
2012-03-01 10:38:46,104 INFO [org.apache.axis2.deployment.FileSystemConfigurator] (http-0.0.0.0-8443-10) Couldn't find repository location './samples/axis2Client/client_repo'
2012-03-01 10:38:46,104 ERROR [org.apache.synapse.message.processors.forward.BlockingMessageSender] (http-0.0.0.0-8443-10) Error initializing BlockingMessageSender : Couldn't find repository location './samples/axis2Client/client_repo'
org.apache.axis2.AxisFault: Couldn't find repository location './samples/axis2Client/client_repo'
參考網址:
https://wso2.org/jira/browse/CARBON-10984?page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#issue-tabs
http://synapse.apache.org/Synapse_Configuration_Language.html
處理方式及原因說明:未處理
4、Integrating Different Systems with WSO2 ESB,遇到的一些問題
http://wso2.org/library/articles/2012/01/integrating-different-systems-with-wso2-esb
狀況說明:
1、不曉得ProcessDocument這個物件要建立在哪裡?
2、解壓縮"sample_8.zip"之後,按照目錄下的README.txt,要建置Builder及Formatter時,
在sample/extensions目錄底下,執行mvn clean install -Dmaven.test.skip=true -o,出現Error訊息而無法完成:
[root@wso2 extensions]# /opt/maven/bin/mvn clean install -Dmaven.test.skip=true -o
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.wso2.sample:shop:jar:1.0.0
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 42, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Message formatters and builders 1.0.0
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.226s
[INFO] Finished at: Thu Mar 29 14:58:38 CST 2012
[INFO] Final Memory: 7M/494M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1: The repository system is offline but the artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.4.1 is not available in the local repository. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
處理方式及原因說明:
1、ProcessDocument是
sample/extensions/src/main/java/sample/shop/builder/CSVFileBuilder.java
這個Class底下的一個Method,用來將CSV檔轉成XML檔。
2、透過mvn -h這個指令,以及底下網址,
http://juvenshun.iteye.com/blog/213959
http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Lifecycle_Reference
http://maven.apache.org/maven-1.x/plugins/test/properties.html
了解到mvn clean install -Dmaven.test.skip=true -o這條指令, 是表示
A. 清除上一次建構所生成的檔案
B. 依照extensions/src/pom.xml的配置內容,將package(Builder與Formatter)建置到本地端的repository
C. 忽略測試的動作
D. 離線進行動作
指令之所以錯誤,可能是因為Maven需要上網去下載相關的資訊,而這台主機沒有設定Proxy連線資
訊導致無法連上網路,也就無法下載資訊了。
編輯$MAVEN_HOME/conf/settings.xml內容中,Proxy的相關資訊後,即可順利連上網路下載相關
資訊進行compile。
最後編譯後,節錄最後顯示的資訊如後:
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-install-plugin:2.3.1:install from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-install-plugin:2.3.1, parent: sun.misc.Launcher$AppClassLoader@13f5d07]
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-install-plugin:2.3.1:install' with basic configurator -->
[DEBUG] (f) artifact = org.wso2.sample:shop:jar:1.0.0
[DEBUG] (f) attachedArtifacts = []
[DEBUG] (f) createChecksum = false
[DEBUG] (f) localRepository = id: local
url: file:///home/conbar/.m2/repository/
layout: none
[DEBUG] (f) packaging = jar
[DEBUG] (f) pomFile = /tmp/sample/extensions/pom.xml
[DEBUG] (f) updateReleaseInfo = false
[DEBUG] -- end configuration --
[INFO] Installing /tmp/sample/extensions/target/shop-1.0.0.jar to /home/conbar/.m2/repository/org/wso2/sample/shop/1.0.0/shop-1.0.0.jar
[INFO] Installing /tmp/sample/extensions/pom.xml to /home/conbar/.m2/repository/org/wso2/sample/shop/1.0.0/shop-1.0.0.pom
[DEBUG] Installing org.wso2.sample:shop/maven-metadata.xml to /home/conbar/.m2/repository/org/wso2/sample/shop/maven-metadata-local.xml
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:56.193s
[INFO] Finished at: Fri Mar 30 13:42:00 CST 2012
[INFO] Final Memory: 8M/39M
[INFO] ------------------------------------------------------------------------
這時,在sample/extensions目錄底下,會產生一個"target"的目錄,
底下會有範例所客製化的Builder與Formatter類別編譯後之class檔,以及shop-1.0.0.jar檔。
----------------------------------------------
另外,
README.txt中還提到要將sample/conf/axis2.xml複製到repository/conf/目錄中,如此一來就會將我
們原本的axis2.xml配置都蓋掉了,所以,應該是在/repository/conf/axis2.xml中,"Formatter"區塊下
,新增
<messageFormatter contentType="text/csv"
class="sample.shop.formatter.EmailMessageFormatter"/>
引用CSV格式轉成Email格式的Class,
同樣的, 在"Builder"區塊下,新增
<messageBuilder contentType="text/csv"
class="sample.shop.builder.CSVFileBuilder"/>
引用CSV格式轉成XML格式的Class。
此外,在Transport區塊中,也要設定
<transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
底下的內容,才能進行E-mail的寄送。
設定完成後,重啟ESB。
5、在Management Console上的Source View中,按下「Update」鍵更新時,
出現「Error while updating the mediation configuration.」錯誤訊息。
而且,有些Proxy Service無法被顯示出來。
狀況說明:
在Management Console左側選單按下Service Bus / Source View,可以在右邊區塊中顯示XML內容。
嘗試在Source View中,直接編輯內容,然後按下最底下「Update」鍵,想說能夠直接更新設定內容,
結果,彈出一個視窗顯示「Error while updating the mediation configuration.」訊息,
然後回復到原本的設定內容,然後有一些Proxy Service就無法顯示在列表上,只能由Source View上
看到內容。
處理方式及原因說明:
重啟服務後,就有恢復了。
不過,只敢從Proxy Service列表那邊去修改,不敢從Soruce View去修改了。