Thanks for the reply.

How do I file a ticket ?

I know it is still early stage, usually how long it takes to fix this bug
and release a version because we need this functionality working for our
use case.

On Sep 7, 2017 10:22 PM, "Andrey Mashenkov" <[email protected]>
wrote:

Hi,
Looks like a bug and CacheEntryPredicateContainsValue shouldn't deserialize
value to compare BinaryObjects in case of replace() operation.
Feel free to fill a ticket for this.



On Thu, Sep 7, 2017 at 9:50 AM, saikiran939 <[email protected]> wrote:

> Hi Team,
>
> Our team on working on a usecase in which we don't want to have any classes
> on Ignite Server node's classpath. To achieve this we are making use of
> BinaryObject based querying and putting/replacing values into cache.
>
> We are also using Optimistic Locking to replace the values into cache using
> "binaryObjectcache.replace(key, oldValue, newValue)" API - this method
> fails
> with ClassNotFoundException when used in client/server topology if the
> cache
> value class is not present at server's classpath. Sample piece of code is
> given below:
>
> String key = "key1";
> CacheValue entry1 = new CacheValue("putsomevalue");
> IgniteCache<String, CacheValue> cache = ignite.getOrCreateCache(cacheCfg);
> cache.put(key, entry1); //put works fine even if there is no class present
> in server's classpath
>
> CacheValue replaceEntry1 = cache.get(key);
> replaceEntry1.location= "test";
>
> IgniteCache<String, BinaryObject> binaryCacheProjection =
> cache.withKeepBinary();
> BinaryObject oldValueInBinary = binaryCacheProjection.get(key);
> BinaryObject newValueInBinary = ignite.binary().toBinary(replaceEntry1);
> binaryCacheProjection.replace(key, oldValueInBinary, newValueInBinary);
>
> The last replace() method call fails with below exception, is this bug in
> ignite because put() API works or is there anyway to workaround this
> exception ? I think from the stacktrace ignite server is trying to
> deserialize value object even if it is binary. I get the same exception
> with
> normal cache.replace() API .
>
> Exception in thread "main"
> org.apache.ignite.cache.CachePartialUpdateException: Failed to update keys
> (retry update if possible).: [OP21|SHARED]
>         at
> org.apache.ignite.internal.processors.cache.GridCacheUtils.c
> onvertToCacheException(GridCacheUtils.java:1488)
>         at
> org.apache.ignite.internal.processors.cache.IgniteCacheProxy
> .cacheException(IgniteCacheProxy.java:2021)
>         at
> org.apache.ignite.internal.processors.cache.IgniteCacheProxy
> .replace(IgniteCacheProxy.java:1393)
>         at
> com.ignite.binary.TestReplaceBinaryObject.populateCache(Test
> ReplaceBinaryObject.java:166)
>         at
> com.ignite.binary.TestReplaceBinaryObject.main(TestReplaceBi
> naryObject.java:60)
>         at com.ignite.binary.IgniteDriver.main(IgniteDriver.java:11)
> Caused by: class
> org.apache.ignite.internal.processors.cache.CachePartialUpda
> teCheckedException:
> Failed to update keys (retry update if possible).: [OP21|SHARED]
>         at
> org.apache.ignite.internal.processors.cache.distributed.dht.
> atomic.GridNearAtomicSingleUpdateFuture.onResult(GridNearAto
> micSingleUpdateFuture.java:232)
>         at
> org.apache.ignite.internal.processors.cache.distributed.dht.
> atomic.GridDhtAtomicCache.processNearAtomicUpdateResponse(
> GridDhtAtomicCache.java:2969)
>         at
> org.apache.ignite.internal.processors.cache.distributed.dht.
> atomic.GridDhtAtomicCache.access$700(GridDhtAtomicCache.java:130)
>         at
> org.apache.ignite.internal.processors.cache.distributed.dht.
> atomic.GridDhtAtomicCache$6.apply(GridDhtAtomicCache.java:274)
>         at
> org.apache.ignite.internal.processors.cache.distributed.dht.
> atomic.GridDhtAtomicCache$6.apply(GridDhtAtomicCache.java:272)
>         at
> org.apache.ignite.internal.processors.cache.GridCacheIoManag
> er.processMessage(GridCacheIoManager.java:748)
>         at
> org.apache.ignite.internal.processors.cache.GridCacheIoManag
> er.onMessage0(GridCacheIoManager.java:353)
>         at
> org.apache.ignite.internal.processors.cache.GridCacheIoManag
> er.handleMessage(GridCacheIoManager.java:277)
>         at
> org.apache.ignite.internal.processors.cache.GridCacheIoManag
> er.access$000(GridCacheIoManager.java:88)
>         at
> org.apache.ignite.internal.processors.cache.GridCacheIoManag
> er$1.onMessage(GridCacheIoManager.java:231)
>         at
> org.apache.ignite.internal.managers.communication.GridIoMana
> ger.invokeListener(GridIoManager.java:1238)
>         at
> org.apache.ignite.internal.managers.communication.GridIoMana
> ger.processRegularMessage0(GridIoManager.java:866)
>         at
> org.apache.ignite.internal.managers.communication.GridIoMana
> ger.access$1700(GridIoManager.java:106)
>         at
> org.apache.ignite.internal.managers.communication.GridIoMana
> ger$5.run(GridIoManager.java:829)
>         at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPool
> Executor.java:1145)
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo
> lExecutor.java:615)
>         at java.lang.Thread.run(Thread.java:722)
>         Suppressed: class org.apache.ignite.IgniteCheckedException:
> Failed to
> update keys on primary node.
>                 at
> org.apache.ignite.internal.processors.cache.distributed.dht.
> atomic.GridNearAtomicUpdateResponse.addFailedKey(GridNearAto
> micUpdateResponse.java:350)
>                 at
> org.apache.ignite.internal.processors.cache.distributed.dht.
> atomic.GridDhtAtomicCache.updateSingle(GridDhtAtomicCache.java:2393)
>                 at
> org.apache.ignite.internal.processors.cache.distributed.dht.
> atomic.GridDhtAtomicCache.updateAllAsyncInternal0(GridDhtAto
> micCache.java:1652)
>                 at
> org.apache.ignite.internal.processors.cache.distributed.dht.
> atomic.GridDhtAtomicCache.updateAllAsyncInternal(GridDhtAtom
> icCache.java:1490)
>                 at
> org.apache.ignite.internal.processors.cache.distributed.dht.
> atomic.GridDhtAtomicCache.processNearAtomicUpdateRequest(
> GridDhtAtomicCache.java:2950)
>                 at
> org.apache.ignite.internal.processors.cache.distributed.dht.
> atomic.GridDhtAtomicCache.access$600(GridDhtAtomicCache.java:130)
>                 at
> org.apache.ignite.internal.processors.cache.distributed.dht.
> atomic.GridDhtAtomicCache$5.apply(GridDhtAtomicCache.java:268)
>                 at
> org.apache.ignite.internal.processors.cache.distributed.dht.
> atomic.GridDhtAtomicCache$5.apply(GridDhtAtomicCache.java:266)
>                 ... 12 more
>                 Suppressed: class org.apache.ignite.IgniteChecke
> dException:
> com.ignite.binary.CacheValue
>                         at
> org.apache.ignite.internal.util.IgniteUtils.cast(IgniteUtils.java:7142)
>                         at
> org.apache.ignite.internal.processors.cache.GridCacheContext
> .isAllLocked(GridCacheContext.java:1252)
>                         at
> org.apache.ignite.internal.processors.cache.GridCacheMapEntr
> y.innerUpdate(GridCacheMapEntry.java:2241)
>                         at
> org.apache.ignite.internal.processors.cache.distributed.dht.
> atomic.GridDhtAtomicCache.updateSingle(GridDhtAtomicCache.java:2252)
>                         ... 18 more
>                 Caused by: java.lang.ClassNotFoundException:
> com.ignite.binary.CacheValue
>                         at java.net.URLClassLoader$1.run(
> URLClassLoader.java:366)
>                         at java.net.URLClassLoader$1.run(
> URLClassLoader.java:355)
>                         at java.security.AccessController.doPrivileged(Native
> Method)
>                         at java.net.URLClassLoader.findCl
> ass(URLClassLoader.java:354)
>                         at java.lang.ClassLoader.loadClas
> s(ClassLoader.java:423)
>                         at sun.misc.Launcher$AppClassLoad
> er.loadClass(Launcher.java:308)
>                         at java.lang.ClassLoader.loadClas
> s(ClassLoader.java:356)
>                         at java.lang.Class.forName0(Native Method)
>                         at java.lang.Class.forName(Class.java:266)
>                         at
> org.apache.ignite.internal.util.IgniteUtils.forName(IgniteUtils.java:8350)
>                         at
> org.apache.ignite.internal.MarshallerContextAdapter.getClass
> (MarshallerContextAdapter.java:185)
>                         at
> org.apache.ignite.internal.binary.BinaryContext.descriptorFo
> rTypeId(BinaryContext.java:662)
>                         at
> org.apache.ignite.internal.binary.BinaryReaderExImpl.deseria
> lize(BinaryReaderExImpl.java:1474)
>                         at
> org.apache.ignite.internal.binary.BinaryObjectImpl.deseriali
> zeValue(BinaryObjectImpl.java:585)
>                         at
> org.apache.ignite.internal.binary.BinaryObjectImpl.value(Bin
> aryObjectImpl.java:142)
>                         at
> org.apache.ignite.internal.processors.cache.GridCacheUtils.
> value(GridCacheUtils.java:1512)
>                         at
> org.apache.ignite.internal.processors.cache.CacheEntryPredic
> ateContainsValue.apply(CacheEntryPredicateContainsValue.java:63)
>                         at
> org.apache.ignite.internal.processors.cache.CacheEntryPredic
> ateContainsValue.apply(CacheEntryPredicateContainsValue.java:32)
>                         at
> org.apache.ignite.internal.processors.cache.GridCacheContext
> .isAllLocked(GridCacheContext.java:1246)
>                         ... 20 more
>
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>



-- 
Best regards,
Andrey V. Mashenkov

Reply via email to