使用tigase管理命令 tclmt 中的add-user 出現錯誤的解決記錄

使用 tigase 的 tclmt 進行添加用戶,下載tclmt安裝包,安裝後,java

cd tclmt服務器

bin/tclmt.sh -u admin@tigase1.local -p 123456  add-user test21 123456 test21@tigase1.localsession


而後顯示 awaiting response.... 3分鐘後;出現錯誤;.net


完整的錯誤信息以下;調試


INFO: Create empty DB.日誌

awaiting response...server

Error executing script add-userxml

        java.lang.NullPointerExceptionip


java.net.SocketException: Socket is closedrem


上去看了 tigase.org ,以tclmt NullPointerException爲關鍵字搜索一下,看是否有人碰到這樣的問題;

卻是有幾我的碰到,有的人是是由於沒有在 etc/init.properties 中對管理員進行正確的設置;

如:--admins=admin@tigase1.local

那麼這個用戶 admin@tigase1.local 必須真實有效的存在;能夠先經過客戶端進行註冊管理;


也有人提醒要這樣子輸入;

bin/tclmt.sh -u admin@tigase1.local -p 123456 -ip 127.0.0.1 remote sess-man add-user test21 123456 test21@tigase1.local

或者對某些地方加引號

bin/tclmt.sh -u admin@tigase1.local -p 123456 -ip 127.0.0.1 remote sess-man add-user test21 123456 "test21@tigase1.local"


這些方法,都試事後,發現仍是不行;


後來,我去看了日誌;日誌沒有明顯的報錯,很奇怪,我就搜索 日誌裏面的 type="error" 的xml;發現會有這樣的信息提示;

There is no implementation for such command on the server


後來我根據這個到tigase的官網搜索,才找到問題的根源;

這 位老兄也碰到這個問題;http://www.tigase.org/content/tclmt-not-working-session- manager-logs-warning-there-no-implementation-such-command-server


主要緣由是沒有安裝 admin 的 ad-hoc scripts  的groovy腳本;


搜索一下怎樣安裝,原來舊版本是會默認在 tigase-server/scripts/admin下。可是新版本放到了 src/main/groovy/tigase/admin/

因此執行 copy命令  src/main/groovy/tigase/admin/ to: scripts/admin/

便可;


重啓一下服務器,log會提示;Loaded admin command from file

ok,加載成功;

運行這個,

bin/tclmt.sh -u admin@tigase1.local -p 123456  add-user test21 123456 test21@tigase1.local


一切正常;


雖 然調試正常了,可是很奇怪,部署在本地的tigase,並不會報xml中的There is no implementation for such command on the server錯誤;害得我一度覺得不是這個問題引發了。還好總算都留點心,找到問題的解決辦法了。

相關文章
相關標籤/搜索