[wildfly-dev] ClassCastException when get Object from Replicated Cache after redeploy

Paul Ferraro paul.ferraro at redhat.com
Mon Nov 11 09:52:54 EST 2013


How did you obtain your cache instance?

On Sun, 2013-11-10 at 11:32 +0100, Domenico Briganti wrote:
> Hi all, 
> I'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:
> a.b.C cannot be cast to a.b.C.
> 
> Certainly this is for modular class loader of WildFly.
> 
> Now I resolved the issue cloning the object on ClassCastException:
> 
> try {
> AuthUserEntry authUserEntry = getCache().get(key);
> return authUserEntry;
> } catch (ClassCastException e) {
> return DeepCopy.copy(getCache().get(key));
> }
> 
> Not so elegant, but it works.
> There is a better solution?
> 
> Thank you,
> Domenico 
> 
> _______________________________________________
> wildfly-dev mailing list
> wildfly-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/wildfly-dev




More information about the wildfly-dev mailing list