How to Check Glassfish Application Server Process in Linux using a Command in the Command Line Interface

Posted on


This article is showing how to check the process of the Glassfish Application Server in a Linux-based operating system. As it shows in the title of this article, the focus is to check whether the Glassfish Application Server is running or not. There are several steps or several commands for checking if the process associated with Glassfish Application Server is currently running or not.


Checking the Glassfish Application Server running process

The following is the steps for checking the process of the Glassfish Application Server to check the status of it :

1. Since it is in the for of a command execution in the command line, access or run the command line interface first.

2. After running or executing the command line interface, execute the following command :

netstat -tulpn | grep port_number

The above command pattern is suitable for checking the Glassfish Application Server using the utilized port. Normally, Glassfish Application Server will use a default port of ‘8080’. That port will listen for incoming request to access the service provided by Glassfish Application Server. In this context, the assumption will be the Glassfish Application Server for using the default port of ‘8080’. So, using the above command pattern, just check whether the port is available to listen the incoming request to ask for Glassfish Application Server’s service. The following is the command execution :

root@hostname ~# netstat -tulpn | grep 8080
tcp6       0      0 :::8080                 :::*                    LISTEN      19265/java          
root@hostname ~#

3. The next step is to proceed on checking the process. In the previous step, there is an information about the running process of the Glassfish Application Server. The information is about the process ID of the running process. The process ID is ‘19265’. The following is the command pattern to check the running process with a specific process ID :

ps aux | grep process_ID

The execution of the command using the pattern above exist as follows :

root@hostname ~# ps -aux | grep 19265
glassfi+ 19265  0.8  2.1 6260036 352220 pts/35 Sl   16:00   0:18 /usr/lib/jvm/java-8-openjdk-amd64/bin/java -cp /opt/glassfish4/glassfish/modules/glassfish.jar -XX:+UnlockDiagnosticVMOptions -XX:NewRatio=2 -XX:MaxPermSize=192m -Xmx512m -client -javaagent:/opt/glassfish4/glassfish/lib/monitor/flashlight-agent.jar -Dfelix.fileinstall.dir=/opt/glassfish4/glassfish/modules/autostart/,org.apache.felix.gogo.runtime,,org.apache.felix.gogo.command,,org.apache.felix.fileinstall -Dcom.sun.aas.installRoot=/opt/glassfish4/glassfish -Dfelix.fileinstall.poll=5000 -Djava.endorsed.dirs=/opt/glassfish4/glassfish/modules/endorsed:/opt/glassfish4/glassfish/lib/endorsed -Dfelix.fileinstall.bundles.startTransient=true -Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory -Dfelix.fileinstall.log.level=2 -Dfelix.fileinstall.disableConfigSave=false -Dcom.sun.aas.instanceRoot=/opt/glassfish4/glassfish/domains/domain1 -Dgosh.args=--nointeractive -DANTLR_USE_DIRECT_CLASS_LOADING=true -Djava.awt.headless=true -Djava.ext.dirs=/usr/lib/jvm/java-8-openjdk-amd64/lib/ext:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext:/opt/glassfish4/glassfish/domains/domain1/lib/ext -Djdbc.drivers=org.apache.derby.jdbc.ClientDriver -Djava.library.path=/opt/glassfish4/glassfish/lib:/usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib com.sun.enterprise.glassfish.bootstrap.ASMain -upgrade false -domaindir /opt/glassfish4/glassfish/domains/domain1 -read-stdin true -asadmin-args --host,,,localhost,,,--port,,,4848,,,--secure=false,,,--terse=false,,,--echo=false,,,--interactive=true,,,start-domain,,,--verbose=false,,,--watchdog=false,,,--debug=false,,,--domaindir,,,/opt/glassfish4/glassfish/domains,,,domain1 -domainname domain1 -instancename server -type DAS -verbose false -asadmin-classpath /opt/glassfish4/glassfish/lib/client/appserver-cli.jar -debug false -asadmin-classname com.sun.enterprise.admin.cli.AdminMain
root     24022  0.0  0.0  23960   992 pts/37   S+   16:34   0:00 grep 19265
root@hostname ~#

As it shows in the above output command, the process ID belong to the Glassfish Application Server. It is a running process of Glassfish Application Server where it will listen for incoming requests in port 8080.

Leave a Reply