Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This service wrapper allows three different methods of integration depending on, among other things, whether you use the same class or not to start and stop the server.

For Geronimo we will use the WrapperStartStopApp main class since we use two different classes to start and stop the server.We use simplest method of integration as the server can shutdown cleanly when System.exit() is called. For this integration the wrapper's mainclass is set to WrapperSimpleApp and the org.apache.geronimo.cli.daemon.DaemonCLI class without any additional paramenters to start the server, to stop it we use org.apache.geronimo.kernel.util.MainBootstrapper. The class used to stop de server takes four additional parameters corresponding to the user and password. In addition, the wrapper requires to pass the number (count) of paramenters the class will receive, all these are specified as is specified as the main class to start the server. Right now, no extra parameters are passed to start the server but they can be specified by adding additional wrapper.app.parameter values. The wrapper will stop the server by calling System.exit().

As we mentioned before, for this example we are trying to locate all the wrapper related files within the Geronimo directory structure. As you can see in the wrapper.conf shown above, most of the directory references are relative to Geronimo's installation directory. You will only have to replace <geronimo_home> and <java_home> with the appropriate settings for your environment.

Next we will create a batch file to run the service from the commnad command line without the need of actually installing the service. This is particularly helpful when testing and debuggin debugging the configuration. Create the g_service.bat batch file in the <geronimo_home>/bin directory and copy the content of the following example.

...

No Format
bgColor#000000
borderStylesolid
{D:\geronimo-tomcat6-jee5-2.0\bin>g_service.bat
wrapper  | --> Wrapper Started as Console
wrapper  | Launching a JVM...
jvm 1    | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
jvm 1    |   Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.
jvm 1    |
jvm 1    | Booting Geronimo Kernel (in Java 1.5.0_06)...
jvm 1    | Starting Geronimo Application Server v2.0
jvm 1    |
jvm 1    | [*                                ]  0%   0s Loading
jvm 1    | [*-                               ]  0%   0s  Loading org.apache.ge...
jvm 1    | [*>                               ]  6%   0s  Loading org.apache.ge...

...

jvm 1    | [*********************************] 100%  19s Startup complete
jvm 1    |   Listening on Ports:
jvm 1    |     1050 127.0.0.1 CORBA Naming Service
jvm 1    |     1099 0.0.0.0   RMI Naming
jvm 1    |     1527 0.0.0.0   Derby Connector
jvm 1    |     2001 127.0.0.1 OpenEJB ORB Adapter
jvm 1    |     4201 0.0.0.0   org.apache.geronimo.openejb.EjbDaemonGBean
jvm 1    |     4242 0.0.0.0   Remote Login Listener
jvm 1    |     6882 127.0.0.1 OpenEJB ORB Adapter
jvm 1    |     8009 0.0.0.0   Tomcat Connector AJP
jvm 1    |     8080 0.0.0.0   Tomcat Connector HTTP
jvm 1    |     8443 0.0.0.0   Tomcat Connector HTTPS
jvm 1    |     9999 0.0.0.0   JMX Remoting Connector
jvm 1    |    61613 0.0.0.0   ActiveMQ Transport Connector
jvm 1    |    61616 0.0.0.0   ActiveMQ Transport Connector
jvm 1    |
jvm 1    |   Started Application Modules:
jvm 1    |     EAR: org.apache.geronimo.configs/webconsole-tomcat/2.0/car
jvm 1    |     RAR: org.apache.geronimo.configs/activemq-ra/2.0/car
jvm 1    |     RAR: org.apache.geronimo.configs/system-database/2.0/car
jvm 1    |     WAR: org.apache.geronimo.configs/dojo-tomcat/2.0/car
jvm 1    |     WAR: org.apache.geronimo.configs/remote-deploy-tomcat/2.0/car
jvm 1    |     WAR: org.apache.geronimo.configs/welcome-tomcat/2.0/car
jvm 1    |
jvm 1    |   Web Applications:
jvm 1    |     http://localhost:8080/
jvm 1    |     http://localhost:8080/console
jvm 1    |     http://localhost:8080/console-standard
jvm 1    |     http://localhost:8080/dojo
jvm 1    |     http://localhost:8080/remote-deploy
jvm 1    |
jvm 1    | Geronimo Application Server started

CongratullationsCongratulations!!! you have now Geronimo server running as a Windows service.

The next step is to acctually actually install the service so it can be picked up at Windows start time as well as managed along with the other existing services.

...