【tigase】用Eclipse调试tigase源码

我们项目开始时候由于各种原因选择openfire作为即时通讯服务器。随着用户人数的增加,考虑到openfrie集群需要license, 而单台openfire在稳定性及容量上都难以为继。需要考虑一个支持集群的xmpp服务器。由于语言的问题,毕竟现在用的是java,所以先考察一下Tigase

tigase官网两条新闻很醒目:

呵呵,很吸引人,下载了tigase-server-5.1.0-b2512-beta1.jar 和 tigase-server-5.1.0-b2512-beta1.exe在本地都没完全安装成功。唉。。。

只好check out 源码: https://svn.tigase.org/reps/tigase-server/trunk

按照 Manual installation in consolemode 

Pastedfrom <http://www.tigase.org/content/manual-installation-console-mode

的方式在服务器安装成功,spack顺利连接,聊天。


好,在本地将源码导入eclipse,因为支持maven,导入很顺利。但要进一步开发,需要和现有系统集成,必然需要能够对工程进行修改调试,如何debug呢

官网上搜索一下,发现有一篇文章:

Hack Tigase Jabber/XMPP Serverin Eclipse 

Pastedfrom <http://www.tigase.org/content/hack-tigase-jabberxmpp-server-eclipse#comment-2524

文章没多大作用,但文章后面的一条评论却提供了一个有效的方法, 如下:

I have been doing some Tigase

I have been doing some Tigase development within Eclipse and have the server able to be run and debugged from within it. The setup I am using is to have the main src code from Tigase in one project and then setup a second project that I call tigase-local. This project just contains the configuration files and maven dependency to the main Tigase project.

Once that is setup then I was able to figure out what flags were needed by looking at the scripts/tigase.sh file along with the etc/tigase.conf file. In your run configuration you should have the following settings:

Main Class: tigase.server.XMPPServer
Program arguments: --property-file etc/init.properties
VM arguments:
-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8
-Djdbc.drivers=com.mysql.jdbc.Driver:org.postgresql.Driver:org.apache.derby.jdbc.EmbeddedDriver
-server -Xms100M -Xmx200M -XX:PermSize=32m -XX:MaxPermSize=256m -XX:MaxDirectMemorySize=128m

You will want to change the jdbc.drivers to contain the drivers you need to connect to your database backend.

That should be it and you then can run / debug the Tigase server itself.


这条消息里面没有细说都要什么配置文件,经过试验需要以下文件:

certs

我全拷贝过来了,不然报SSL空指针
etc

      cross-domain-policy.xml 和init.properties
libs

      jdbc-mysql.jar


可以放断点调试跟踪了。



评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值