EJB jobs

Use the EJB (Enterprise JavaBeans) job type to schedule the running of EJB JAR files deployed on a WebSphere Application Server.

A description of the job properties and valid values are detailed in the context-sensitive help in the Dynamic Workload Console by clicking the question mark (?) icon in the top-right corner of the properties pane.
This section describes the required and optional attributes for EJB jobs. Each job definition has the following format and arguments:
Table 1. Required and optional attributes for the definition of a EJB job
Attribute Description and value Required
servername The fully qualified host name of the application server where you want to run the EJB JAR file. Required if not specified in the plug-in properties file
serverport The port number where the application server is listening. Required if not specified in the plug-in properties file
userid The user to be used for accessing the application server. Required if not specified in the plug-in properties file
password The password to be used for accessing the application server. Required if not specified in the plug-in properties file
sslclientprops The path to the ssl.client.props Secure Sockets Layer (SSL) configuration file for clients. To setup the ssl.client.props file, see the WebSphere Application Server documentation. Required if not specified in the plug-in properties file
packages The name of the environment property for specifying the list of package prefixes to use when loading in URL context factories. It is the value that will be assigned to the "java.naming.factory.url.pkgs" constant.
principal The name of the environment property for specifying the identity of the principal for authenticating the caller to the service. The format of the principal depends on the authentication scheme. If this property is unspecified, the behavior is determined by the service provider. It is the value that will be assigned to the "java.naming.security.principal" constant.
credentials The name of the environment property for specifying the credentials of the principal for authenticating the caller to the service. The value of the property depends on the authentication scheme. For example, it could be a hashed password, clear-text password, key, certificate, and so on. If this property is unspecified, the behaviour is determined by the service provider. It is the value that will be assigned to the "java.naming.security.credentials" constant.
ejbdir The fully qualified path of the directory containing the EJB JAR file. You can also specify multiple paths, separated by a semi-colon (;), for example, /opt/path1;/opt/path2.
ejbclassname Fully-qualified-class-name of the ejb home/remote interface

Home interface for Ejb 2.x

Remote Interface for Ejb 3.x

ejbname The Java Naming and Directory Interface (JNDI) name of the resource that is the mapping target of the resource reference.
method The EJB method that defines the request.
Arguments One or more parameters, and related value, that might be required by the EJB method.
For example, for a method with two integer parameters:
jsdlejb:Arguments>
            <jsdlejb:variablelistValues>
                <jsdlejb:variablelistValue key="arg1">1
                   </jsdlejb:variablelistValue>
                <jsdlejb:variablelistValue key="arg0">2
                   </jsdlejb:variablelistValue>
            </jsdlejb:variablelistValues>
        </jsdlejb:Arguments>
For a method with a string and an integer parameters:
<jsdlejb:Arguments>
           <jsdlejb:variablelistValues>
              <jsdlejb:variablelistValue key="arg0">abc
                    </jsdlejb:variablelistValue>
              <jsdlejb:variablelistValue key="arg1">123
                    </jsdlejb:variablelistValue>
           </jsdlejb:variablelistValues>
        </jsdlejb:Arguments>
The following example shows the definition of an EJB job via composer command line:

