This topic provides a procedure and an example for deploying VMware Tanzu GemFire configuration files in JAR files.

Procedure

  1. Jar the files.
  2. Set the Tanzu GemFire system properties to point to the files as they reside in the jar file.
  3. Include the JAR file in your class path.
  4. Verify the JAR file copies are the only ones visible to the application at runtime. Tanzu GemFire searches the class path after searching other locations, so the files cannot be available in the other search areas.
  5. Start your application. The configuration file is loaded from the JAR file.

Example of Deploying a Configuration JAR

The following example deploys the cache configuration file, myCache.xml, in my.jar. The following displays the contents of my.jar:

% jar -tf my.jar 
META-INF 
META-INF/MANIFEST.MF 
myConfig/ 
myConfig/myCache.xml

In this example, you would perform the following steps to deploy the configuration JAR file:

  1. Set the system property gemfire.cache-xml-file to myConfig/myCache.xml.
  2. Set your class path to include my.jar.
  3. Verify there is no file already in the filesystem named ./myConfig/myCache.xml, so Tanzu GemFire will be forced to search the JAR file to find it.

When you start your application, the configuration file is loaded from the JAR file.

check-circle-line exclamation-circle-line close-line
Scroll to top icon