Ubuntu12.04(64bit)上部署编译运行Openfire+Spark环境

一、环境


133743_wNnY_437086.jpg

133744_ezIe_437086.png

133744_arQZ_437086.png

133745_1gMS_437086.png

133745_uEor_437086.png

133746_di3p_437086.png

一、下载Openfire源码

htp://www.igniterealtime.org/downloads/source.jsp

openfire_src_3_9_1.zip 点击下载

下载完毕后解压资源到某个路径下

relsese版本下载连接:

http://www.igniterealtime.org/downloads/index.jsp

二、编译源码

打开Eclipse,新建工程,use default location选择openfire解压路径

134043_Gi37_437086.png

134043_jBKR_437086.png

134043_nNvA_437086.png



新建编译项

Window->Show view->Ant

ant窗口中点击Add buildfiles,在buildfile selection窗口中选择openfile工程中的build.xml,点击OK

134500_3iFk_437086.png

134550_BOHc_437086.png

展开Openfire XMPP Server项,在众多项中选择openfire[default],右键Run as->Ant Build进行编译。

编译通过后提示BUILD SUCCESSFUL

134647_suzp_437086.png

编译成功后,工程目录结构下多出两个目录targetwork

134704_WfDf_437086.png

三、添加lib

将刚才生成的目录target/openfire/lib下所有jar包添加到工程中

134903_Q2vv_437086.png

134836_TxFF_437086.png


四、配置run configurations

Main标签页的Main class点击Search,搜索ServerStarter,选中ServerStarter – org.jivesoftware.openfire.starter,勾选Include system libraries when searching for a main class

135015_Hb5w_437086.png

Arguments标签页中VM arguments属性填入:-DopenfireHome="${workspace_loc:openfire}/target/openfire

注意:冒号后的openfire是工程名,与你当前的工程名保持一致,否则运行会出现异常。

135117_Lc7Y_437086.png

Classpath标签页中,选中User Entires,点击Advanced,选择Add Folders,点击OK,分别添加openfire/src/i18nopenfire/src/resources文件夹。

135221_1IgE_437086.png

135221_GXwE_437086.png

135221_YaB2_437086.png

Common标签页中,选中DebugRun,保存配置。

135331_WlLm_437086.png

点击Run按钮运行,编译完成了,应该不是太难。

135632_Mbqt_437086.png

五、运行openfire管控后台

在浏览器中输入http://127.0.0.1:9090,进入后台管理界面。

135707_4Wjc_437086.png

六、配置管控平台

135736_Qf4N_437086.png

135822_1YTs_437086.png

这里的域名可以任意填写,就是服务器名称,客户端向好友发消息时会用到该名称,比如向好友gerry发消息时,代码中可能会这样写gerry@simon

135855_coSF_437086.png

选择标准数据库连接,使用了外部的MySQL数据库,本地需要安装后进行连接。

140110_9M40_437086.png

这里选择了MySQL作为数据库,需安装MySQL,并创建openfire数据库

数据库URL:替换本地ip和数据库名,去除左[]括号

140232_mz1Q_437086.png

140301_9kOE_437086.png


七、下载Spark源码

参考Spark编译运行

http://community.igniterealtime.org/docs/DOC-1020

SVN上获取源码

http://www.igniterealtime.org/downloads/source.jsp

140752_WMNE_437086.png

140907_sEl0_437086.png

140954_Dyqi_437086.png

八、导入Spark源码到Eclipse

141044_Uoh0_437086.png

141044_bK9m_437086.png

九、编译Spark源码

添加Ant编译文件

141141_yhC0_437086.png

运行ant编译

141215_IsYT_437086.png

当前ant版本为1.9.x,编译会出错,要求Ant版本1.6.x1.7.xJAVA版本1.5.x1.6.x

BUILD FAILED

/usr/gym/pm/tech/Openfire/Spark/spark_2_5_6_branch/build/build.xml:129: Must use Ant 1.6.x or 1.7.x to build Spark

可以修改build.xml中对antjava版本的要求。

<condition property="ant.not.ok" value="true">

<not>

<or>

<contains string="${ant.version}" substring="1.6"/>

<contains string="${ant.version}" substring="1.7"/>

<contains string="${ant.version}" substring="1.8"/>

<contains string="${ant.version}" substring="1.9"/>

</or>

</not>

</condition>

<condition property="java.not.ok" value="true">

<not>

<or>

<contains string="${ant.java.version}" substring="1.5"/>

<contains string="${ant.java.version}" substring="1.6"/>

<contains string="${ant.java.version}" substring="1.7"/>

<contains string="${ant.java.version}" substring="1.8"/>

</or>

</not>

</condition>

ant下载地址:http://ant.apache.org/bindownload.cgi

再次编译则编译通过,项目工程中多出target目录

141305_lp87_437086.png

十、配置Run Configurations,运行

141348_AOxl_437086.png

141348_Rb2m_437086.png


保存配置,点击Run

会有提示错误

java.lang.reflect.InvocationTargetException

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at org.jivesoftware.launcher.Startup.start(Startup.java:83)

at org.jivesoftware.launcher.Startup.main(Startup.java:33)

Caused by: java.lang.Error: Unresolved compilation problems:

GSSAPIConfiguration cannot be resolved to a type

GSSAPIConfiguration cannot be resolved to a type


解决方案:

Spark/spark_2_5_6_branch/src/java中的GSSAPIConfiguration.java移动到Spark/spark_2_5_6_branch/src/java/org/jivesoftware目录下,再次编译-RUN

参考:

http://community.igniterealtime.org/thread/38439


141518_DYvJ_437086.png


转载于:https://my.oschina.net/stevegym/blog/207892

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值