Book Image

Apache Geronimo 2.1: Quick Reference

Book Image

Apache Geronimo 2.1: Quick Reference

Overview of this book

Apache Geronimo is a robust, scalable, secure, and high-performing application server. But like all application servers, this power comes with a steep learning curve. This book can help you save your time and get working with Geronimo in matter of a few hours. This book is a quick-reference guide to Apache Geronimo that mitigates the starting pains that most developers have when they migrate to a new Application Server. It will help you to extend and amplify your existing development skills, empowering you to build new types of applications regardless of the platform or browser. The book will introduce you to the exciting features of Apache Geronimo Application Server. You will see how easily you can develop and deploy Java EE 5 applications on Geronimo. It covers everything from downloading the server to customizing it using custom GBeans. By following the practical examples in this book, you will be able to develop applications quickly using Geronimo Eclipse Plugin. The book covers Geronimo internals in detail, which helps you write custom services on Geronimo. Also, it helps you to gain a deep understanding of Geronimo plugin architecture and teaches you to extend your server functionality via plugins. By the end of the book, you will develop proficiency in Geronimo and Java EE 5 application development.
Table of Contents (21 chapters)
Apache Geronimo 2.1
Credits
About the Authors
About the Reviewer
Preface

Downloading and running Apache Geronimo


Apache Geronimo can be downloaded from the project's web site at http://geronimo.apache.org. The Downloads section has the latest version as well as previous releases. The server is available for download in .zip and tar.gz formats.

Download the ZIP file and then extract it to a directory on your drive. Let us refer to this directory as <GERONIMO_HOME>. Open a command window and change directory to <GERONIMO_HOME>/bin. Set either the JAVA_HOME or the JRE_HOME environment variable to a directory where Sun Java 1.5 is installed, and type start-server, in Windows, or ./start-server, in Linux. This will start the Geronimo server in the same command window. The following screenshot shows the command-line console output from Geronimo server startup:

The console displays the port numbers on which the various services are running, a list of Started Application Modules, and the context-root for the running web applications.

You can use startup to start Geronimo in a new window. If you want to start GShell (a Java-based shell for Geronimo), then you need to use gsh. Invoking the GShell results in a new shell prompt in the format user@hostname:/>, for example, administrator@foo:/>.

GShell supports a large number of commands to perform a variety of operations in Geronimo. You can start or stop the server, install or uninstall applications, and even export a new server from the current installation. To get a list of commands that are supported by GShell, type help at the prompt.

To start the server from GShell, type geronimo/start-server at the GShell prompt. To stop the server, open another GShell prompt and enter geronimo/stop-server. You will be prompted to enter the username and password. Enter system for the Username and manager for the Password.

Note

If you encounter any port conflicts during startup, you will need to either shut down the other services that are using those ports or you will need to configure the Geronimo installation to use other ports. The steps for doing this are given in Appendix-B, Troubleshooting.

Geronimo Administration Console

Geronimo has a powerful web-based Administration Console, consisting of portlets developed using Apache Pluto that can be used for various administrative tasks. The Administration Console provides a convenient and user friendly way to administer many aspects of the server. Once the Geronimo server has been started, the Administration Console can be accessed by using the URL http://localhost:8080/console. The default Username is system and the default Password is manager. The following figure shows the layout of the Administration Console.

The portlets are grouped into various portlet groups, such as, Server, Services, Applications, Security, and so on, according to the functions addressed by the portlets. The portlets can be broadly divided into the following two categories:

  • Portlets to monitor the server: Information portlet, Java System Info portlet, Monitoring portlet, Repository portlet, and DB Info portlet are some of the portlets that help monitor the server status.

  • Portlets to perform administrative operations: Web Server portlet, JMS Server portlet, Database Pools portlet, portlets under Applications group, and DB Manager portlet are some of the portlets that help in administering some aspect of the server.

In this section, we will briefly introduce some of the commonly-used portlets. See Chapter 10, Administration for more details on Administration Console.

Information portlet

The Information portlet is launched by clicking on the Information link under the Server portlet group in Console Navigation pane. This portlet displays information on the version number of the Geronimo server, the server Start Time, the server Up Time, the Name of the operating system, the JVM in which the server is running, and the current Server Memory Usage.

Java System Info portlet

