Hi, AFAIK, PeerClassLoading works only with Ignite compute subsystem. For SQL functions you need to deploy them in cluster before use.
On Thu, Feb 15, 2018 at 4:29 AM, Williams, Michael < [email protected]> wrote: > What changes do I need to do to make ZeroDeploy work with QuerySqlFunction > definitions? I’m following the example and adding the class as follows, > but even with peer class loading enabled, I get a gnarly error. Can clients > marshal to servers? Any advice? > > > > > > import org.apache.ignite.cache.query.annotations.QuerySqlFunction; > > > > public class MyFunctions { > > @QuerySqlFunction > > public static int sqr(int x) { > > return x * x; > > } > > } > > > > … > > cfg.setPeerClassLoadingEnabled(true); > > cfg.setClientMode(true); > > cfg.setDeploymentMode(DeploymentMode.CONTINUOUS); > > try(Ignite ignite = Ignition.start(cfg)) > > … > > myCache.setSqlFunctionClasses(MyFunctions.class); > > … > > > > > > Error: > > class org.apache.ignite.IgniteCheckedException: Failed to find class with > given class loader for unmarshalling (make sure same versions of all > classes are available on all nodes or > > enable peer-class-loading) [clsLdr=sun.misc.Launcher$ > AppClassLoader@764c12b6, cls=IgniteStartup.MyFunctions] > > at org.apache.ignite.marshaller.jdk.JdkMarshaller.unmarshal0( > JdkMarshaller.java:126) > > at org.apache.ignite.marshaller.AbstractNodeNameAwareMarshalle > r.unmarshal(AbstractNodeNameAwareMarshaller.java:94) > > at org.apache.ignite.marshaller.jdk.JdkMarshaller.unmarshal0( > JdkMarshaller.java:143) > > at org.apache.ignite.marshaller.AbstractNodeNameAwareMarshalle > r.unmarshal(AbstractNodeNameAwareMarshaller.java:82) > > at org.apache.ignite.internal.util.IgniteUtils.unmarshal( > IgniteUtils.java:9795) > > at org.apache.ignite.spi.discovery.tcp.messages. > TcpDiscoveryCustomEventMessage.message(TcpDiscoveryCustomEventMessage > .java:81) > > at org.apache.ignite.spi.discovery.tcp.ServerImpl$ > RingMessageWorker.notifyDiscoveryListener(ServerImpl.java:5460) > > at org.apache.ignite.spi.discovery.tcp.ServerImpl$ > RingMessageWorker.processCustomMessage(ServerImpl.java:5282) > > at org.apache.ignite.spi.discovery.tcp.ServerImpl$ > RingMessageWorker.processMessage(ServerImpl.java:2656) > > > > Thanks, > > *Mike Williams* > > > -- Alexey Kuznetsov
