Java

Java Management Extensions (JMX) is a technology that provides tools to handle and monitor applications, devices, and networks. The AE provides a JMX agent that you can use to integrate Java applications into your enterprise-wide processes. SAP Java Jobs allow you to handle jobs in the SAP Java Scheduler. To be able to work with them, the Java job definition must be deployed in the Java Scheduler. This deployment makes it visible for the SAP Agent.

This page includes the following:

EE/JMX Agent for SAP NetWeaver

Connections are established through an MBean Server and several functions provide access to these MBeans.

JMX in SAP NetWeaver

A standard package of SAP NetWeaver contains more than 1600 MBeans that you can handle directly through your AE system. You establish a connection through the JMX agent that allows you to use MBeans in SAP NetWeaver. Java itself does not require any predefined proprietary jobs. You do not require any scheduling system within Java because the AE system takes over this role. Due to this standard, you can also the AE on Java sources of other vendors. For information about all application servers that are supported, see Compatibility Information

Monitoring the Java EE Engine

You can query the status of the Java EE Engine by using a JMX job. You can access all functions that are provided through MBeans. Excepted are JMX operations or attributes that use SAP-specific classes (com.sapmarkets.bam.application.User), or complex data structures such as lists, maps, or arrays.

The Forms view on the Process page of JMX jobs provides a graphical interface in which all functions are available. For details, see Forms View on the Process Page

The AE MBean Browser in a JXM job is limited to 300 MBeans. A search filter allows you to search for particular MBeans.

Example

You want to find out how many unsuccessful login attempts were made to your system. For this purpose, filter for *Security/Aggregated Data/UnsuccessfulLogonAttemptsCount* in the MBean Browser and have the result displayed as an MBean. In this MBean, you can select one of the attributes Value, MaxValue, or MinValue. Doing so allows you to schedule a job that queries the number of error messages periodically.

AE Script Elements

Numerous AE scripting elements are available that you can use to register, list, and remove MBeans. MBean functions can be called, and attributes and information can be read and set.

See JCL for JMX

Executing Jobs in Java Stack (JXBP)

You can use your AE system to start Java jobs through parameters. You can cancel jobs, include the logs in the job reports, or can monitor jobs through filters by using the Remote Task Manager (See Defining Remote Task Manager Objects). You must deploy the Java job definition in the Java Scheduler so that it becomes visible for the SAP Agent. Only then, you can use a Job object to generate an instance from an existing job definition.

Create an SAP Java Job object and select an SAP Agent plus a Login object. In the Job Settings section, you determine how to handle the child jobs as well as the job logs created in SAP.

The Job log section includes the following options:

  • Delete after x days

    Deletes the job log from the Java Scheduler after x days

  • Do not delete

    Does not remove the job log from the Java Scheduler

  • Use default settings

    The period after which the job log is deleted from the Java Scheduler depends on the settings you made in the job definition.

Notes:

  • An SAP Job object always belongs to exactly one SAP Java job definition.
  • The job log is always deleted together with the job instance.

Reports for Java Statistics

A processed SAP Job object can also contain a report (SJJI) which includes information about the Java job. Activate the extra reporting option on the SAP page of the Job definition. See Job Reports

Configuring the Connection

To create the external scheduler in SAP

  1. Log on to the SAP NetWeaver Administrator through its web interface
  2. Select the Job tab
  3. Click the link Java Scheduler -> External Scheduler
  4. Add a new entry in the list of registered external Java Schedulers
  5. Complete the fields. Specify the Automation Engine in the name and the description
  6. Click Add

To create a Connection object in the AE:

  1. Log on to system client 0000
  2. Create a new Connection (CONN) for SAP
  3. In the Connection section of this object, select the connection type Internet
  4. In the Connection Parameter section, specify the connection data for the SAP Java Scheduler, and the user that you have used to define the Automation Engine as the external Scheduler
  5. Save and close the Connection object

To configure the SAP Agent in the AE:

  1. Open your SAP Agent object and click the Agent page
  2. In the SAP Connections section, select the Connection object in the Java Scheduler field
  3. Click Save and close the Agent object
  4. Restart the SAP Agent if it is currently running

Special Cases

  • In an environment with multiple nodes, the Java Scheduler jobs are processed on the node on which the Scheduler Service is active. If you deactivate this node, or if it fails, job processing continues on a different node.

  • If the agent loses its connection to the Java Scheduler while it is executing a job, it tries periodically to re-establish the connection. The job remains active in the AE system and obtains the status Waiting for remote system.

  • If the attempt to call the Java Scheduler results in an error, the job aborts and there is no report about the Java job statistics. The error is logged in the agent log of the Job object, and the log file of the SAP Agent. The job aborts with return code 403.

  • You cannot restart a job. The complete job always starts in the Java Scheduler because there is no AE JCL.

Return Codes

The following list shows the job return codes that reflect the corresponding SAP states

  • 0
    SAP status: COMPLETED. HOLD, RUNNING, SCHEDULED, STARTING, or UNKNOWN

  • 501
    SAP status: ERROR

  • 502
    SAP status: CANCELED

See also: