Gemfire - Cannot start locator

770 views Asked by At

I am trying to start up a locator using gfsh and I keep getting that a main class cannot be found.

I am running this: gfsh start locator --name=locator1

After this I get the following error:

Error: Could not find or load main class com.gemstone.gemfire.distributed.LocatorLauncher

Which to me this means that something is missing on the classpath to find that jar. I have these on my classpath:

export JAVA_HOME=/Java/jdk1.8.0_111    
export GEMFIRE=/Pivotal_GemFire_822
export GF_JAVA=$JAVA_HOME/bin/java

(I abbreviated the paths)

The setup docs also say you need tools.jar included w the JDK on your classpath. I did that and it didn't make any difference. I thought that would be included on JAVA_HOME anyways.

1

There are 1 answers

0
John Blum On BEST ANSWER

A few things...

  1. I assume the Pivotal_GemFire_822 install in "root" (?) is a complete, full distribution (i.e. downloaded form Pivotal's Network... PivNet)?

The com.gemstone.gemfire.distributed.LocatorLauncher class is contained in the $GEMFIRE/lib/gemfire.jar. Make sure the gemfire.jar exists and that you can find this class in the JAR file (using jar -tvf $GEMFIRE/lib/gemfire.jar | less then search (:) for "LocatorLauncher").

  1. Also make sure your $GEMFIRE environment variable is actually set in your current shell session...

$ echo $GEMFIRE

If you do NOT see any value returned then you need to source the shell file containing the export, e.g. $source ~/.bash_profile.

  1. Make sure your file system permissions to your GemFire installation are set appropriately. If you have GemFire 8.2.2. install under your home directory (/home/<user>) then this should not be a problem.

  2. As for the JDK tools.jar. This is not included on the classpath by default. The old Apple JDK 6 (which is no longer supported by Apple) included the tools.jar classes on the Apple JVM classpath, but regular Sun/Oracle JDKs do not. Also note, the JRE does not have the tools.jar in the distribution, unlike the JDK. However, it is also not strictly required as of GemFire 8.1 or 8.2, technically.

If all the above is true, then you should be able to start a Locator without incident. Please check these things and let us know if you still continue to have problems.

For real detailed technical information on what the Gfsh script does before the shell starts as well as what it does to launch a Locator, see this and this.

Hope this helps.

-John