3.4. Starting the Server

Once Geronimo has been installed, it must be started from the command line. Open a console window or shell prompt, change to the Geronimo installation directory, and run a command like this to start the server:

java -jar bin/server.jar

You should see output like this:

Booting Geronimo Kernel (in Java 1.5.0_07)...
Starting Geronimo Application Server v1.1
[************************] 100%  25s Startup complete
  Listening on Ports:
    1099 0.0.0.0 RMI Naming
    1527 0.0.0.0 Derby Connector
    4201 0.0.0.0 ActiveIO Connector EJB
    4242 0.0.0.0 Remote Login Listener
    8009 0.0.0.0 Jetty Connector AJP13
    8080 0.0.0.0 Jetty Connector HTTP
    8443 0.0.0.0 Jetty Connector HTTPS
    9999 0.0.0.0 JMX Remoting Connector
   61616 0.0.0.0 ActiveMQ Message Broker Connector

  Started Application Modules:
    EAR: geronimo/webconsole-jetty/1.1/car
    RAR: geronimo/activemq/1.1/car
    RAR: geronimo/system-database/1.1/car
    WAR: geronimo/remote-deploy-jetty/1.1/car
    WAR: geronimo/welcome-jetty/1.1/car

  Web Applications:
    http://remus:8080/
    http://remus:8080/console
    http://remus:8080/console-standard
    http://remus:8080/remote-deploy

Geronimo Application Server started

During the startup, the first thing that happens is that the "Kernel" has started, which is responsible for loading and managing all the other components of the server. After that, several modules are loaded and started (the names appear on the progress line during the startup, but are replaced by the "Startup complete" message at the end). The default Geronimo installation currently starts a number of modules (and includes several more that are available but not started by default). As you might expect, the Little G distribution does not include as many modules as the full Geronimo J2EE distribution.

As suggested by the port list, the default services include:

In addition, a number of other services are started that do not require additional network ports, including:

[Tip]Tip

It is not actually necessary to start Geronimo from any particular directory. So long as you pass the correct server.jar location on the Java command line, you can run the start command from any directory on the file system.

3.4.1. Startup Options

When starting Geronimo, there are several options you may pass on the command line:

-quiet

Suppresses the progress bar display during startup. This is typically used when redirecting the console output to a file, since the progress bar updates look somewhat bizarre when viewed by, for example, a text editor.

--long

Instead of the progress bar format, list each configuration along with its startup time as it is started. This is also a good format for scripts.

-v

Normally, Geronimo displays INFO and higher log output on the console, though all log output is saved to the server log file. This option reduces the threshold for console output to DEBUG, meaning you'll see somewhat more output from your own applications or libraries. It also disables the startup progress bar (since at this output level, it would typically be mangled by log output that occurs during the startup sequence).

-vv

Similar to -v, except the console log threshold is set to TRACE.

Additionally, it's possible to pass specific configuration names on the command line, such that Geronimo only starts with the listed configurations enabled. However, this is quite risky as if certain required configurations aren't listed, the server may not start properly or it may not be possible to deploy applications to the server. It's best to avoid this except in extreme circumstances.

3.4.2. Startup Scripts

There are two startup scripts, which are very similar to the startup scripts that Tomcat uses.

startup.bat / startup.sh

This script launches a Geronimo server in the background. Standard output is sent to var/log/geronimo.out, in addition to the normal server log at var/log/geronimo.log.

geronimo.bat / geronimo.sh

This script takes arguments that control what it does, including:

  • run -- starts Geronimo in the foreground

  • start -- starts Geronimo in the background

  • stop -- stops a running Geronimo server

  • jpda run -- starts Geronimo in the foreground, configured for JPDA debugging on port 8000

  • jpda start -- starts Geronimo in the background, configured for JPDA debugging on port 8000

Both of these scripts use a number of environment variables, mainly used to configure JVM options such as Java home directory (JAVA_HOME), memory limits (JAVA_OPTS), debugger configuration (JPDA_ADDRESS, JPDA_SUSPEND), and so on. These options are documented at the top of the geronimo.bat and geronimo.sh scripts.

[Tip]Tip

Any environment variables that should be set on every run can be configured in a new file named geronimo-1.1/bin/setenv.bat or geronimo-1.1/bin/setenv.sh, and that file will be executed every time one of the scripts above is used.

3.4.3. Troubleshooting Startup Problems

Most server startup problems result in one or more stack traces. They also include a line like this:

89 ERROR [GBeanInstanceState] Error while starting; GBean is now
   in the FAILED state: abstractName="geronimo/jetty/1.1/car?
   ServiceModule=geronimo/jetty/1.1/car,j2eeType=GBean,
   name=JettyAJP13Connector"

The "GBean is now in the FAILED state" message means that one of the services failed to start. Normally, Geronimo will not start if any of the services failed. The problem that caused this is usually in the stack trace after that. The most common problem is:

java.net.BindException: Address already in use
        at java.net.PlainSocketImpl.socketBind(Native Method)
        at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:331)
        ...

This message means that one of the network ports that Geronimo is attempting to use is already in use. This often happens for the web ports (8009, 8080, 8443), or possibly the JNDI port (1099). If you can't shut down the product listening on the port in question, you'll need to change the offending port. See Section 5.1, “Network Configuration” for a more detailed discussion of the network ports used by Geronimo.