本地部署openfire服務端

來源:互聯網
上載者:User

直接開始

步驟一:下載openfire源碼

:http://www.igniterealtime.org/downloads/source.jsp 選中openfire_src_3_8_1.zip,下載(68.74 MB)

步驟二:eclipse匯入openfire

將openfire_src_3_8_1.zip解壓至eclipse工作區域中

File->New->Java Project取消掉default location的勾選狀態,並瀏覽選擇解壓好的openfire_src目錄。

步驟三:ant編譯

在openfire項目匯入進來之後,點擊Window -> Show View -> Ant然後就會顯示出Ant的視窗,在Ant 視圖中,單擊右鍵,在彈出的捷徑功能表中選擇Add Buildfiles在彈出的對話方塊中,展開openfire_src/build檔案夾,選擇build目錄下的build.xml接下來雙擊執行openfire[default]   (帶一個三角符號的那個)

步驟四:引入所需jar包(coherence.jar-coherence-work.jar-tangosol.jar-)

,解壓後複製到/openfire_src/build/lib中

步驟五:配置openfireHome

eclipse中,使用快速鍵ctrl+shift+r,尋找檔案XMPPServer,修改openfireHome

 if (openfireHome == null) {            try {                //openfireHome = verifyHome("..", jiveConfigName).getCanonicalFile();            openfireHome = verifyHome("D:/work/eclipse3.7/workspace/openfire_src/target/openfire", jiveConfigName).getCanonicalFile();//相對路徑更改為絕對路徑,用於測試服務端是否可運行 dml@2013.4.15            }            catch (FileNotFoundException fe) {                // Ignore.            }            catch (IOException ie) {                // Ignore.            }        }

步驟六:設定啟動項

點擊openfire_src項目,在功能表列中選擇Run->Open Run Dialog (Or  Run->Run Configurations)
彈出一個對話方塊,在左側菜單中右鍵點擊Java Application,選擇New建立啟動配置
 
1.在Run視窗的Main選項卡中, 修改最上面Name文字框中的值,改成包含要啟動的類的工程名openfire_src
(沒什麼用,就是一個標識,隨便起名字。)
 
2.在Run視窗的Main選項卡中,
project框中填寫:openfire_src
Main class 填寫:org.jivesoftware.openfire.starter.ServerStarter
點擊Apply應用。
 
3.點擊進入Arguments選項卡,在上面那個框(Program arguments:)中填寫
-D openfireHome="${workspace_loc:openfire_src}/target/openfire"
其中${workspace_loc:openfire_src} 中的 openfire_src 要根據你的項目名來進行同步修改。

eg.[-D openfireHome="D:/work/eclipse3.7/workspace/openfire_src/target/openfire"]
點擊Apply應用。


 
4.點擊進入Classpath選項卡,選中User Entries,然後點擊右側的Advanced按鈕,會彈出一個小框,選擇Add Folders,單擊OK。
選擇 openfire_src\src\i18n點OK 按鈕將這個檔案夾加入到Classpath選項卡中
選擇 openfire_src\src\resources\jar 目錄也加到 Classpath選項卡中
點擊Apply應用。
 
5.點擊進入Common選項卡中,勾選Run複選框。
點擊Apply應用,run

步驟七:測試服務端是否搭建完畢

瀏覽器中輸入http://127.0.0.1:9090

dml@2013.4.15

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.