cjstopsv (stop J2EE server)
- Organization of this page
Format
cjstopsv [server-name] [-f|-fd [thread-dump-acquisition-interval thread-dump-acquisition-count]] [-wait termination-wait-time]
Function
This command stops a J2EE server. If the server name is omitted, the host name is assumed.
Arguments
- server-name
-
Specifies the name of the J2EE server that is to be stopped. When the server name is omitted, the host name is assumed.
- -f
-
Forcibly stops the J2EE server.
If Management Server starts the J2EE server as a logical server, you cannot execute the cjstopsv command from the console to stop the J2EE server forcibly. To stop such a J2EE server forcibly, you must execute the command from Management Server. For details on stopping logical servers, see the uCosminexus Application Server System Setup and Operation Guide.
- -fd
-
Specifies that failure information for the J2EE server is to be obtained and then the J2EE server is to be stopped forcibly.
- thread-dump-acquisition-interval
-
Specifies the interval (in seconds) for obtaining a thread dump, as an integer in the range 1 to 60. If this item is omitted, the default value of 3 seconds is assumed.
- thread-dump-acquisition-count
-
Specifies the number of times a thread dump is to be obtained, as an integer in the range 1 to 60. If this item is omitted, the default value of 10 times is assumed.
The failure information that is obtained is described below.
-
OS status
Output destination for Windows:
J2EE-server-work-directory\ejb\server-name\cjsysinfo.output-time.txt
Output destination for UNIX:
J2EE-server-work-directory/ejb/server-name/cjsysinfo.output-time.txt
output-time has the format yymmddHHMMSS.
For details on the output contents, see cjgetsysinfo (get OS status).
-
JavaVM thread dump
Thread dumps are obtained in accordance with the interval and count specified by thread-dump-acquisition-interval and thread-dump-acquisition-count. Depending on the status of the J2EE server process, thread dumps might not be output in accordance with the specified interval and count. For details on the output contents, see cjdumpsv (get thread dump of J2EE server).
-
Crash dump (in Windows) or core file (in UNIX) of the J2EE server
After the last thread dump acquisition request, a crash dump or the core file is output after the thread dump acquisition interval elapses.
Crash dump output destination:
Directory-specified-in-environment-variable-CJMEMDUMP_PATH#\cjmemdump.dmp
# If the environment variable CJMEMDUMP_PATH is not specified or if the specified directory does not exist, the crash dump is not output. Also, if the crash dump already exists in the specified directory, the crash dump is overwritten.
Core file output destination:
J2EE-server-work-directory/ejb/server-name/core#
#
In Linux, specify core.process-ID-of-the-J2EE-server-stopped-forcibly
- -wait termination-wait-time
-
Specifies the maximum amount of time (in seconds) to wait for termination, as an unsigned integer in the range 0 to 86400. The default value is 180 seconds.
Specify the cjstopsv termination wait time as the amount of time from when a normal termination request is input to the J2EE server until normal termination of the J2EE server is completed. When 0 is specified, there is no limit on the amount of time to wait for the J2EE server to terminate normally. In such cases, the -f and -fd options are ignored even if they are specified.
If the specified value is invalid, an error is output and the default value (180 seconds) is assumed.
If the J2EE server has not terminated normally when the specified amount of time has elapsed, the command executes processing based on the combination of other arguments, as described in the following table, and then terminates abnormally with termination code 2:
Combination of other arguments
Operation after timeout
-f and -fd are both omitted
The command outputs a message and terminates; in this case, the command does not stop the J2EE server.
-f is specified
The command outputs a message and terminates the J2EE server forcibly.
-fd is specified
The command outputs a message, obtains failure information and a thread dump, and terminates the J2EE server forcibly. cjstopsv processing does not terminate until acquisition of the failure information is completed.
User definition files
-
In Windows
-
Cosminexus-installation-directory\CC\server\usrconf\ejb\server-name\usrconf.cfg
-
Cosminexus-installation-directory\CC\server\usrconf\ejb\server-name\usrconf.properties
-
-
In UNIX
-
/opt/Cosminexus/CC/server/usrconf/ejb/server-name/usrconf.cfg
-
/opt/Cosminexus/CC/server/usrconf/ejb/server-name/usrconf.properties
-
Return values
- 0:
-
The command terminated normally.
- 1 or higher:
-
The command terminated abnormally; for details, see the following table:
Termination code
Explanation
2
This code indicates a normal termination monitoring timeout based on the -wait specification.
Other than 2
This code is output for errors related to invalid parameters or internal errors (for details, see the message that was displayed most recently).
Notes
-
If the cjstopsv command is used for stopping the J2EE server while the business method of an Enterprise Bean or the service method of servlets and JSPs is being executed, the J2EE server does not stop until the corresponding method terminates.
-
To execute the cjstopsv command in Windows, you must have administrator permission.
-
To execute the cjstopsv command in UNIX, you must have root permission (if Component Container Administrator is not set) or Component Container Administrator permission (if Component Container Administrator is set).
-
When you specify a server name in the command arguments, you must specify it immediately after the command name. You can specify the other arguments in any order as long as they are subsequent to the server name (or subsequent to the command name if the server name is omitted). However, you cannot switch the sequence of an option name and its corresponding value (for example, you cannot specify end-wait-time -wait); also, you cannot specify an option name in conjunction with a non-corresponding value (for example, you cannot specify -f thread-dump-collection-count -fd thread-dump-collection-interval).
-
When you specify a server name in the command arguments, you must specify a case-sensitive character string that matches a server name specified in a cjsetup (set up or unsetup J2EE server).
-
If you execute the cjstopsv command when applications exist, this command might not be usable to stop the J2EE server. In such cases, you specify the -f option or the -fd option, re-execute the cjstopsv command, and then stop the J2EE server forcibly.
-
If you specify the -fd option, set the CJMEMDUMP_PATH environment variable as follows:
-
Confirm that the storage disk specified in the environment variable CJMEMDUMP_PATH has adequate empty capacity. The crash dump file size becomes more than the actual memory required for the J2EE server.
-
Do not specify a directory containing multi-byte characters such as Japanese in the environment variable CJMEMDUMP_PATH. The output of crash dump may fail.
-
Specify the existing directory as the directory to output crash dump.
-
-
The cjstopsv command with the -fd option specified fails to obtain a thread dump if executed while another instance of the cjstopsv command is waiting for another server management command to end.