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? 
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.
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 ?
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!
Sounds good, thanks!
The NumberOfEntries MBean attribute only returns the number of entries in the local datacontainer and not the cluster
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
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!