The Java System Info portlet is launched by clicking on the Java System Info link under the Server portlet group in Console Navigation. This portlet displays the system properties set in the JVM in which the server is running. For display purposes, the system properties are grouped into Java, Virtual Machine, Operating System, Sun, User, and Etc groups.

Server Logs portlet

The Server Logs portlet is launched by clicking on the Server Logs link under the Server portlet group in Console Navigation. This portlet enables you to browse the server log messages, web access log messages, and Derby database log messages. The portlet provides the ability to filter the log messages based on various criteria, such as displaying log messages containing specified text, generated within a specific date range, and so on. The portlet also features a Log Manager, which allows the server log settings to be temporarily altered.

Web Server portlet

The Web Server portlet is launched by clicking on the Web Server link under the Server portlet group in Console Navigation. This portlet enables you to add new HTTP, HTTPS, and AJP ports or listeners to the web container, and perform Start, Stop, Restart, Edit, and Delete operations on existing listeners. In order to add a new HTTP port to the web container, click on Tomcat BIO HTTP Connector. On the next page, enter a uniqueName for the connector, change the default port number to a port number of your choice, and click on Save.

JMS Server portlet

The JMS Server portlet is launched by clicking on the JMS Server link under the Server portlet group in Console Navigation. This portlet enables you to add new JMS listeners and perform Start, Stop, Edit, and Delete operations on existing JMS listeners.

Repository portlet

The Repository portlet is launched by clicking on the Repository link under the Services portlet group in Console Navigation. This portlet displays a list of JAR files and configurations deployed on the server. The portlet also provides the ability to install a new archive into the server's repository.

JMS Resources portlet

The JMS Resources portlet is launched by clicking on the JMS Resources link under the Services portlet group in Console Navigation. This portlet enables you to create new JMS resources such as Connection Factory, Queue, and Topic.

Database Pools portlet

The Database Pools portlet is launched by clicking on the Database Pools link under the Services portlet group in Console Navigation. This portlet enables you to Create a new database pool: Using the Geronimo database pool wizard and to perform Edit and Delete operations on existing database pools. You can also Run SQL commands against an existing data source.

Deploy New portlet

The Deploy New portlet is launched by clicking on the Deploy New link under the Applications portlet group in Console Navigation. This portlet enables you to deploy a new application or a new service into the server. An archive or a Geronimo specific deployment plan, or both can be used to deploy new applications and services.

Plan Creator portlet

The Plan Creator portlet is launched by clicking on the Plan Creator link under the Applications portlet group in Console Navigation. This portlet enables creating a Geronimo specific deployment plan required to deploy an archive in a sequence of steps, and deploying the archive using the generated deployment plan.

Plugins portlet

The Plugins portlet is launched by clicking on the Plugins link under Applications portlet group in Console Navigation. This portlet provides the ability to install plugins onto a Geronimo server, export existing configurations as Geronimo plugins, and create a custom server assembly from configurations and plugins running in the server.

Applications portlets

The Applications portlets lets you view the running status of the applications, perform operations like Stop, Start, Restart, and Uninstall applications. There are multiple portlets for this purpose, each of which displays a selected group of configurations running on the server. The portlets that fall into this category are:

  • Web App WARs portlet: Shows the web applications deployed on the server

  • System Modules portlet: Shows the services (such as ActiveMQ, Axis, and so on) deployed on the server

  • Application EARs portlet: Shows the enterprise applications deployed on the server

  • EJB JARs portlet: Shows the EJB applications deployed on the server

  • J2EE Connectors portlet: Shows the database pool and JMS resource configurations deployed on the server

  • App Clients portlet: Shows the enterprise application clients installed on the server

Users and Groups portlet

The Users and Groups portlet is launched by clicking on the Users and Groups link in the Security portlet group under Console Navigation. This portlet enables you to add new users, add new groups, change an existing user password, edit an existing group to change the user membership of the group, delete an existing user, and delete an existing group. Note that users belonging to the admin group have access to the Administration Console.

DB Info portlet

The DB Info portlet is launched by clicking on the DB Info link in the Embedded DB portlet group under Console Navigation. This portlet displays information on the embedded Derby database server.

DB Manager portlet

The DB Manager portlet is launched by clicking on the DB Manager link in the Embedded DB portlet group under Console Navigation. This portlet enables an administrator to create new databases, delete an existing database, run SQL commands against an existing database, view database tables, and browse the contents of database tables.