Oracle GlassFish Server 3.0.1 Administration Guide

ProcedureTo Configure a Domain for Automatic Restart on Windows

On Windows, you can use the asadmin create-service subcommand to create a Windows service that restarts a Domain Administration Server (DAS).

  1. Create the service by using the create-service(1) subcommand.

  2. After the service is created, start the service by using the Windows Services Manager or the Windows Services Wrapper.

    For example, to start the service for the default domain by using the Windows Services Wrapper, type:

    C:\glassfishv3\glassfish\domains\domain1\bin\domain1Service.exe  start

Example 3–10 Creating a Service on a Windows System

This example creates a service for the default domain on a system that is running Windows.

asadmin> create-service
Found the Windows Service and successfully uninstalled it.
The Windows Service was created successfully.  It is ready to be started.  Here are 
the details:
ID of the service: domain1
Display Name of the service:domain1 GlassFish Server
Domain Directory: C:\glassfishv3\glassfish\domains\domain1
Configuration file for Windows Services Wrapper: C:\glassfishv3\glassfish\domains\
The service can be controlled using the Windows Services Manager or you can use the
Windows Services Wrapper instead:
Start Command:  C:\glassfishv3\glassfish\domains\domain1\bin\domain1Service.exe  start
Stop Command:   C:\glassfishv3\glassfish\domains\domain1\bin\domain1Service.exe  stop
Uninstall Command:  C:\glassfishv3\glassfish\domains\domain1\bin\domain1Service.exe
Install Command:  C:\glassfishv3\glassfish\domains\domain1\bin\domain1Service.exe

This message is also available in a file named PlatformServices.log in the domain's 
root directory
Command create-service executed successfully.