Administering the RPC Server for Java with Local Scripts

The EntireX RPC Server for Java allows standard RPC clients to communicate with servers written in Java. It works together with the Java Wrapper and calls Java server interface objects.

This document describes how to administer the RPC Server for Java with local scripts as in earlier versions of EntireX. It covers the following topics:

See also Administering the RPC Server for Java with the Command Central GUI | Command Line.


Customizing the RPC Server

The following elements are used for setting up the RPC Server for Java:

Start Script

The start script for the RPC Server for Java is called jrpcserver.bsh (UNIX) or jrpcserver.bat (Windows) and is provided in the bin folder of the installation directory. You may customize this file.

You can set the environment variable JAVA_HOME for the location of the Java interpreter. Set the classpath to entirex.jar and the path to the Java server interface objects.

The script files that start the RPC Server for Java allow you to pass properties as command-line options as described in the table below. Alternatively, you can use system properties or a property file. The command-line option has the highest priority; the system property has second priority, and the entries of a property file have third priority.

Example:

java -Dentirex.server.properties=rpcserver.properties –Dentirex.license.location=<license.xml with path> -classpath <entirex.jar with path>:<path to your server
interface objects> com.softwareag.entirex.aci.RPCServer

Properties File

The default name of the properties file is entirex.server.properties. The file is searched for in the directory of the Start Script. It can be changed by assigning an arbitrary file name with a path to a property with the name entirex.server.properties.

A sample properties file is contained in subfolder config of the installation folder.

Configuring the RPC Server

Property Name Command-line Option Explanation
entirex.rpcserver.packagename.library_name  

The RPC Server for Java can handle server programs with package names if the package name of each IDL library (see library-definition) is configured in the properties of the server. For each library the property entirex.rpcserver.packagename.library_name has the value of the package.

Example for the library Example (as in example.idl):

entirex.rpcserver.packagename.example=my.package

The library name must be lowercase. A package name can be specified when the server is generated. See Preferences and Properties under Using the Java Wrapper.

Default: localhost.

entirex.server.brokerid -broker Broker ID.
entirex.server.codepage -codepage

The encoding configured for the Java virtual machine (JVM) is used to convert the Unicode (UTF-16) representation within Java to the encoding sent to or received from the broker by default. This encoding is also transferred as the codepage to the broker to tell the broker the encoding of the data. Changing the default encoding of the JVM has the side effect that the encoding for terminal and file IO is affected too. This may be undesired.

With the codepage parameter you can override the encoding without the need to change the default encoding of the JVM. The codepage must be supported by your JVM. For a list of valid encodings, see Supported Encodings in your Java documentation.

Note:
See your JVM documentation for how to change the default encoding of the JVM. On some JVM implementations, it can be changed with the file.encoding property. On some UNIX implementations, it can be changed with the LANG environment variable.

Enable character conversion in the broker by setting the service-specific attribute CONVERSION to "SAGTRPC". See also Configuring ICU Conversion under z/OS | UNIX | Windows | BS2000 | z/VSE. More information can be found under Internationalization with EntireX.

entirex.server.compresslevel -compresslevel
Permitted values (you can enter the text or the numeric value):
BEST_COMPRESSION 9
BEST_SPEED 1
DEFAULT_COMPRESSION -1, mapped to 6
DEFLATED 8
NO_COMPRESSION 0
N 0
Y 8
Default: 0 (no compression).
entirex.server.customclass -customclass This class is used for custom initialization and shutdown of the server. In addition, this class allows handling when closing a conversation and handling the termination of a worker thread. See ServerImplementation for more information.
entirex.server.fixedservers no
NO The number of worker threads balances between what is specified in entirex.server.minservers and what is specified in entirex.server.maxservers. This is done by a so-called attach thread. At startup, the number of worker threads is the number specified in entirex.server.minservers. A new worker thread starts if the broker has more requests than there are worker threads waiting. If more than the number specified in entirex.server.minservers are waiting for requests, a worker thread stops if its receive call times out. The timeout period is configured with entirex.server.waitserver. See worker model DYNAMIC.
YES The number of worker threads specified in entirex.server.minservers is started and the server can process this number of parallel requests. See worker model FIXED.
  -help Display usage of the command-line parameters.
entirex.server.logfile -logfile Path and name of the trace output file. Environment variables in the name are resolved only if used as command-line option.
entirex.server.maxservers   Maximum number of worker threads. Default: 32.
entirex.server.minservers   Minimum number of server threads. Default: 1.
entirex.server.name   The name of the server.
entirex.server.password -password The password for secured access to the broker. The password is encrypted and written to the property entirex.server.password.e.
To change the password, set the new password in the properties file.
To disable password encryption, set entirex.server.passwordencrypt=no.
Default: yes.
entirex.server.properties -propertyfile The name of the property file. Default: entirex.server.properties.
entirex.server.restartcycles -restartcycles Number of restart attempts if the Broker is not available. This can be used to keep the RPC Server for Java running while the Broker is down for a short time. Default: 15.
entirex.server.security -security Values: no|yes|auto|name of BrokerSecurity object.

Default: no.

