Problem in starting the server node via java program

classic Classic list List threaded Threaded
2 messages Options
pgarg pgarg
Reply | Threaded
Open this post in threaded view
|

Problem in starting the server node via java program

This post was updated on .
asked by piyali

My code is :-

import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCompute;
import org.apache.ignite.IgniteException;
import org.apache.ignite.Ignition;

public class ExampleNodeStartup {

        public static void main(String[] args) throws IgniteException{

            Ignite ignite= Ignition.start();
            IgniteCompute compute = ignite.compute();

            // Execute a job and wait for the result.
            String res = compute.call(() -> {
              // Print hello world on some cluster node.
              System.out.println("Hello World");

              return "Hello World";
            });
        }
}


The error which i get is :

Exception in thread "main" class org.apache.ignite.IgniteException: Failed to create Ignite component (consider adding ignite-spring module to classpath) [component=SPRING, cls=org.apache.ignite.internal.processors.spring.IgniteSpringProcessorImpl] at org.apache.ignite.internal.util.IgniteUtils.convertException(IgniteUtils.java:618) at org.apache.ignite.Ignition.start(Ignition.java:273) at ExampleNodeStartup.main(ExampleNodeStartup.java:11) Caused by: class org.apache.ignite.IgniteCheckedException: Failed to create Ignite component (consider adding ignite-spring module to classpath) [component=SPRING, cls=org.apache.ignite.internal.processors.spring.IgniteSpringProcessorImpl] at org.apache.ignite.internal.IgniteComponentType.componentException(IgniteComponentType.java:273) at org.apache.ignite.internal.IgniteComponentType.create0(IgniteComponentType.java:264) at org.apache.ignite.internal.IgniteComponentType.create(IgniteComponentType.java:175) at org.apache.ignite.internal.IgnitionEx.loadConfigurations(IgnitionEx.java:546) at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:737) at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:697) at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:651) at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:426) at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:406) at org.apache.ignite.Ignition.start(Ignition.java:270) ... 1 more Caused by: java.lang.ClassNotFoundException: org.apache.ignite.internal.processors.spring.IgniteSpringProcessorImpl at java.net.URLClassLoader$1.run(URLClassLoader.java:372) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:360) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:260) at org.apache.ignite.internal.IgniteComponentType.create0(IgniteComponentType.java:250) ... 9 more

Whats the exact problem and what are the steps to run?..Do we have to run the command bin/ignite.sh..???

-----
This post is migrated from now discontinued Apache Ignite forum at
http://apacheignite.readme.io/v1.0/discuss
pgarg pgarg
Reply | Threaded
Open this post in threaded view
|

Re: Problem in starting the server node via java program

commented by dmitriy setrakyan

You should import ignite-spring maven artifact into your Maven pom file. The Maven Setup documentation has example on how to do it.

-----
This post is migrated from now discontinued Apache Ignite forum at
http://apacheignite.readme.io/v1.0/discuss