The Locator process terminates unexpectedly with exit status 1 in Gemfire 10.* versions
search cancel

The Locator process terminates unexpectedly with exit status 1 in Gemfire 10.* versions

book

Article ID: 404786

calendar_today

Updated On:

Products

VMware Tanzu Gemfire

Issue/Introduction

The Locator process terminates unexpectedly with exit status 1 in Gemfire 10.* versions

Exception in thread "main" com.vmware.gemfire.deployment.modules.internal.LauncherException: 
org.apache.geode.security.GemFireSecurityException: Instance could not be obtained. 
Expecting a org.apache.geode.security.SecurityManager class.

Environment

NA

Cause

The issue is caused by changes in classloader hierarchies and isolation mechanisms introduced in GemFire 10.x.
In GemFire 10, JAR files are deployed using a classloader isolation model. Each deployed JAR is loaded into its own isolated classloader. These classloaders do not share resources with each other or the system by default. A deployment will first attempt to load classes from its own classloader before looking elsewhere.
Classloader isolation is the default and recommended setting for all new GemFire 10 implementations. In contrast, chained classloading was the default in GemFire 9.x and is still available to support legacy applications.

Resolution

If you are using gfsh follow below steps:
 
1. Put all Custom jars in one path
2. Put Gemfire jars in another path
3. In your settings file, use below variables(below are my lab settings)
    export JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64
    export GEMFIRE_HOME=/path/to/gemfire/vmware-gemfire-10.1.3
    export GF_JAVA=$JAVA_HOME/bin/java
    export PATH=$PATH:$JAVA_HOME/bin:$GEMFIRE_HOME/bin
Please refer below documentation for more details:
https://techdocs.broadcom.com/us/en/vmware-tanzu/data-solutions/tanzu-gemfire/10-1/gf/getting_started-installation-install_standalone.html
4. unset/comment CLASSPATH incase if it is already set 
5. Pass custom jars (from step 1) into --classpath in the form of {absolute path}/* 
Note: Do not pass Gemfire jars path
6. Test the script
 
If you are using ServerLauncher follow below steps:
1. Put all Custom jars in one path
2. Put Gemfire jars in another path
3. In your settings file, use below variables(below are my lab settings)
    export JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64
    export GEMFIRE_HOME=/path/to/gemfire/vmware-gemfire-10.1.3
    export GF_JAVA=$JAVA_HOME/bin/java
    export PATH=$PATH:$JAVA_HOME/bin:$GEMFIRE_HOME/bin
Please refer below documentation for more details:
https://techdocs.broadcom.com/us/en/vmware-tanzu/data-solutions/tanzu-gemfire/10-1/gf/getting_started-installation-install_standalone.html
4. unset/comment CLASSPATH incase if it is already set 
5. Includes only the GemFire Bootstrap jar in the Java classpath.
https://techdocs.broadcom.com/us/en/vmware-tanzu/data-solutions/tanzu-gemfire/10-0/gf/configuring-running-running_the_cacheserver.html
6. Your application classes and jars can be added via the --automatic-module-classpath argument. You should not include any other jars in the Java classpath directly.
7. Test the script