The Java EE 7 Tutorial

Previous
Next

2.2 Starting and Stopping GlassFish Server

You can start and stop GlassFish Server using either NetBeans IDE or the command line.

2.2.1 To Start GlassFish Server Using NetBeans IDE

  1. Click the Services tab.

  2. Expand Servers.

  3. Right-click the GlassFish Server instance and select Start.

2.2.2 To Stop GlassFish Server Using NetBeans IDE

To stop GlassFish Server using NetBeans IDE, right-click the GlassFish Server instance and select Stop.

2.2.3 To Start GlassFish Server Using the Command Line

To start GlassFish Server from the command line, open a terminal window or command prompt and execute the following:

asadmin start-domain --verbose

A domain is a set of one or more GlassFish Server instances managed by one administration server. The following elements are associated with a domain:

  • The GlassFish Server port number: The default is 8080.

  • The administration server's port number: The default is 4848.

  • An administration user name and password: The default user name is admin, and by default no password is required.

You specify these values when you install GlassFish Server. The examples in this tutorial assume that you chose the default ports as well as the default user name and lack of password.

With no arguments, the start-domain command initiates the default domain, which is domain1. The --verbose flag causes all logging and debugging output to appear on the terminal window or command prompt. The output also goes into the server log, which is located in domain-dir/logs/server.log.

Or, on Windows, from the Start menu, choose All Programs, then choose Java EE 7 SDK, then choose Start Application Server.

2.2.4 To Stop GlassFish Server Using the Command Line

To stop GlassFish Server, open a terminal window or command prompt and execute:

asadmin stop-domain domain1

Or, on Windows, from the Start menu, choose All Programs, then choose Java EE 7 SDK, then choose Stop Application Server.

Previous
Next