Since the release of webMethods 9.0, Software AG uses TerraCotta as distributed cache for their cluster solution on Integration Server. The software can be easily installed using the SoftwareAG installer, but has a big drawback on Microsoft Windows systems: there is no procedure to install Terracotta as a Windows Service. Therefore, the server needs to be started on command line with all its consequences.Fortunately, there are several solutions available:

Tanuki java wrapper

Can be configured to work with Terracotta, but the community edition only supports 32-bit JVM. Due to its memory limitation, this is not a very good solution. You can find the software at case you want to buy the software for 64-bit support, configuration can be done as follows:

  • Download the wrapper and unzip in folder D:SoftwareAGTerracottawrapper 
  • Make a wrapper file TerraCotta.conf with the following configuration and place it under D:SoftwareAGTerracotta. Suppose the Terracotta config file tc-config.xml can be found under D:SoftwareAGTerracottabin
# for logging
# Method 1 main class
# classpath
# Java Additional Parameters
# Initial Java Heap Size (in MB) Maximum Java Heap Size (in MB)
# Application parameters. This is where you specify TC server main class
# Format of output for the log file.  (See docs for formats)
# Log Level for log file output.  (See docs for log levels)
# On exit behaviour
  • You can install the service by running the following command: sc create Terracotta binPath= D:SoftwareAGTerracottawrapperwrapper.exe -s D:SoftwareAGTerracottaTerraCotta.conf start= auto

Yet Another Java Service Wrapper (YAJSW)

YAJSW is a pure java implementation of the Tanuki Java Wrapper. Its big advantage is that it’s free and supports both 32 and 64-bit JDK 5, 6 and 7. You can find the software at

Configuration can be done as follows:

  • Download and unzip the wrapper under D:SoftwareAGTerracottawrapper 
  • Make a wrapper.conf file with the following configuration and place it under D:SoftwareAGTerracottawrapper. Important to mention is to use / instead of !!
wrapper.stop.conf = D:/SoftwareAG/Terracotta/wrapper/wrapper.stop.conf D:/SoftwareAG/Terracotta/wrapper/wrapper.jar =
wrapper.console.title = TerraCotta = TerraCotta
wrapper.ntservice.displayname = TerraCotta
wrapper.ntservice.description = TerraCotta -f D:/SoftwareAG/Terracotta/bin/tc-config.xml
  • Also make a wrapper.stop.conf file in the same folder with the following configuration:
wrapper.stopper = true D:/SoftwareAG/Terracotta/wrapper/wrapper.jar =

You can test the configuration by running D:SoftwareAGTerracottawrapperbatrunConsole.bat

In that case the wrapper will load the configuration file and start the process. This can be used to debug the wrapper configuration file. Afterwards the service can be installed using the D:SoftwareAGTerracottawrapperbatinstallService.bat command.

For both wrappers you can define the wrapper on exit behavior. By setting wrapper.on_exit.0=SHUTDOWN the wrapper will do nothing when it gets a normal return code 0 from terracotta. For all other return codes the wrapper will automatically restart the terracotta service. We do this by setting wrapper.on_exit.default=RESTART.

We need this option in an active-mirror terracotta setup. If we shut down the passive node and restart it, we will get the following error in the terracotta server log:

********************************** ERROR ***********************************
* This server is running with persistence turned on and was stopped in
* PASSIVE-STANDBY state. Only the ACTIVE-COORDINATOR server is allowed  to
* be restarted without cleaning up the data directory with persistence
* turned on.
* Please clean up the data directory and make sure that the
* ACTIVE-COORDINATOR is up and running before starting this server. It is
* important that the ACTIVE-COORDINATOR is up and running before starting
* this server else you might end up losing data
[WrapperStartStopAppMain] ERROR tc.operator.event – NODE : Server2  Subsystem: CLUSTER_TOPOLOGY Message: Started with dirty database. Exiting!! Restart enabled
[WrapperStartStopAppMain] ERROR com.terracottatech.dso – Marking the object db as dirty …
[WrapperStartStopAppMain] ERROR com.terracottatech.console – This standby Terracotta server instance had to restart to automatically wipe its database and rejoin the cluster.

Terracotta will stop with a return code different than 0. By using the on exit options, the wrapper automatically restarts the service.