Error: Could not find or load main class org.apache.ignite.startup.cmdline
Asked Answered
P

4

6

while installing apache ignite on google cloud instance, I got this error. I googled this error, hoping someone would have faced this error already. but none has faced this issue. help me solving it.

[root@api-manager1 apache-ignite-2.3.0-src]# bin/ignite.sh 
Error: Could not find or load main class org.apache.ignite.startup.cmdline.CommandLineRandomNumberGenerator
Error: Could not find or load main class org.apache.ignite.internal.util.portscanner.GridJmxPortFinder
bin/ignite.sh, WARN: Failed to resolve JMX host (JMX will be disabled): api-manager1
Error: Could not find or load main class org.apache.ignite.startup.cmdline.CommandLineStartup
Polestar answered 22/11, 2017 at 13:26 Comment(0)
S
18

You downloaded sources, not binaries, that's why you don't have needed libraries. You need to use apache-ignite-2.3.0-bin instead.

Surge answered 22/11, 2017 at 13:39 Comment(1)
you were right, now onwards I will download the binary files if I m new to that application. thanks again.Polestar
D
3

You are trying to start server in src file downloaded and not in binaries download.I have faced similar issue, to resolve follow below steps

Go to binary release : https://ignite.apache.org/download.cgi and scroll down as shown in screenshot :

enter image description here

download the binary release then at the installation folder execute command : ignite.bat /examples/config/example-ignite.xml

Server will start as below :

enter image description here

Dedra answered 13/12, 2018 at 13:8 Comment(0)
W
1

If you are working with binary distribution of ignite and still facing this error, then this is because your IGNITE_HOME is pointing to wrong directory.

How does IGNITE_HOME related to this error?

Just take a look at ignite.sh script, It is as follows

if [ "${IGNITE_HOME}" = "" ];
    then IGNITE_HOME_TMP="$(dirname "$(cd "$(dirname "$0")"; "pwd")")";
    else IGNITE_HOME_TMP=${IGNITE_HOME};
fi

SCRIPTS_HOME="${IGNITE_HOME_TMP}/bin"
...

The above script is to determine the absolute path of SCRIPTS_HOME based on IGNITE_HOME value. As part of start up, you can observe that script is trying to load CommandLineStartup class present at SCRIPTS_HOME. It won't find the class if the IGNITE_HOME is poininting to wrong directory and ends up throwing this exception.

Wilsey answered 6/5, 2019 at 7:25 Comment(0)
S
0

The question may be little bit old but i'm posting my answer for helping anyone who just started working with apache ignite. From the apache ignite website there is many possibilities to start using apache ignite(src, bin, docker ...), one of them is by using src files. in this case you need to follow exactly what is mentionned here https://apacheignite.readme.io/docs/getting-started#building-from-source

from apache ignite website:

Binary downloads are provided for the convenience of our users and are not official Apache Ignite releases

N.B:The src folder contains DEVNOTES.txt it gives details about the steps that need to be followed to generate the binaries.

Sunlit answered 8/9, 2018 at 15:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.