How to debug openfire with eclipse

Source: Internet
Author: User

Openfire is a well-known open-source Jabber server developed by Java. It was previously called Wildfire and was later changed to openfire. I previously looked at how it was debugged online.ArticleThis article is based on openfire.Community(Http://www.igniterealtime.org/forum/index.jspa? Categoryid = 1. there is a lot of content on it. If you want to study it, you must go and have a look. later, a QQ gateway was added to openfire, which will be released later. see the text below:

Openfire SVN + eclipse 3.3 + subversive Installation Guide
Posted: Jul 5, 2007 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 be still be useful, but your mileage may vary. I compile this guide to the best of 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 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 shocould 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 shoshould 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 cut icon
-Right-click the shortcut cut icon and choose "properties". The "Eclipse properties" window will show.
-The "target" textbox shocould 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 indexing ing" 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 coshould 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!

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.