<div dir="ltr">Hi all, <br>
 I&#39;m using an Infinispan Replicated cache with WildFly Beta 1. It happen that when I get a value from cache after a redeploy a get a ClassCastException:<br>
a.b.C cannot be cast to a.b.C.<br>
<br>
Certainly this is for modular class loader of WildFly.<br>
 <br>
Now I resolved the issue cloning the object on ClassCastException:<br>
<br>
try {<br>
        AuthUserEntry authUserEntry = getCache().get(key);<br>
        return authUserEntry;<br>
} catch (ClassCastException e) {<br>
        return DeepCopy.copy(getCache().get(key));<br>
}<br>
<br>
Not so elegant, but it works.<br>
There is a better solution?<br>
<br>
Thank you,<br>
Domenico <br></div>