When I use the storeAsBinary option in my caches, the remote caches (using Hot Rod Client) return a MarshalledValue rather than the cached object instance. This poses a problem because the same code cannot be used for remote and embedded caches via BasicCache. This does not occur when storeAsBinary is not used.
The second problem is that the BasicCache generic type is typed to the cached object, and so, returning a type of cached object fails with a ClassCastException. Is there something I am missing which will return to me the cached type, rather than MarshalledValue without needing code to check the type everytime I do a get() from the cache?
I am using Infinispan 6.0.2.Final.
You shouldn't normally have to worry about even seeing the MarshalledValue type.
Can you post the configuration you are using on the servers (I am assuming it is either a local node or all the clustered servers have identical cache configuration) ? I ask because I would expect that compatibility is enabled as that is required when using a hybrid cache approach like this.