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

Server startup errors


If any of the configurations fail to start during server startup, the server will automatically be shutdown. Most errors during startup are logged to the command window, as well as to the geronimo.log file under the <GERONIMO_HOME>/var/log directory ( <GERONIMO_HOME>/<INSTANCE_NAME>/var/log directory in the case of a non-default instance). Here are some common startup errors and ways to resolve these errors.

BindException

A BindException is thrown when a GBean attempts to bind to a port that is already in use by another process on the system. A typical log entry for this kind of error is shown below:

2009-07-14 00:02:14,642 ERROR [GBeanInstanceState] Error while starting; GBean is now in the FAILED state: abstractName="org.apache.geronimo.framework/rmi-naming/2.1.4/car? ServiceModule=org.apache.geronimo.framework/rmi-naming/2.1.4/car, j2eeType=GBean,name=RMIRegistry"
java.rmi.server.ExportException: Port already in use: 1099; nested exception is:
java.net.BindException: Address already in use: JVM_Bind
at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:249)
...

Some of the reasons due to which this error may occur, and the associated remedies are:

  • The server instance is already running in a different server process. There is nothing to do in this case.

  • You are attempting to start a different server instance created using the multiple instances feature provided by Geronimo, and the org.apache.geronimo.server.name system property is not set. Make sure that you set the org.apache.geronimo.server.name system property correctly, by using the GERONIMO_OPTS environment variable.

  • You are attempting to start a different server instance created using the multiple instances feature provided by Geronimo, and the org.apache.geronimo.server.name system property is set correctly. The PortOffset property in the config-substitutions.properties file under <GERONIMO_HOME>/<INSTANCE_NAME>/var/config may not have been set correctly. Set the PortOffset property so that the conflict is resolved. Remember that this property is used to offset the server ports when using multiple instances within the same installation.

IllegalArgumentException due to a wrong instance name

An IllegalArgumentException is thrown when you attempt to start a non-existent server instance. A message similar to the following is logged to the console:

11:49:26,439 ERROR [GBeanInstanceState] Error while starting; GBean is now in the FAILED state: abstractName="org.apache.geronimo.framework/j2ee-system/2.1.4/car? ServiceModule=org.apache.geronimo.framework/j2ee-system/2.1.4/car, j2eeType=GBean,name=ServerInfo"
java.lang.IllegalArgumentException: Server directory is not a directory: C:\book\temp\geronimo-tomcat6-javaee5-2.1.4\wrong_inst
at org.apache.geronimo.system.serverinfo.BasicServerInfo.deriveBaseServer(BasicServerInfo.java:187)
...

To resolve this problem, specify the correct instance name in the org.apache.geronimo.server.name system property.

InvalidConfigurationException

An InvalidConfigurationException is thrown when a configuration that the server is attempting to start does not exist. One reason due to which this can happen is with the multiple server instances feature, when a configuration deployed through one server instance is undeployed through a different server instance, which results in entries corresponding to that configuration being left out of the config.xml files. A typical error message logged in this case looks like the following:

org.apache.geronimo.kernel.config.InvalidConfigException: Could not locate configs to start: [packt-samples/helloworld/1.0/war]
at org.apache.geronimo.system.main.EmbeddedDaemon.doStartup(EmbeddedDaemon.java:167)

To resolve this problem, edit the config.xml file and remove the problematic configuration entries.