Introduction
This article shows how to stop the process of Glassfish Application Server. The process for terminating the process so that the service provided by Glassfish Application Server will stop is simple. Terminate or stop the service using a specific command. By terminating or stopping the associated process, the service of the Glassfish Application Server will automatically stop. The execution of the command for terminating the process is done in the command line interface. There are two parts to achieve the described purpose. The first part is to connect to the Glassfish Administration Console. The latter is to stop the actual process of the Glassfish Application Server.
Connect to the Glassfish Application Server
Below are the steps for terminating the Glassfish Application Server’s process :
1. Just execute or access the command line interface. Find out where is the exact location of the Glassfish Application Server’s source location. In this context for an example, the location of the Glassfish Application Server is in the ‘/opt’ folder.
2. In order to stop the process, obviously there must a process running on the first place. So, check the running process of the Glassfish Application Server. There are several ways for checking the running process of the Glassfish Application Server. If it is running using the default port, just access the address via web browser with an additional of port ‘8080’. For an example, access the URL of http://localhost:8080. Furthermore, check the article in this link to know how to check the running process of Glassfish Application Server.
3. Next step, switch to the designated user account for managing the Glassfish Application Server process. If there is a running process of Glassfish Application Server, use that account to stop it. For an example, in this context, the user account is ‘glassfish’. Execute the following command to switch to that account :
user@hostname:~$ sudo su - glassfish [sudo] password for user : $
- Finally, don’t forget to run or to execute the following command to stop the Glassfish Application Server process. Before that, just connect to the Glassfish Administration Console. The following is an example for connecting to the Glassfish Administration Console. For an example, the source of Glassfish Application Server is available in the folder ‘/opt’. Just connect first as follows :
$ /opt/glassfish4/glassfish/bin/asadmin asadmin>
Stop the Glassfish Application Server
At last, this part is the most important part. After successfully connect to the Glassfish Administration Console, stop the process. Below, it is the command pattern to stop the process of the Glassfish Application Server :
stop-domain
The execution of the above command pattern to stop the Glassfish Application Server process exist as follows :
Don’t forget to start the command to stop or to terminate the Glassfish Application Server process using the above command pattern as follows :
asadmin> stop-domain Waiting for the domain to stop . Command stop-domain executed successfully. asadmin> quit
Actually, three is one single line of command to connect to the Glassfish Application Server and to stop the process of the Glassfish Application Server. The following is the command pattern to do it :
$ /opt/glassfish4/glassfish/bin/asadmin stop-domain Waiting for the domain to stop . Command stop-domain executed successfully. $
At last, the process has stop according to the output of the above command execution. Don’t forget to make sure that the process is actually has stop. Just read the article where title of that article is ‘How to Check Glassfish Application Server Process in Linux using a Command in the Command Line Interface’ in this link.