0 Replies Latest reply on Jul 11, 2013 5:34 AM by kavyn

    org.infinispan.marshall.NotSerializableException: Object of type class java.util.ArrayList expected to be marshallable

    kavyn

      Hi all,

       

      I am trying to get infinispan cache from Jboss and put List<Object> as a key and String as data.getting the below exception

       

      org.infinispan.marshall.NotSerializableException: Object of type class java.util.ArrayList expected to be marshallable.

       

      ArrayList implements Serializable interface.

       

      Code Snippet:

       

      @Resource(mappedName="java:jboss/infinispan/container/dataCache")

          private EmbeddedCacheManager cacheMgr;

       

      Cache<ArrayList<Object>,String> cache = cacheMgr.getCache("dataCache");

                  ArrayList<Object> a1 = new ArrayList<Object>();

                  String str = "str";

                  a1.add(str);

                  a1.add(new TypeDefinition());

                  cache.put(a1, "dd");

                 

                  System.out.println("ContainsKEY? "+cache.containsKey(a1));

       

      cache configuration in domain.xml

       

      <cache-container name="dataCache" default-cache="dataCache">

                          <transport lock-timeout="60000"/>

                          <distributed-cache name="dataCache" mode="ASYNC" start="EAGER" batching="true">

                              <eviction strategy="LRU" max-entries="2000"/>

                              <expiration max-idle="600000" lifespan="1800000"/>

                              <file-store/>

                          </distributed-cache>

                      </cache-container>

       

      JBOSS Version: jboss-7.1.1

       

      Can anyone tell me what might have gone wrong, Please help.

       

      Thanks