<?xml version="1.0" encoding="UTF-8"?>
<jsdl:jobDefinition xmlns:jsdl="http://www.ibm.com/xmlns/prod/scheduling/1.0/jsdl" 
 xmlns:jsdlejb="http://www.ibm.com/xmlns/prod/scheduling/1.0/jsdlejb" name="EJB">
  <jsdl:application name="ejb">
    <jsdlejb:ejb>
        <jsdlejb:ejbParameters>
                 <jsdlejb:Connection>
                       <jsdlejb:connectionInfo>
                           <jsdlejb:servername>localhost</jsdlejb:servername>
                           <jsdlejb:serverport>31117</jsdlejb:serverport>
                           <jsdlejb:userid>twsuser</jsdlejb:userid>
                           <jsdlejb:password>{aes}gyyybxOhHnbe0yMrR5gWvT/xxxnSP593xwgCxWsOq0I=
                                  </jsdlejb:password>
                           <jsdlejb:sslclientprops>{sslclientprops}</jsdlejb:sslclientprops>
                           <jsdlejb:packages>{packages}</jsdlejb:packages>
              	      <jsdlejb:principal>{principal}</jsdlejb:principal>
				<jsdlejb:credentials>{credentials}</jsdlejb:credentials>
                       </jsdlejb:connectionInfo>
                 </jsdlejb:Connection>
                 <jsdlejb:Action>
                       <jsdlejb:ResourceProperties>                   
                           <jsdlejb:ejbdir>D:\test\</jsdlejb:ejbdir>
                           <jsdlejb:ejbclassname>aaaaa.bbbbbbbbb</jsdlejb:ejbclassname
                           <jsdlejb:ejbname>ejb/aaaaa/bbbbbbbbb</jsdlejb:ejbname>
                           <jsdlejb:method>method_1</jsdlejb:method>
                       </jsdlejb:ResourceProperties>
                       <jsdlejb:Arguments>
                          <jsdlejb:variablelistValues>
                              <jsdlejb:variablelistValue key="arg1">1</jsdlejb:variablelistValue>
                              <jsdlejb:variablelistValue key="arg0">2</jsdlejb:variablelistValue>
                          </jsdlejb:variablelistValues>
                      </jsdlejb:Arguments>
                  </jsdlejb:Action>
        </jsdlejb:ejbParameters>
    </jsdlejb:ejb>
  </jsdl:application>
</jsdl:jobDefinition>

Scheduling a job in HCL Workload Automation

You schedule EJB jobs by defining them in job streams. Add the job to a job stream with all the necessary scheduling arguments and submit it.

You can submit jobs by using the Dynamic Workload Console, Application Lab or the conman command line.

Stopping and restarting a job

Stopping and restarting an EJB job are not supported.

EJBJobExecutor.properties file

The properties file is automatically generated either when you run a "Test Connection" from the Dynamic Workload Console in the job definition panels, or when you submit the job to run the first time. Once the file has been created, you can customize it. This is especially useful when you need to schedule several jobs of the same type. You can specify the values in the properties file and avoid having to provide information such as credentials and other information, for each job. You can override the values in the properties files by defining different values at job definition time.

The properties file, named EJBJobExecutor.properties, is located in the following path:
On Windows operating systems
TWS_INST_DIR\TWS\JavaExt\cfg
On UNIX operating systems
TWA_DATA_DIR/TWS/JavaExt/cfg
The file contains the Primary and Secondary nodes properties:
#EJB properties
servername=
serverport=
userid=
password=
packages=
principal=
credentials=
sslclientprops=
where sslclientprops is the path to the ssl.client.props Secure Sockets Layer (SSL) configuration file for clients. To setup the ssl.client.props file, see the WebSphere Application Server documentation.

Job properties

While the job is running, you can track the status of the job and analyze the properties of the job. In particular, in the Extra Information section, if the job contains variables, you can verify the value passed to the variable from the remote system. Some job streams use the variable passing feature, for example, the value of a variable specified in job 1, contained in job stream A, is required by job 2 in order to run in the same job stream.

For information about how to display the job properties from the various supported interfaces, see Analyzing the job log. For example, from the conman command line, you can see the job properties by running:
conman sj <job_name>;props
+ where <job_name> is the EJB job name.

The properties are listed in the Extra Information section of the output command.

For information about passing job properties, see Passing job properties from one job to another in the same job stream instance.

Job log content

You can see the job log content by running conman sj <job_name>;stdlist, where <job_name> is the EJB job name.

See also

From the Dynamic Workload Console you can perform the same task as described in

Creating job definitions.

For more information about how to create and edit scheduling objects, see

Designing your Workload.