-
1. Re: Get ClassCastException [MarshalledValue cannot be cast] when iterating the cache
william.burns May 18, 2015 8:37 AM (in response to sdcf_2006)What version of Infinispan are you using? I ask because iterators changed in 7.0.
Also I am guessing you are using the iterator from the return of the entrySet method?
MarshallledValue is how internally Infinispan stores the byte array when store as binary is enabled. Do you have both key and values enabled for store as binary? [1]
-
2. Re: Get ClassCastException [MarshalledValue cannot be cast] when iterating the cache
sdcf_2006 May 18, 2015 10:12 AM (in response to william.burns)Hi William,
Thanks for your reply!
The version is 7.1.1. And yes, I'm using the iterator form the return of the entrySet method. I see the size of the returned entrySet is 2, whereas the numberOfEntry value shown in JMX/JConsole is 1.
Only builder.storeAsBinary().enable(); is called in my code, but I suppose key and value are both enabled for store as binary, as I see these 2 configurations are true by default.
Actually, some other cache are working normally, whereas we saw the issue for this specific cache.
Best Regards,
Fei
-
3. Re: Get ClassCastException [MarshalledValue cannot be cast] when iterating the cache
william.burns May 19, 2015 8:29 AM (in response to sdcf_2006)I can't seem to reproduce this with the tests we have for store as binary. You say other caches are working normally do they have the same exact configuration? It would be most helpful if you could post the entire configuration of the cache if it at all possible. There may be some combination of configuration that is messing this up, but I don't know which to try out.
Just out of curiosity does the size method on the entrySet return 2 ?
Thanks!
-
4. Re: Get ClassCastException [MarshalledValue cannot be cast] when iterating the cache
sdcf_2006 May 19, 2015 8:50 AM (in response to william.burns)Yes, the size method on entrySet returns 2, but the JConsole shows only 1 entry.
I'll try if I can create a piece of code to reproduce this issue? Will let you know then. Thanks!
-
5. Re: Get ClassCastException [MarshalledValue cannot be cast] when iterating the cache
william.burns May 19, 2015 8:54 AM (in response to sdcf_2006)Sounds good, thanks!
-
6. Re: Get ClassCastException [MarshalledValue cannot be cast] when iterating the cache
nadirx May 19, 2015 8:58 AM (in response to william.burns)The NumberOfEntries MBean attribute only returns the number of entries in the local datacontainer and not the cluster
-
7. Re: Get ClassCastException [MarshalledValue cannot be cast] when iterating the cache
sdcf_2006 May 19, 2015 12:08 PM (in response to william.burns)Sorry cannot provide a runnable code to reproduce this issue. But I found something as below:
This issue only happens when the cache is configured as persistent
- configBuilder.persistence().addSingleFileStore();
Without this configuration, in other words if the cache is non-persistent, it is working normally. Only 1 entry is returned while iterating the cache.
Also, if disable the storeAsBinary, even for persistent cache, there is no issue.
So in conclusion, this issue only happens when the 1. cache is persistent and 2. storeAsBinary is enabled. Please let me know if you have any idea about it. Thanks!