使用 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错误;害得我一度觉得不是这个问题引发了。还好总算都留点心,找到问题的解决办法了。