0
votes

Rest API works for me once I copy Rest api lib to libs folder and starting from a command line (./bin/ignite.sh ./examples/config/example-cache.xml ) and then trying url commands (e.g. http://localhost:8080/ignite?cmd=version).

How to do that from a java code? I tried starting a node with same configuration as above but Rest api seems that is not enabled (url commands do not work).

Thanks.

1

1 Answers

2
votes

Most probably when you start Ignite from java code you don't have rest api lib in your classpath.

If you use maven, add this to dependencies in pom.xml:

<dependency>
    <groupId>org.apache.ignite</groupId>
    <artifactId>ignite-rest-http</artifactId>
    <version>${ignite.version}</version>
</dependency>

Just don't forget to change ${ignite.version} to Ignite version you using.