|
20.7. Apache GeronimoAn up-and-coming alternative to JBoss is Apache Geronimo. Part of the Apache Software Foundation's set of projects, Geronimo is an Open Source, Apache-licensed[17] implementation of the J2EE specification. Furthermore, Geronimo aims to be an Open Source J2EE implementation that is J2EE-certified by Sun.[18] We will take a quick walk through the installation of the Apache Geronimo Java application server. Geronimo not only runs servlets and JSP, but it is also, as we shall see in later chapters, a J2EE EJB container, so the installation part of this chapter is important for using the examples and technologies covered in the remaining chapters.
Example 20.6. Ant build.xml for the BudgetPro servlet and JSP examples<!-- ================ File and Directory Names ================= --> <!-- ... app.name The name of our application, used for file/dir names. build.home The name of the directory into which the "compile" target will generate its output. server.home The name of the directory where the Web server is installed. deploy.home The name of the directory into which the WAR file will be copied. --> <property name="server.home" value="/usr/local/jboss" /> <property name="deploy.home" value="${server.home}/server/default/deploy"/> <!-- ... --> <!-- ================ Deploy Target ============================ --> <!-- The "deploy" target copies the WAR file into a location required (i.e., defined) by the servlet container. For some servlet containers, you must restart them before they will recognize our new/modified Web application. Others may reload automatically. --> <target name="deploy" depends="compile" description="Deploy application to servlet container"> <!-- Copy the contents of the build directory --> <mkdir dir="${deploy.home}"/> <copy todir="${deploy.home}" file="${app.name}.war"/> </target> <!-- ... --> <!-- ================ Product WAR file ========================= --> <target name="war" depends="compile" description="Create WAR file to be deployed"> <war destfile="${app.name}.war" webxml="web/WEB-INF/web.xml"> <fileset dir="${build.home}"/> </war> </target> Geronimo is a complete application server. It provides a full, production-ready, J2EE environment. It is the stated goal of the Geronimo project to pass the Sun J2EE certification tests. Such certification will, in all probability, quickly make Geronimo one of the most widely used J2EE application servers. A great deal of Geronimo information can be found on the Geronimo Web site.[19]
Note As of this writing, the project was just nearing the certification process. Only the milestone releases were available for downloading. By the time you read this, however, a fully certified version will likely be production-ready. There may be slight differences in the download and installation procedures. Be sure to follow the instructions from the Web site and any readme files for the most up-to-date information. First off, you must choose what form of the product to download. The choice is really between a binary and source distribution. Within that choice, you can choose between two compression methods, zip or tar/ gzip. While the first is typical for Windows distributions and the second for Linux, you can choose either, as Linux has utilities for decompressing both. More importantly, the binaries are Java JAR files so they are not tied to a particular operating system. We will download and install a binary. Just click on the tar.gz filename and save the file. If you haven't read the previous sections because you were going to skip JBoss and just use Geronimo, please go back and read Section 20.3. It deals with administration and privileges for setting up your installation, and you'll want to know that for this chapter's installation discussion, too. |
|