Externalize Oasis Properties for Tomcat in Windows

This article outlines the steps to externalize the oasis.properties file by configuring Apache Tomcat as a Windows service. Externalizing configuration files allows for simplified updates and consistent environment setup across deployments.

If Apache Tomcat is already running as a service, skip the service installation step outlined in Section 2.1.

Prerequisites

  • Tomcat installed at: C:\ovaledge\apache-tomcat-10.1.40\

  • oasis.properties file extracted from: C:\ovaledge\apache-tomcat-10.1.40\webapps\ovaledge\WEB-INF\classes

  • Administrative access to the server.

  • Ensure Tomcat is not already running as a service before executing the installation steps.

Configuration Steps

  1. Install Tomcat as a Windows Service (if not already installed)

    • Open Command Prompt as Administrator.

    • Navigate to the following directory:

      cd C:\ovaledge\apache-tomcat-10.1.40\bin
    • Run the following command to install Tomcat as a service:

      service.bat install tomcat10

      This creates a new Windows service named tomcat10. The service can be configured to start automatically during system boot.

      Sample Reference Screenshot:

  2. Create External Properties Directory

    • Navigate to:

      C:\ovaledge
    • Create a directory named:

      extprop

      Sample Reference Screenshot:

    • Copy the oasis.properties file from the following source path: C:\ovaledge\apache-tomcat-10.1.40\webapps\ovaledge\WEB-INF\classes\

      Sample Reference Screenshot:

      To: C:\ovaledge\extprop\

      Sample Reference Screenshot:

  3. Configure Tomcat Service Parameters

    • There are two ways to configure the Java options for the Tomcat service:

      • Option 01: Use GUI (Tomcat Monitor Tool)

        • Navigate to: C:\ovaledge\apache-tomcat-10.1.40\bin

        • Double-click tomcat10w.exe.

      • Option 02: Use Command Line

        • Open Command Prompt in the bin directory.

        • Execute the following command:

          tomcat10w.exe //ES/<service_name>

  1. Add Java Options

    • In the Java tab, add the following Java options (one per line):

      -Duse.http=true
      -DOVALEDGE_SECURITY_TYPE=db
      -Dext.properties.dir=file:C:\ovaledge\extprop\
      -Dlog4j.configuration=file:C:\ovaledge\extprop\log4j.properties
      -DOVALEDGE_ENCRYPT_DECRYPT_KEY=BtXKvoinYAWUf
      --add-opens java.base/jdk.internal.loader=ALL-UNNAMED
      --add-opens jdk.zipfs/jdk.nio.zipfs=ALL-UNNAMED
      --add-opens java.base/java.net=ALL-UNNAMED
      --add-opens java.base/java.time=ALL-UNNAMED
      --add-opens java.base/java.nio=ALL-UNNAMED

  1. Configure Java Heap Memory

    • In the Java tab:

      • Set the Initial memory pool to 5120 MB.

      • Set the Maximum memory pool to 7168 MB.

      Sample Reference Screenshot:

  2. Save and Apply Settings

    • Click the OK button to save the configuration.

    • This completes the setup to externalize Oasis properties.

Validation

  • Restart the Tomcat10 service from the Windows Services Console or use the following command:

    net stop tomcat10 && net start tomcat10
  • Verify that Tomcat picks up the external oasis.properties from: C:\ovaledge\extprop\

Rollback Instructions

To revert changes:

  1. Remove the external properties parameters from tomcat10w.exe.

  2. Delete the C:\ovaledge\extprop\ directory (optional).

  3. Restore the original oasis.properties inside: C:\ovaledge\apache-tomcat-10.1.40\webapps\ovaledge\WEB-INF\classes


Copyright © 2025, OvalEdge LLC, Peachtree Corners, GA, USA.

Last updated

Was this helpful?