zoukankan      html  css  js  c++  java
  • 如何用eclipse调试Openfire

    OpenFire为一个很出名的开源jabber服务端,是由java开发的,它以前的名字叫wildfire,是后来才改成openfire的.之前研究它时在网上找了它的如何调试的文章,是e文,看了后一般都会了的.其实此文章就是在openfire的开发社区(http://www.igniterealtime.org/forum/index.jspa?categoryID=1)找到的. 上面有挺多的内容,如果你要研究它的话一定要上去看看.后来还在openfire上加了个qq的gateway,这个迟出会发出来.下面请看正文:

    Openfire SVN + Eclipse 3.3 + Subversive Installation Guide
    Posted: Jul 5, 2007 10:58 PM    
    If you're looking for an SVN (Subversion) source of Openfire + Eclipse 3.3 installation guide, you're looking at the correct place. Otherwise, please see http://wiki.igniterealtime.org/display/WILDFIRE/Build+Openfire+with+Eclipse

    This guide assumes that you are installing everything from scratch. If you've done some parts of them, this guide may still be useful, but your mileage may vary. I compile this guide to the best of my my knowledge. I apologize if it doesn't work for you.

    Note: This guide may also work with other Jive's opensource projects like Spark, etc. All you have have to do is to change the SVN checkout point to the desired project.

    Openfire SVN + Eclipse 3.3 + Subversive Installation Guide
    _
    Install JDK
    - Download JDK and install them. The least version should be 1.5. I use 1.6. Sorry, no instruction for this.

    Install Eclipse 3.3
    *- Download eclipse 3.3 from http://www.eclipse.org/. I use "Eclipse IDE for Java EE Developers". You should at least use "Eclipse IDE for Java Developers".
    - Extract the donwloaded zip file into "C:/Program Files/Eclipse"
    - Open "C:/Program Files/Eclipse" folder
    - Rightclick & drag eclipse.exe on to your desktop (or Windows taskbar) to create a shortcut icon
    - Right-click the shortcut icon and choose "Properties". The "Eclipse Properties" window will show.
    - The "Target" textbox should read something like this "C:\Program Files\Eclipse\eclipse.exe" -vm "C:\Program Files\Java\jdk1.6.0\bin\javaw" depending on the JDK that you use.
    - Close the "Eclipse Properties" window.

    Install Subversive Plugin
    *- Doubleclick the shortcut icon to start Eclipse.
    - Select/enter your prefered workspace and click OK to open Eclipse main IDE window.
    - Click on the "Workbench" icon to close the welcome screen.
    - Click "Help"->"Software Updates"->"Find and Install..." menu.
    - Click on "Search for new features to install" and click Next.
    - Click on "New Remote Site..." button.
    - Enter "Subversive" in the Name box and "http://www.polarion.org/projects/subversive/download/1.1/update-site" in the URL box (Check the latest URL from "http://www.eclipse.org/subversive/" website), then click OK.
    - Click "Finish" to install Subversive.
    - Eclipse will search for the update site and show the result in a next window where you will select the features to install. I choose everything under "Subversive SVN Team Provider Plugin" and "Subversive Client Libraries".
    - Click "Next" to continue and so on until the installation ends. You normally want to restart Eclipse when the installation ends.

    Check Out Openfire SVN
    *- Click "Windows"->"Open Perspective"->"Other..." menu.
    - Click on "SVN Repository Exploring" on the "Open Perspective" window and click OK.
    - Right-click on "SVN Repositories" screen and choose "New"->"Repository Location..."
    - On "New Repository Location" enter "http://svn.igniterealtime.org/svn/repos" in the URL box and click Finish. You'll see the URL location in the "SVN Repositories" screen.
    - Expand the URL location.
    - Expand the "openfire" tree.
    - Right-click on "trunk" and choose "Check Out". Make yourself some Cafe-Latte while waiting for the checkout to complete

    Create Openfire Project
    *- Click "Window"->"Open Perspective"->"Java" menu.
    - In the "Project Explorer" screen, if there is an openfire project, delete it. This project was created during the openfire check out process. Yes you read it correctly, DELETE the project!!! Otherwise you'll have to setup your Openfire development environment manually. On the "Confirm Project Delete" choose "Do not delete contents", then click Yes.
    - Click "File"->"New"->"Project...". Notice the elipses!!!
    - Select "Java"->"Java Project" and click Next.
    - On the "New Java Project" window choose "Create project from existing source" and browse to where "openfire" folder is located under your workspace.
    - In the Project name box enter exactly as "openfire". Otherwise, the Next and Finish button remain disabled. Click on Next. Eclipse will read the directory structure to setup the environment automatically (almost) for you and you can see what it does on the next screen. Then click on Finish.
    - If the "Open Associated Perspective" windows opens, click Yes.

    Build Openfire
    *- Click "Window"->"Show View"->"Ant" menu.
    - Right-click the "Ant" screen and choose "Add Buildfiles..."
    - Expand the "openfire->build" folder and select "build.xml", then click OK.
    - On the "Ant" screen, expand the "Openfire XMPP Server" and doubleclick on "openfire default" ant task. The build may fail because you're checking out the daily updates of openfire sources, which may contain bugs. If so, wait for another day and hope that the developers discover and fix the bug; or you might dare to fix it yourself. During this first time setup, a succesfull build is necessary before you can proceed with the remaining tasks below.

    Create Project Builder
    *- Click "Run"->"Open Run Dialog..." or "Run"->Open Debug Dialog..." menu. A "Run" window shows.
    - Select "Java Application" and click on the "New" button.
    - On the "Main" tab of the "Run" window, change the "New_configuration" name to "Openfire" or anything you like.
    - Click on "Project":"Browse" button and select "openfire" and click OK.
    - Click on "Main class":"Search" button and select "ServerStarter - org.jivesoftware.openfire.starter" and click OK.
    - I'd suggest that you select "Stop in main" check box so that you could later verify that debugging works.
    - Click on the "Arguments" tab.
    - Enter -DopenfireHome="${workspace_loc:openfire}/target/openfire" in the "VM arguments" box.
    - Click on "Classpath" tab.
    - Select "User Entries" so that the "Advanced..." button will be enabled.
    - Click on the "Advanced..." button.
    - On the "Advanced Options" window select "Add Folders" and click OK.
    - On the "Folder Selection" window select "openfire"->"src"->"i18n" folder and click OK.
    - Click on the "Advanced..." and "Add Folders" buttons once again to include "openfire"->"src"->"resources"->"jar" folder.
    - Click on "Common" tab.
    - Select the "Debug" and "Run" check box.
    - Click on "Apply" button.
    - Click on "Close" button.

    Run/Debug
    *- The setting is now complete for Openfire.
    - You may test runing and debuging by clicking on "Run"->"Run History"->"Openfire" and "Run"->"Debug History"->"Openfire" respectively. If you choose the later and if you follow this instruction closely, execution will stop on the main method in ServerStarter.java.

    Good Luck!

     

  • 相关阅读:
    字符串面试题:将句子的单词序倒置
    字符串面试题:将整型转换为字符串
    QML定时器
    QML按键事件处理
    QML鼠标事件实现变色矩形
    QML动态加载组件
    QML鼠标区域控制
    属性绑定与赋值
    设置虚拟机的本地端口映射
    关于修改banner信息;nginx反向代理apache应用
  • 原文地址:https://www.cnblogs.com/hannover/p/1986612.html
Copyright © 2011-2022 走看看