entirex.server.serveraddress -server Server address. Default: RPC/SRV1/CALLNAT.
entirex.server.serverlog -serverlog Name of the file where start and stop of worker threads is logged. Used by the Windows RPC Service.
entirex.server.userid -user The user ID for access to the broker.

Default: JavaServer.

entirex.server.waitattach   Wait timeout for the attach server thread. Default: 600S.
entirex.server.waitserver   Wait timeout for the worker threads. Default: 300S.
entirex.timeout   TCP/IP transport timeout. See Setting the Transport Timeout under Writing Advanced Applications - EntireX Java ACI.

Default: 20

entirex.trace -trace Trace level: 0|1|2|3. Default: 0.

Using SSL/TLS with the RPC Server

RPC servers can use Secure Sockets Layer/Transport Layer Security (SSL/TLS) as the transport medium. The term "SSL" in this section refers to both SSL and TLS. RPC-based servers are always SSL clients. The SSL server can be either the EntireX Broker or Broker SSL Agent. For an introduction see SSL/TLS and Certificates with EntireX in the Platform-independent Administration documentation.

Start of instruction setTo use SSL

  1. To operate with SSL, certificates need to be provided and maintained. Depending on the platform, Software AG provides default certificates, but we strongly recommend that you create your own. See SSL/TLS Sample Certificates Delivered with EntireX in the EntireX Security documentation.

  2. Set up the RPC Server for Java for an SSL connection.

    Use the URL-style Broker ID with protocol ssl:// for the Broker ID. If no port number is specified, port 1958 is used as default. Example:

    ssl://localhost:22101?trust_store=C:\SoftwareAG\EntireX\etc\ExxCACert.jks&verify_server=no

    If the SSL client checks the validity of the SSL server only, this is known as one-way SSL. The mandatory trust_store parameter specifies the file name of a keystore that must contain the list of trusted certificate authorities for the certificate of the SSL server. By default a check is made that the certificate of the SSL server is issued for the hostname specified in the Broker ID. The common name of the subject entry in the server's certificate is checked against the hostname. If they do not match, the connection will be refused. You can disable this check with SSL parameter verify_server=no.

    If the SSL server additionally checks the identity of the SSL client, this is known as two-way SSL. In this case the SSL server requests a client certificate (the parameter verify_client=yes is defined in the configuration of the SSL server). Two additional SSL parameters must be specified on the SSL client side: key_store and key_passwd. This keystore must contain the private key of the SSL client. The password that protects the private key is specified with key_passwd.

    The ampersand (&) character cannot appear in the password.

    SSL parameters are separated by ampersand (&). See also SSL/TLS Parameters for SSL Clients.

  3. Make sure the SSL server to which the RPC Server for Java connects is prepared for SSL connections as well. The SSL server can be EntireX Broker or Broker SSL Agent. See:

Starting the RPC Server

Start of instruction setTo start the RPC Server for Java

  • Use the Start Script.

    Or:
    At the command prompt, enter:

    java com.softwareag.entirex.aci.RPCServer

You can pass command-line options and customize your environment as described under Start Script.

Stopping the RPC Server

Start of instruction setTo stop the RPC Server for Java

Pinging the RPC Server

Start of instruction setTo ping the RPC Server for Java

  • Enter the following command:

    java -classpath "$EXXDIR/classes/entirex.jar" com.softwareag.entirex.rpcping.RPCServerPing -p <admin_port>
    where admin_port is the number of the administration port.

    The ping command returns "0" if the server is reachable, and "1" if the server cannot be accessed.

    Note:
    This command is particularly useful in a high availability cluster context. See Setting up your Environment for High Availability with Container Orchestration in the High Availability documentation.

Running an EntireX RPC Server as a Windows Service

For general information see Running an EntireX RPC Server as a Windows Service.

Start of instruction setTo run the RPC Server for Java as a Windows Service

  1. Customize the Start Script according to your system installation.

    Note:
    The script file must pass external parameters to the RPC server and use the reduced signalling of the JVM (option -Xrs):

    java -Xrs com.softwareag.entirex.aci.RPCServer %*

    If -Xrs is not used, the JVM stops and an entry 10164002 is written to the event log when the user logs off from Windows.

    See also Starting the RPC Server.

  2. Test your RPC server to see whether it will start if you run your script file.

  3. Use the EntireX RPC Service Tool and install the RPCService with some meaningful extension, for example MyServer. If your Start Script is jrpcserver.bat, the command will be

    RPCService -install -ext MyServer -script install_path\EntireX\bin\jrpcserver.bat

    The log file will be called RPCservice_MyServer.log.

  4. In Windows Services menu (Control Panel > Administrative Tools > Services) select the service: Software AG EntireX RPC Service [MyServer] and change the property Startup Type from "Manual" to "Automatic".

Application Identification

The application identification is sent from the RPC server to the Broker. It is visible with Broker Command and Info Services.

The identification consists of four parts: name, node, type, and version. These four parts are sent with each Broker call and are visible in the trace information.

For the RPC Server for Java these values are:

Identification Part Value
Application name ANAME=RPC Server for Java
Node name ANODE=host_name
Application type ATYPE=Java
Version AVERS=10.5.0.0