You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 14 Next »

An integrated development environment (IDE) provides facilities for software development and typically consists of editors for editing source code, a compiler, project management tools, build automation tools and debugging tools. IDEs help in increasing the productivity by automating many tasks and often provide one-step process for creating a ready to use binary from source code. Eclipse and NetBeans are two most popular IDEs. IDEs that enable Java EE development also provide integration of Java EE Server runtime environments so that the developer can quickly see the effect of the changes being made to the application without having to create the binaries explicitly.

The Apache Geronimo Development Tools project is aimed at providing a rich set of development tools for Geronimo, focusing on application development, migration and IDE integration. The two major tools available currently are Geronimo Eclipse Plugin (GEP) and JBoss to Geronimo Migration Tool (J2G). Also, a Geronimo NetBeans Plugin is under development in Geronimo Sandbox. This article on setting up a development environment is organized as given below:

Options and tools

The Geronimo Eclipse Plugin (GEP) provides integration between Geronimo and the Web Tools Platform (WTP). With this plugin, users will be able to use the features in WTP to create, deploy and debug applications on Geronimo.

The Geronimo Eclipse Plugin (GEP) requires the following prerequisite software (Note: Update the list once GEP 2.1 is released).

  • Sun JDK 5.0 (J2SE 5.0)
  • Eclipse 3.3.1.1 (Eclipse Classic package of Europa distribution), which is platform specific
  • Web Tools Platform (WTP) 2.0.1
  • Data Tools Platform (DTP) 1.5.1
  • Eclipse Modeling Framework (EMF) 2.3.1
  • Graphical Editing Framework (GEF) 3.3.1

Sun JDK 5.0 can be downloaded from Sun's J2SE 5.0 Downloads site. WTP and all the other prerequisites can be downloaded from WTP Downloads site.

Geronimo server can be installed from within Geronimo Eclipse Plugin. This feature does not work currently for 2.1 server. Download Geronimo 2.1 server from http://www.apache.org/dist/geronimo/ and extract the archive to a directory of your choice (for e.g. C:\g). The archive will be extracted to a directory geronimo-tomcat6-javaee5-2.1 (for e.g. C:\g\geronimo-tomcat6-javaee5-2.1) or geronimo-jetty6-javaee5-2.1 depending on whether you downloaded Geronimo 2.1 distribution with Tomcat or Jetty as the web container. We will refer to this directory as <geronimo_home> from now on.

Installing Eclipse

The prerequisite software for GEP can be downloaded either as a single download or individual downloads. In this section we discuss the various options available to install the prerequisite software.

WTP All-in-One package

WTP along with all the other prerequisites can be downloaded in one combined bundle from WTP Downloads site. Download WTP All-In-One Package specific to your platform from v2.0.1 of WTP. Extract the archive to a directory of your choice (for e.g. C:\wtp). The archive will be extracted to a directory named eclipse under the directory you specified (for e.g. C:\wtp\eclipse), referred to as <eclipse_home> from now on. This completes the installation of eclipse.

Eclipse and WTP downloaded separately

Alternatively you can download Eclipse and WTP separately and install the prerequisites using the following steps:

  1. Download Eclipse 3.3.1.1 from http://www.eclipse.org/downloads/.
  2. Extract the archive to a directory of your choice (for e.g. C:\wtp). The archive will be extracted to a directory named eclipse under the directory you specified (for e.g. C:\wtp\eclipse), referred to as <eclipse_home> from now on.
  3. In WTP Downloads site, follow the link corresponding to v2.0.1 of WTP.
  4. Download each of the prerequisites DTP, EMF and GEF and extract the archives to <eclipse_home>.
  5. Download the wtp-sdk package listed under Web Tools Platform Complete and extract the archive to <eclipse_home>

Launch Eclipse by running <eclipse_home>/eclipse. Make sure that the JDK in the PATH is Sun JDK 5.0.

Installing Geronimo Eclipse Plugin

The Geronimo Eclipse Plugin (GEP) can be installed using the following options:

  1. Using WTP
  2. Using Eclipse Update Manager
  3. Manual Installation

#1. Install GEP Using WTP

The GEP can be installed directly from within WTP while defining a server runtime. Follow the steps below to install GEP:

  1. Launch Eclipse by running <eclipse_home>/eclipse.
  2. Launch the Define a New Server dialog using one of the following:
    • From the Servers view in the Java EE Perspective: Right-click, New, Server.
    • From any Perspective: Select File, New, Other, Server



  3. Click on the Download additional server adapters link.



  4. In the Install New Server Adapter dialog, select Geronimo v2.1 Server Adapter and click Next.
  5. Read and accept any License Agreements and click Finish. Click OK to continue installation.

This will download and install the GEP. The Progress view will display the installation status. Once the installation is completed, restart Eclipse. Define a New Server dialog will now show an Apache Geronimo v2.1 Server option under Apache.



#2. Install GEP Using Eclipse Update Manager

