Running components as Windows services

Running InterChange Server components and adapters as Windows services enables the remote management, administration, and configuration of InterChange Server components using standard Microsoft Windows utilities. As Windows services, the components can also be configured to start automatically upon restart of the Windows system.

IBM provides a services setup program called CWServices that configures InterChange Server (ICS) and other ICS system components to run as Windows services. This services-setup program, cwservices.exe, resides in the following directory: ProductDir\bin

For a successful installation of InterChange Server, the Persistent Naming Server, or adapters as Windows services, follow the instructions in each of the following sections in order:

Prerequisites for running InterChange Server as a Windows service

Before you can configure InterChange Server to run as a Windows service, the system must meet the following requirements:

Uninstalling previous Windows services

If you are running InterChange Server components as Windows services that you set up in a prior versions of InterChange Server software, you must uninstall them as Windows services before proceeding. Use the CWServices setup program to uninstall the InterChange Server service. For example:

cwservice -xr -sInterchangeServerName

Installing an ICS component as a Windows service

The CWService utility installs InterChange Server system components as Windows services. CWService has the following basic syntax:

cwservice -xi -mode=modeType -tserviceType -cserviceStartupScript


Table 7. Valid ICS components for the CWService utility

ICS component Service type Service startup script Directory
InterChange Server SERVER start_server_service. bat ProductDir\bin
Adapter Adapter start_connName_service.bat (where connName is the name of the adapter) ProductDir\ connectors\connName
Persistent Naming Server NAMESERVER PersistentNameServer.bat ProductDir\bin

Note:
To view additonal command options and confirm the syntax of the cwservice command, run cwservice -x.

To use the CWService utility, run one of the cwservice commands shown in Table 10.

Table 8. Service-startup commands for ICS components

ICS component command syntax
InterChange Server cwservice -xi -mode=modeType -tSERVER -cICSserviceStartupScriptPath -sInterChangeServerName -pportnumber

Notes:

  1. To modify SERVERNAME in the start_server_service.bat file replace the %1 in the following statement with your ICS name: set SERVERNAME=%1 or replace the last line of -s to include your ICS name.

  2. The portnumber must be the same with the one set in start_server_service.bat file. The portnumber is set with the -z%ICSPORT% parameter. The default value is 55500.
Adapter cwservice -xi -mode=modeType -tCONNECTOR -cadapterServiceStartupScriptPath -sadapterName -iInterChangeServerName -tthreadModel -pportnumber

Valid values for the threadModel option are MULTI_THREADED or SINGLE_THREADED

Persistent Naming Service cwservice -xi -mode=modeType -tNAMESERVER -cNameServiceStartupScriptPath -sserviceName -pportnumber

When the CWService utility installs an ICS component as a Windows service on a server, it creates a service name of the form CWinterchange ICScomponentName.

Using service-startup scripts

During the installation (or configuration) process of ICS components, Installer (or the configuration tool) creates special startup scripts to run an ICS component as a Windows service. Many of the startup scripts that start an ICS component from a command line cannot be used to start the component as a Windows service. These service-startup scripts enable the ICS component to start up as a Windows service.

For example, the Installer customizes the start_server_service.bat file from information you provide as part of the Services screen in the installation process. Other configuration tools present a default template for generating the appropriate service startup script for the ICS component. You can accept this template or replace it with one you choose.

Checking Windows services

After installing InterChange Server Windows services, reboot your machine, then check to see if you can start the components using Windows services.

  1. Click Start > Settings > Control Panel. Double-click Administrative Tools, then double-click Services.
  2. Select the service for InterChange Server from the Service scroll box. The service name should be:

    CWinterchange ICSinstanceName

    where instanceName is the ICS instance name you specified with the -s command-line argument when you set up the service. Verify that the Status for this component is Stopped, and the Startup is Manual.

  3. Click Start.

    When the status of the Service Control message changes to Started, Windows services has successfully started InterChange Server.

  4. Confirm that you can start other ICS components by repeating steps 1 through 3 for:
  5. If you are working in a high availability environment, proceed to "Windows services and high availability"..

Troubleshooting

Event Log

If problems occur during the installation procedure or if InterChange Server or adapters fail during startup as a service, check the Windows Event Log, using the Event Viewer.

Batch files

You can troubleshoot using the service batch files, if the problem is with adapter or server configuration. However, use caution when directly modifying these files. To make sure the problem is not with a particular batch file, run the batch file from the command prompt window.

Java run time version

If you receive the error (2140), An internal windows error occurred, a Java run time current version key mismatch is a possible cause. This mismatch can occur when you install another application on the same machine as InterChange Server; the second application can change the Java run time version to something other than the one required for InterChange Server software. To ensure that you are running the correct version as your current version, reinstall the Java compiler, using the instructions on "Installing the Java compiler"..

Copyright IBM Corp. 1997, 2004