0 Replies Latest reply on Apr 17, 2013 3:59 AM by Anders Jespersen

    ClassCastException when using infinispan data after a redeploy

    Anders Jespersen Newbie

      I'm using infinispan as cache for 7.1.0.Final (in production).

       

      When I redeploy an ear (or try to run with clustered replicated cache), I get a ClassCastException of the type:

      dk.regionmidt.bsk.domain.UserDn cannot be cast to dk.regionmidt.bsk.domain.UserDn

       

      Which I suppose is a classloader pr deployment/server issue.

       

      The class in question is in a jar in the ear, and it's serializable with an id. I'm injecting with the resource-annotation, like this:

       

      {code:java}@Stateless

      @org.jboss.ejb3.annotation.SecurityDomain("bsk_domain")

      public class SearchBean implements SearchLocal {

       

        @Resource(mappedName = "java:jboss/infinispan/cache/bskCache/data")

        Cache<Object, Object> dataCache;

      {code}

       

      I tried injecting via a @Singleton like in the quickstart (here: https://github.com/infinispan/infinispan-quickstart/tree/master/jboss-as7) but got the same result.

       

      I also testet it in EAP6.1.0.Alpha and EAP6.0.1, same result.

       

      Should I keep the classes to be used in the cache in a module to be included on the cache-container in the server configuration? It's doable, but this would be inconvenient, since these classes obviously belong to the business logic, ie the EAR.