| That happens because the classloader of the key, which is included in the deployment, has changed when its redeployed. With JDK or key types not stored in deployment, this does not happen. One workaround here would be to clear the caches when the application is redeployed. You can do that via SessionFactory.getCache().evictEntityData() and related methods. The other workaround would be to avoid redeployments. Regardless, I don't think this issue is specific to Infinispan cache provider. It'd happen to any cache providers since you'd end up in the same place having to calculate the hash code of the custom key. |