Installing Terracotta as a Windows service

Installing Terracotta as a Windows service

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
  • 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 !!
  • Also make a wrapper.stop.conf file in the same folder with the following configuration:

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:

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

Working at i8c

i8c is a system integrator that strives for an informal atmosphere between its employees, who have an average age of approx 30 years old. We invest a lot of effort in the professional development of each individual, through a direct connection between the consultants and the management (no multiple layers of middle management). We are based in Kontich, near Antwerp, but our customers are mainly located in the triangle Ghent-Antwerp-Brussels and belong to the top 500 companies in Belgium (Securex, Electrabel, UCB, etc…).

Quality Assurance

i8c is committed to delivering quality services and providing customer satisfaction. That’s why we invested in the introduction of a Quality Management System, which resulted in our ISO9001:2000 certification. This guarantees that we will meet your expectations, as a reliable, efficient and mature partner for your SOA & integration projects.

i8c - ISO9001-2015