ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MDmitry_ <vpdi...@mail.ru>
Subject peerClassLoadingEnabled=true but java.lang.ClassNotFoundException
Date Thu, 07 Mar 2019 08:04:28 GMT
Interface 

package ru.service.grid;

import org.apache.ignite.services.Service;

public interface HashService extends Service {
    String getHash(String str);
}

Implementation

package ru.service.grid;

import org.apache.commons.codec.digest.DigestUtils;
import org.apache.ignite.services.Service;
import org.apache.ignite.services.ServiceContext;

import java.io.Serializable;

public class HashServiceImpl implements HashService {

    private static final long serialVersionUID = 3L;

    @Override
    public void cancel(ServiceContext ctx) {
        System.out.println("Service was cancelled: " + ctx.name());
    }

    @Override
    public void init(ServiceContext ctx) throws Exception {
        System.out.println("Service was initialized: " + ctx.name());
    }

    @Override
    public void execute(ServiceContext ctx) throws Exception {
        System.out.println("Service was executed: " + ctx.name());
    }

    @Override
    public String getHash(String str) {
        String hash = DigestUtils.md5Hex(str);
        System.out.println("Server: " + hash);
        return hash;
    }
}

Config

        <property name="peerClassLoadingEnabled" value="true"/>

        <property name="serviceConfiguration">
            <list>
                <bean
class="org.apache.ignite.services.ServiceConfiguration">
                    <property name="service">
                        <bean class="ru.service.grid.HashServiceImpl"/>
                    </property>
                    <property name="totalCount" value="2"/>
                    <property name="maxPerNodeCount" value="1"/>
                </bean>
            </list>
        </property>

Run

Ignition.start("service.xml")

Error

java.lang.ClassNotFoundException: ru.service.grid.HashServiceImpl



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Mime
View raw message