Skip to main content

Using the SAP Java Connector

This chapter describes how to add the required components to your production so that it can send requests to SAP.

Basics

Add the following business hosts to your production.

Settings for EnsLib.JavaGateway.Service

Configure the settings for EnsLib.JavaGateway.Service so that it can find the Java Gateway. These settings are:

ExternalServerName

The value of this setting should be an external language server name as described in Managing External Server Connections. This setting supersedes the settings in Server and Port and the associated gateway configuration settings such as ClassPath, the heartbeat settings, the UsePassphrase setting, and the JVM setting. Note it is now not possible to start a gateway that uses a passphrase without using an external language server name.

Address

IP address or name of the machine where the JVM to be used by the Java Gateway Server is located.

Port

Port number to which the Java Gateway connects. The default is 55555.

HeartbeatInterval

Number of seconds between each communication with the Java Gateway to check whether it is active. When enabled, the minimum value is 5 seconds and the maximum value is 3600 seconds (1 hour). The default is 10 seconds. A value of 0 disables this feature.

HeartbeatFailureTimeout

Number of seconds without responding to the heartbeat, to consider that the Java Gateway is in failure state. If this value is smaller than the HeartbeatInterval property, the gateway is in failure state every time the Java Gateway communication check fails. The maximum value is 86400 seconds (1 day). The default is 30 seconds.

HeartbeatFailureAction

Action to take if the Java Gateway goes into a failure state. Setting it to Restart (default) causes the Java Gateway to restart. Setting it to Alert generates an alert entry in the Event Log. This is independent of the Alert on Error setting.

HeartbeatFailureRetry

Time to wait before retrying the HeartbeatFailureAction if the Java Gateway server goes into failure state, and stays in failure state. The default is 300 seconds (5 minutes). A value of 0 disables this feature, meaning that once there is a failure that cannot be immediately recovered, there are no attempts at automatic recovery.

JavaHome

Location of the JVM (This is the value that you would use for JAVA_HOME environment variable). It is used to find the target JVM and assemble the command to start the Gateway.

If there is a default JVM on the machine that is usable without the need to specify its location, you can leave this setting blank.

ClassPath

Class path containing the files to be passed as an argument when starting the JVM. You must include any jar file that define classes you are importing via the Java Gateway. There is no need to include InterSystems' .jar files used by the Java Gateway. If you are specifying file paths containing spaces or multiple files, you should quote the classpath and supply the appropriate separators for your platform.

The following is an example semicolon-separated list of file paths for a Microsoft Windows platform:

C:\Library\mygateway.jar;"C:\Jar files\utilities.jar"

Note that additional paths for the classpath can be specified in business operations derived from EnsLib.JavaGateway.AbstractOperationOpens in a new tab. See the property AdditionalPaths in that class.

JVMArgs

Optional arguments to be passed to the Java Virtual Machine (JVM) to include when assembling the command to start the Java Gateway. For example, you can specify system properties: Dsystemvar=value or set the maximum heap size: Xmx256m and so on, as needed.

JDKVersion

Version of JDK used to select the intended version of the InterSystems .jar files. It is used to assemble the command to start the Java Gateway. For example: Java 1.7

Logfile

Fully qualified name of a file to log all communication between the InterSystems IRIS server and the Java Gateway. Usually this setting should be left blank, except when troubleshooting. These messages include acknowledgment of opening and closing connections to the server, as well as any difficulties encountered in mapping Java classes to InterSystems IRIS proxy classes.

JavaDebug

Allow a Java debugger (such as Eclipse or JSwat) to attach. If True, enables Java debugging. The default is False.

JavaDebugPort

Specify the port on which to listen. The default is 8000.

JavaDebugSuspend

If Yes, suspend the JVM on start to wait for the debugger to attach. The default is No.

Settings for EnsLib.SAP.Operation

EnsLib.SAP.OperationOpens in a new tab sends requests to SAP JCo, via the Java Gateway. For this business host, specify the following settings:

SAPClient

SAP Client e.g 000.

SAPCredentials

This is the name of the set of production credentials to use when accessing the SAP server.

SAPLanguage

SAPHost

Host name or IP address of the SAP server.

SAPSystemNumber

SAP SystemNumber e.g 00.

SAPTransactionAutoCommit

Specifies whether to execute the BAPI "BAPI_TRANSACTION_COMMIT" after a successful BAPI/RFC-call.

SAPResponseHandler

Configuration item in this production that should receive the SAP response.

JavaGatewayConfigItemName

Name of the (required) configuration item that hosts the Java Gateway.

For settings not listed in this book, see “Settings in All Productions” in Managing Productions.

FeedbackOpens in a new tab