Hitachi

uCosminexus Application Server Command Reference Guide


cjexecjob (Execute batch application)

Organization of this page

Format

When not using the scheduling functionality is not used
cjexecjob server-name [[Java-option]...]
          Java-application-class-name
          [[argument-passed-to-the-main-method]...]
When using the scheduling functionality
cjexecjob [schedule-group-name] [-jobID job-ID]
          [[Java-option]...]
          Java-application-class-name
          [[argument-passed-to-the-main-method]...]

Function

When not using the scheduling functionality, this command executes batch applications in the batch server with the specified server name.

When using the scheduling functionality, this command executes batch applications in the batch servers that are distributed by CTM. Note that if no batch server exists on which you can execute jobs, the batch applications will be kept waiting in the schedule queue.

The size of each of Java-option and the following arguments is less than 1,024 bytes.

A message is output when you run the cjexecjob command, and when you terminate the cjexecjob command. You can control the message output by the cjexecjob command using the batch.log.stdout.enabled key of usrconf.cfg (option definition file for batch applications).

The options of the cjexecjob command are specified in usrconf.cfg (option definition file for batch applications). The system properties are specified in usrconf.properties (user property file for batch applications). The directories in which usrconf.cfg (option definition file for batch applications) and usrconf.properties (user property file for batch applications) are saved will be searched in the following order:

  1. Directory specified in the environment variable (CJBATCHUSRCONFDIR)#

  2. Directory in which the cjexecjob command is executed

# In the environment variable (CJBATCHUSRCONFDIR), you specify the directory as the absolute path.

If you specify more than one system properties for the same key, the system property specified last is given priority.

When the system properties of the same key are specified in different ways, the priority order is as follows:

  1. Arguments of the cjexecjob command

  2. usrconf.properties (user property file for batch applications)

  3. usrconf.cfg (option definition file for batch applications)

  4. usrconf.properties (user property file for batch servers)

  5. usrconf.cfg (option definition file for batch servers)

Arguments

server-name

Specifies the name of the batch server on which batch application is running.

schedule-group-name

Specifies the group name of the batch server to be assigned when the CTM schedules the execution of batch application.

You can also specify the schedule group name using usrconf.cfg (option definition file for batch applications). The following is the priority order for specifying schedule group names:

  • Arguments of the cjexecjob command

  • usrconf.cfg (option definition file for batch applications)

Note that you can omit schedule group names. JOBGROUP is the default value when you omit the specification of the schedule group names.

-jobID job-ID

Specifies the job ID of the batch applications to be executed using 1 to 32 unique alphanumeric characters.

If -jobID job-ID is omitted, the job ID is automatically generated. For automatic generation of job IDs, see 4. Scheduling of Batch Applications in the uCosminexus Application Server Expansion Guide.

In UNIX, if you start a batch application by omitting the specification of a job-ID, you must stop the application by specifying the job ID enclosed in double quotation marks ("") as follows:

-jobID "job-ID"

Java-option

Specifies the startup options of JavaVM.

You can specify the following options:

  • -cp

  • -classpath

  • -Dname=value

Java-application-class-name

Specifies class names of the Java applications including package name.

argument-passed-to-the-main-method

Specifies arguments passed to the main method of Java applications.

If you omit the specification of schedule-group-name when using the Scheduling functionality, always specify either of the following arguments:

  • Job-ID

  • Java-option

The specification examples are as follows:

(Incorrect example)
cjexecjob com.hitachi.mypackage.MyBatchApp argA argB
 
(Correct example)
cjexecjob -jobID JOBID com.hitachi.mypackage.MyBatchApp argA argB
cjexecjob -D<name>=<value> com.hitachi.mypackage.MyBatchApp argA argB

Input examples

When the scheduling functionality is not used
cjexecjob MyBatchServer com.hitachi.mypackage.MyBatchApp
When using the scheduling functionality
cjexecjob JOBGROUP com.hitachi.mypackage.MyBatchApp

Return values

value-returned-from-the-public-static-int-main(String[])-method:

This value is returned when the public static int main(String[]) method is used.

value-specified-in-the-arguments-of-System.exit()-Runtime.halt()-Runtime.exit():

This value is returned when the System.exit(), Runtime.halt(), or Runtime.exit() are used.

0:

The command terminated normally using the public static void main(String[]) method.

1:

An attempt to execute the batch application has failed.

Additionally, the batch application is terminated forcibly.

Notes