Hi Pavel,
This has worked for me by adding  [QuerySqlField] for all fields. Thank you
much.

Thanks & Regards,
Charlin


On Tue, 5 Jan 2021 at 14:05, Pavel Tupitsyn <ptupit...@apache.org> wrote:

> Hi Charlin,
>
> I've filed a bug [1]
>
> However, it looks like [QuerySqlField] attributes are missing on
> TestModel29WithICloneable properties.
> To make your model queryable with SQL/LINQ, make sure to mark some or all
> properties like this:
>
> public class TestModel29WithICloneable : ICloneable, IBinarizable
> {
>         [QuerySqlField]
>         public string TestField1 { get; set; }
>
>         [QuerySqlField]
>         public string TestField2 { get; set; }
>
>         [QuerySqlField]
>         public string TestField3 { get; set; }
> ...
> }
>
> This will get rid of the exception (which is still a bug, but for a weird
> use case when no SQL fields are defined).
>
> Thanks,
> Pavel
>
> [1] https://issues.apache.org/jira/browse/IGNITE-13957
>
> On Tue, Jan 5, 2021 at 10:28 AM Ilya Kazakov <kazakov.i...@gmail.com>
> wrote:
>
>> Hello, Charlin!
>>
>> Try to enable peer class loading:
>> https://ignite.apache.org/docs/latest/code-deployment/peer-class-loading
>>
>> ----------------------
>> Ilya Kazakov
>>
>> вт, 5 янв. 2021 г. в 14:52, Charlin S <charli...@hotelhub.com>:
>>
>>> Hi,
>>>
>>> i'm getting exception on when a new record is added, which was working
>>> till ignite 2.8.1
>>> This issue seems to be with Ignite 2.9.0 and Ignite 2.9.1
>>> The c# code is below:
>>> void Main()
>>> {
>>> A a = new A();
>>> }
>>>
>>> public class A
>>> {
>>> public A()
>>> {
>>>
>>>  IgniteConfiguration igniteGridIg = new IgniteConfiguration();
>>>             igniteGridIg.AutoGenerateIgniteInstanceName = true;
>>>             igniteGridIg.IgniteHome =
>>> @"D:\Software\apache-ignite-2.9.1-bin";
>>>             igniteGridIg.SpringConfigUrl =
>>> Path.Combine(@"D:\IgniteConfig\",
>>> "common_dynamiccache_client_config_2.9.1.xml");
>>>             igniteGridIg.ConsistentId =
>>> Guid.NewGuid().ToString().ToUpper();
>>>
>>> IIgnite StaticGrid_Dev = Ignition.Start(igniteGridIg);
>>> TestModel29WithICloneable model = new TestModel29WithICloneable();
>>>
>>> model.TestField1 = "11";
>>> model.TestField2 = "22";
>>>
>>> ICache<string, TestModel29WithICloneable>
>>> TestModel29WithICloneableICache=null;
>>>            CacheConfiguration cgTest = new
>>> CacheConfiguration("TestModel29WithICloneable", new
>>> QueryEntity(typeof(string), typeof(TestModel29WithICloneable)));
>>>                         cgTest.CopyOnRead = false;
>>>                         cgTest.EagerTtl = true;
>>>                         cgTest.Backups = 1;
>>>
>>> var cacheName = StaticGrid_Dev.GetOrCreateCache<string,
>>> object>(cgTest).WithExpiryPolicy(new ExpiryPolicy(
>>>                              TimeSpan.FromSeconds(3600),
>>>                              TimeSpan.FromSeconds(3600),
>>>                              TimeSpan.FromSeconds(3600)
>>>                              ));
>>>
>>> cacheName.Put("TestModel29WithICloneable:Test|0100010test2", model);
>>>
>>> //Console.Write(cacheName);
>>> Ignition.StopAll(true);
>>> }
>>> }
>>>
>>>
>>> Model class:
>>> public class TestModel29WithICloneable : ICloneable, IBinarizable
>>>     {
>>>         public TestModel29WithICloneable Copy()
>>>         {
>>>             return (TestModel29WithICloneable)this.MemberwiseClone();
>>>         }
>>>
>>>         public object Clone()
>>>         {
>>>             var clone = this.MemberwiseClone();
>>>             return clone;
>>>         }
>>>         public string TestField1 { get; set; }
>>>         public string TestField2 { get; set; }
>>>         public string TestField3 { get; set; }
>>>
>>>         public void ReadBinary(IBinaryReader reader)
>>>         {
>>>             if (reader != null)
>>>             {
>>>                 TestField1 = reader.ReadString("testfield1");
>>>                 TestField2 = reader.ReadString("testfield2");
>>>                 TestField3 = reader.ReadString("testfield3");
>>>             }
>>>         }
>>>
>>>         public void WriteBinary(IBinaryWriter writer)
>>>         {
>>>             if (writer != null)
>>>             {
>>>                 writer.WriteString("testfield1", TestField1);
>>>                 writer.WriteString("testfield2", TestField2);
>>>                 writer.WriteString("testfield3", TestField3);
>>>             }
>>>         }
>>>     }
>>>
>>> Result :
>>> javax.cache.CacheException: class
>>> org.apache.ignite.IgniteCheckedException: Requesting mapping from grid
>>> failed for [platformId=0, typeId=1876507903]
>>>   at
>>> org.apache.ignite.internal.processors.cache.GridCacheUtils.convertToCacheException(GridCacheUtils.java:1270)
>>>   at
>>> org.apache.ignite.internal.processors.cache.IgniteCacheProxyImpl.cacheException(IgniteCacheProxyImpl.java:2083)
>>>   at
>>> org.apache.ignite.internal.processors.cache.IgniteCacheProxyImpl.put(IgniteCacheProxyImpl.java:1319)
>>>   at
>>> org.apache.ignite.internal.processors.cache.GatewayProtectedCacheProxy.put(GatewayProtectedCacheProxy.java:856)
>>>   at
>>> org.apache.ignite.internal.processors.platform.cache.PlatformCache.processInStreamOutLong(PlatformCache.java:839)
>>>   at
>>> org.apache.ignite.internal.processors.platform.PlatformTargetProxyImpl.inStreamOutLong(PlatformTargetProxyImpl.java:67)
>>> Caused by: class org.apache.ignite.IgniteCheckedException: Requesting
>>> mapping from grid failed for [platformId=0, typeId=1876507903]
>>>   at
>>> org.apache.ignite.internal.util.IgniteUtils.cast(IgniteUtils.java:7563)
>>>   at
>>> org.apache.ignite.internal.processors.cache.GridCacheContext.validateKeyAndValue(GridCacheContext.java:1910)
>>>   at
>>> org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridNearAtomicSingleUpdateFuture.mapSingleUpdate(GridNearAtomicSingleUpdateFuture.java:555)
>>>   at
>>> org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridNearAtomicSingleUpdateFuture.map(GridNearAtomicSingleUpdateFuture.java:457)
>>>   at
>>> org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridNearAtomicSingleUpdateFuture.mapOnTopology(GridNearAtomicSingleUpdateFuture.java:446)
>>>   at
>>> org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridNearAtomicAbstractUpdateFuture.map(GridNearAtomicAbstractUpdateFuture.java:249)
>>>   at
>>> org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache.update0(GridDhtAtomicCache.java:1178)
>>>   at
>>> org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache.put0(GridDhtAtomicCache.java:626)
>>>   at
>>> org.apache.ignite.internal.processors.cache.GridCacheAdapter.put(GridCacheAdapter.java:2567)
>>>   at
>>> org.apache.ignite.internal.processors.cache.GridCacheAdapter.put(GridCacheAdapter.java:2544)
>>>   at
>>> org.apache.ignite.internal.processors.cache.IgniteCacheProxyImpl.put(IgniteCacheProxyImpl.java:1316)
>>>   ... 3 more
>>> Caused by: class org.apache.ignite.binary.BinaryInvalidTypeException:
>>> Requesting mapping from grid failed for [platformId=0, typeId=1876507903]
>>>   at
>>> org.apache.ignite.internal.binary.BinaryContext.descriptorForTypeId(BinaryContext.java:689)
>>>   at
>>> org.apache.ignite.internal.binary.BinaryReaderExImpl.deserialize0(BinaryReaderExImpl.java:1757)
>>>   at
>>> org.apache.ignite.internal.binary.BinaryReaderExImpl.deserialize(BinaryReaderExImpl.java:1716)
>>>   at
>>> org.apache.ignite.internal.binary.BinaryObjectImpl.deserializeValue(BinaryObjectImpl.java:796)
>>>   at
>>> org.apache.ignite.internal.binary.BinaryObjectImpl.value(BinaryObjectImpl.java:142)
>>>   at
>>> org.apache.ignite.internal.processors.query.QueryTypeDescriptorImpl.validateProps(QueryTypeDescriptorImpl.java:613)
>>>   at
>>> org.apache.ignite.internal.processors.query.QueryTypeDescriptorImpl.validateKeyAndValue(QueryTypeDescriptorImpl.java:587)
>>>   at
>>> org.apache.ignite.internal.processors.query.GridQueryProcessor.validateKeyAndValue(GridQueryProcessor.java:3552)
>>>   at
>>> org.apache.ignite.internal.processors.cache.GridCacheContext.validateKeyAndValue(GridCacheContext.java:1907)
>>>   ... 12 more
>>> Caused by: java.lang.ClassNotFoundException: Requesting mapping from
>>> grid failed for [platformId=0, typeId=1876507903]
>>>   at
>>> org.apache.ignite.internal.MarshallerContextImpl.getClassName(MarshallerContextImpl.java:429)
>>>   at
>>> org.apache.ignite.internal.MarshallerContextImpl.getClassName(MarshallerContextImpl.java:384)
>>>   at
>>> org.apache.ignite.internal.MarshallerContextImpl.getClass(MarshallerContextImpl.java:371)
>>>   at
>>> org.apache.ignite.internal.binary.BinaryContext.descriptorForTypeId(BinaryContext.java:680)
>>>
>>>
>>> Regards
>>> Charlin
>>>
>>

Reply via email to