The GEP can also be installed via the Eclipse Update manager by creating a new remote site pointing to http://www.apache.org/dist/geronimo/eclipse/updates/. Follow the steps below to install GEP:

  1. Launch Eclipse by running <eclipse_home>/eclipse.
  2. Open the Eclipse Update Manager as follows:
    • Select Help, Software Updates, Find and Install.
    • Select Search for new features to install and click Next.



  3. Create a Eclipse Remote Update Site as follows:
  4. Select only the Geronimo Eclipse Update Site in the Sites to include in search selection box and click Finish.
  5. Select a mirror and click OK if prompted to do so.

(Note: Add more instructions once GEP for 2.1 is released. Currently the Geronimo Eclipse Update site does not host GEP v2.1)

#3. Manual Installation of GEP

Download the GEP 2.1 from http://www.apache.org/dist/geronimo/eclipse/. Close Eclipse if it is already running. Extract the archive to <eclipse_home>. Launch Eclipse by running <eclipse_home>/eclipse.

Defining Servers

Follow the steps below to define a new Geronimo v2.1 Server:

  1. Launch eclipse by running <eclipse_home>/eclipse.
  2. Launch the Define a New Server dialog using one of the following:
    • From the Servers view in the Java EE Perspective: Right-click, New, Server.
    • From any Perspective: Select File, New, Other, Server.



  3. Select Apache Geronimo v2.1 Server and click Next.



  4. Select Workbench default JRE (click Installed JREs to add any new JREs and return to this dialog once done), enter the directory name or browse to <geronimo_home> and click Next. (Note: Download options part of this dialog does not work currently.)



  5. Select the location of the archive containing Geronimo source and click Next. This is required only if you intend to debug into Geronimo source code.
  6. Modify Hostname, Administrator Id, Administrator password, Web Connector port and RMI Naming port if necessary and click Finish. Normally you will not need to change the default values for these fields for a newly installed Geronimo 2.1 server.



This completes defining a new Geronimo 2.1 Server runtime and server. The newly added server will appear in the Servers view. The server can be started by selecting the server and clicking on the Start server button.



Additional servers using the same Geronimo 2.1 installation can be defined in a similar manner. If you intend to define additional servers that use a different Geronimo 2.1 installation, you will need to create a new Server runtime as given below:

  1. Launch the Installed Server Runtime Environments dialog using one of the following:
    • In Define a New Server dialog, click on Installed Runtimes... button.
    • Click Window, Preferences, Server, Installed Runtimes.



  2. Click Add to launch New Server Runtime dialog.
  3. Select Apache Geronimo v2.1 Runtime, check Also create new local server and click Next.



  4. Select a 5.0 JRE, enter the directory name or browse to the directory where Geronimo 2.1 server is installed and click Next.



  5. Select the location of the archive containing Geronimo source and click Next. This is required only if you intend to debug into Geronimo source code.
  6. Modify Hostname, Administrator Id, Administrator password, Web Connector port and RMI Naming port if necessary.



  7. Click Finish to return to Installed Server Runtime Environments dialog.

The newly added server runtime can be selected from Server runtime drop-down in Define a New Server dialog while defining a new server.

Creating a new project

To create a new Web project, follow the steps below:

  1. Click File, New, Project to launch the New Project dialog.
  2. Select Dynamic Web Project and click Next.



  3. Enter mywebapp for project name, select Apache Geronimo v2.1 Runtime for Target Runtime, select Default Configuration for Apache Geronimo v2.1 Runtime and click Finish.



  4. In the Project Explorer view, Right click on mywebapp and select New, JSP.
  5. Enter index.jsp for File name and click Finish.
  6. Change the content of index.jsp to the following:
    index.jsp
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>My WebApp</title>
    </head>
    <body>
    <h1>Welcome to My WebApp</h1>
    </body>
    </html>
    
  7. Right-click on mywebapp and select Run As, Run on Server.
  8. Click Choose and existing server, select Apache Geronimo v2.1 Server at localhost and click Finish.

The application will be run on the selected server and the welcome page will display in a web browser window inside eclipse.

Configuring your development environment

Editing a Server configuration

In order to edit the configuration of a server, double click on server in the Servers view to open the overview of the server as shown below.



  • Security Credentials
    The default User ID is system with a password manager. If your server installation uses a different set of credentials, change these accordingly.
  • Automatic Publishing
    All servers use the default publishing settings. The server can be configured to not publish automatically by selecting the Never publish automatically option. The default publish setting can be overridden by selecting the Override default settings option and providing a new Publish interval.
  • Port Configuration
    The default HTTP and RMI ports are 8080 and 1099 respectively. If your server installation uses a different HTTP and/or RMI port, edit these values accordingly.
  • Console Output
    The default server console output log level is INFO. If you want to enable debug output to console, select DEBUG.
  • Server Startup
    The settings under this section control the ping thread that polls to the server while the server is starting up. (Need to figure the exact use of these setting)
  • Server VM Arguments
    Any additional arguments to be passed on to the server VM can be specified here.
  • No labels