You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Alexey Kukushkin (Jira)" <ji...@apache.org> on 2020/11/25 14:49:00 UTC

[jira] [Created] (IGNITE-13760) Ignite.NET GetAffinity fails with NullPointerException

Alexey Kukushkin created IGNITE-13760:
-----------------------------------------

             Summary: Ignite.NET GetAffinity fails with NullPointerException
                 Key: IGNITE-13760
                 URL: https://issues.apache.org/jira/browse/IGNITE-13760
             Project: Ignite
          Issue Type: Bug
          Components: platforms
    Affects Versions: 2.9
            Reporter: Alexey Kukushkin


* Given there are Ignite.NET server and client nodes
* When the server node creates a cache and then the client node immediately gets affinity for the cache
* Then getting affinity fails with NullPointerException

{code:c#}
IgniteConfiguration IgniteCfg(bool clientMode = false) => new IgniteConfiguration
{
    ClientMode = clientMode,
    IgniteInstanceName = Guid.NewGuid().ToString(),
    DiscoverySpi = new TcpDiscoverySpi
    {
        IpFinder = new TcpDiscoveryStaticIpFinder
        {
            Endpoints = new[] { "127.0.0.1:47500" }
        }
    }
};
using var igniteSrv = Ignition.Start(IgniteCfg());
using var igniteClient = Ignition.Start(IgniteCfg(true));
var cache1 = igniteSrv.GetOrCreateCache<int, string>("cache1");
igniteClient.GetAffinity("cache1");
{code}

The igniteClient.GetAffinity fails with this exception:
{code}
Apache.Ignite.Core.Common.IgniteException
  HResult=0x80131500
  Message=Java exception occurred [class=java.lang.NullPointerException, message=]
  Source=Apache.Ignite.Core
  StackTrace:
   at Apache.Ignite.Core.Impl.PlatformJniTarget.InStreamOutObject(Int32 type, Action`1 writeAction)
   at Apache.Ignite.Core.Impl.PlatformTargetAdapter.DoOutOpObject(Int32 type, Action`1 action)
   at Apache.Ignite.Core.Impl.Ignite.Apache.Ignite.Core.Impl.IIgniteInternal.GetAffinity(String cacheName)
   at Apache.Ignite.Core.Impl.Ignite.GetAffinity(String cacheName)
   at DotNet.Sandbox.Program.Main(String[] args) in C:\Dev\tmp\DotNet.Sandbox\Program.cs:line 32
  This exception was originally thrown at this call stack:
    Apache.Ignite.Core.Impl.Unmanaged.Jni.Env.ExceptionCheck()
    Apache.Ignite.Core.Impl.Unmanaged.Jni.Env.CallObjectMethod(Apache.Ignite.Core.Impl.Unmanaged.Jni.GlobalRef, System.IntPtr, long*)
    Apache.Ignite.Core.Impl.Unmanaged.UnmanagedUtils.TargetInStreamOutObject(Apache.Ignite.Core.Impl.Unmanaged.Jni.GlobalRef, int, long)
    Apache.Ignite.Core.Impl.PlatformJniTarget.InStreamOutObject(int, System.Action<Apache.Ignite.Core.Impl.Binary.IO.IBinaryStream>)
Inner Exception 1:
JavaException: java.lang.NullPointerException
	at org.apache.ignite.internal.processors.platform.cache.affinity.PlatformAffinity.<init>(PlatformAffinity.java:125)
	at org.apache.ignite.internal.processors.platform.PlatformProcessorImpl.processInStreamOutObject(PlatformProcessorImpl.java:640)
	at org.apache.ignite.internal.processors.platform.PlatformTargetProxyImpl.inStreamOutObject(PlatformTargetProxyImpl.java:79)
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)