This How-To describes how you can set up a working Jiplet project using the Eclipse IDE. Setting up an Eclipse project is only required if you are an active developer for the Jiplet project. If you merely want to build the distribution from the source code, use the howto for building the jiplet container from the sources instead. If the steps listend below turn out to be little different from what is available on the screen, you will need to improvise. From this howto, you’ll learn how to setup, compile, and run the Jiplet Container in Standalone mode or as a JBoss service. There are probably many ways to achieve the desired result, but these steps are straightforward enough for Eclipse newbies.
- Get Eclipse ready
- Create a new Eclipse project from the Subversion Repository
- Run the build
- Run it!
- We have used the term “directory” to specify a file location. This is a common Unix convention. In the Windows environment, the term “folder” is used to mean the same thing.
- We have used the Unix directory naming convention in this document. In the Unix environment, a directory hierarchy is specified by the “/” separator. In the Windows environment, the “\” separator is used. In addition, Unix system do not use drive letters as in Windows. If you are using Windows, you will need to modify the commands accordingly. For example, if we stated $JIPLET_HOME/bin, if you are using Windows, it may translate to C:\jiplet-standalone\bin.
- We have used $JIPLET_HOME or similar names to specify environmental variables. While installing/configuring, you will need to replace these variables with the actual values for your machine. For example, in this document, the variable $JIPLET_HOME has been used to specify the directory where the jiplet container code binary is installed. We have commonly used the following variables:
- $JAVA_HOME – directory where the Java Runtime Environment (JRE) is installed.
- $JIPLET_HOME – directory where the Jiplet Container software is installed.
- $JBOSS_HOME – directory where JBOSS is installed.
- $TOMCAT_HOME – directory where Tomcat is installed.
- $HOST – host name/IP address of the system where the jiplet container is installed.
- $RUN – the JBOSS run mode (default, minimal, all, etc.).
- $ANT_HOME – the directory where Ant is installed.
- $GWT_HOME – the directory where GWT (Google Web Toolkit) is installed.
- Commands are specified using bold. You need to enter the command by typing/pasting the command and pressing the Enter/Return key. Although in the Unix world this may seem natural, in the Windows environment, lots of users are lost when it comes to entering a command. Also, the prompts “#” or “C:\>” are shown, do not enter them.
Before we begin, you’ll need to get Eclipse 3.4 (Ganymede) (or higher) installed along with the following plugin(s). You can download the latest stable version of the Eclipse from http://www.eclipse.org:
- Subclipse Plugin: The jiplet source code is managed using Subversion. The repository resides in the Sourceforge site. The Subclipse plugin lets you manage revision control operations directly from the Eclipse IDE. For more details on installing and using Subclipse, visit http://subclipse.tigris.org/ .
Download and install the above plugin(s) as per the instructions provided by the authors.
- Create a directory called cafesip in a location where you want to store the source code for the jiplet project. This is your development workspace. Create an environment variable called CAFESIP_HOME to point to this location.
- From the Eclipse IDE, select menu options Window->Show View->Other.
- From the Show View dialog box, select the SVN folder and select SVN Repository. An empty SVN repostory panel will be created and docked into the Eclipse screen.
- Select the SVN Repository panel, right click on the panel to bring up the popup menu. Select New->Repository Location.
- From the repository dialog box, enter the URL – http://cafesip.svn.sourceforge.net/svnroot/cafesip .
- Once the above step is completed, you will see the CafeSip source tree on the panel. First select the jiplet project and choose the sub-directory called “trunk” to select the latest code base. The trunk has the latest software but may not always work and even may not compile. If you want to create a project that is more stable, under the jiplet project, select the labels/stable sub-directory instead. If you are working on a branch, you may have to choose a different sub-directory.
- Right-click on the trunk, from the context menu, select the Checkout option. The Eclipse IDE will contact the repository to gather project information. We have included all the Eclipse project files with the jiplet source code so that the project can be setup easily.
- From the Checkout dialog box, select Next. Uncheck the “Use default workspace location”. Instead enter the location of the directory where you created the cafesip directory above ($CAFESIP_HOME). Clck on the Finish button.
- The Eclipse IDE will download the source code and create the project. Depending on your connection speed, the download time will vary. The download is more than 15MB. Once the download is completed, you will see the project on the Package Explorer panel.
- From the Package Explorer, open the build.xml file. From the outline, select the target “build”.
- Run the target by right-clicking and selecting the Run As->Ant Build menu item.
- When you execute the above target, you would have built the entire project.
- Alternatively, run the targets explained below to execute individual tasks:
- compile: Generate XML parser classes and compile the entire source code
- build-standalone: Create the standalone deployment. You must run the compile target before running this target.
- build-jboss: Create the jboss deployment. You must run the compile target before running this target.
- build-console: Create the console deployment. You must run the compile target before running this target.
Select the jiplet project from the project explorer, right-click and select the Refresh menu item so that Eclipse picks up all the generated Java files. Although this may not be necessary, you may also want to build the project using the Project menu. The Eclipse project should not display any errors at this point.
If you want to run the jiplet container as a standalone application:
- Jiplet container: Select the jiplet project from the Package Explorer. From the Run menu and select Run… menu item. Select Java Application. Right-click and select the “New” menu item. Enter a name and setup the rest of the parameters as follows:
Runtime vm parms =
Class = org.cafesip.jiplet.standalone.boot.Main
- Jiplet console: Run it as a standard webapp under a servlet container like Tomcat. You’ll need to add user/password for logging into the webapp – if you’re using Tomcat, add your username/password in Tomcat’s conf/tomcat-users.xml file. Read the configuration howto for more details.
The following diagrams show the same Run dialog box settings.
If you want to run the jiplet container as a Jboss application:
- Setup an environment variable called JBOSS_HOME pointing to the directory where Jboss is installed.
- Start the Jboss server by executing the following command:$ cd $JBOSS_HOME/bin
$ run -c default
- Run the ant target – deploy-jboss. Note that you must have run the compile, build-jboss and build-console targets.
Use your browser to access the Mgmt application at