2 Replies Latest reply on Mar 4, 2008 4:05 PM by Rakesh Malpani

    java.io.NotSerializableException POJOCache

    Rakesh Malpani Newbie

      Hi All,

      I am using PojoCache and creating it in the following manner:
      (Create configuration by passing an inputstream, and creating a pojoCache using the PojoCacheFactory)

      Configuration jbossCacheConf = (new XmlConfigurationParser()
       public Configuration parseInputStream(InputStream _inStream)
       return parseStream(_inStream);
      pojoCache = PojoCacheFactory.createCache(jbossCacheConf, false);

      In a clustered environment, when I do attach, I get the following exception java.io.NotSerializableException.

      The object has the following annotation:
      public class CacheElement{/*some stuff*/}

      From what I understand.. pojoCache does not require serialization, so am not sure why I keep getting this exception. I have seen the example configuration "META-INF/replSync-service.xml". My configuration is pretty similar except it has no cache loader + the MBean tag's attribute, code = "org.jboss.cache.pojo.jmx.PojoCacheJmxWrapper" but has the same name i.e. = "jboss.cache:service=TreeCache"

      Am not sure if changing the name will cause any problem, for example to: jboss.cache:service=XYZCache, but for now am using the same name.

      Can anyone please give me any pointers as to what I am doing incorrectly.

      Any help is much appreciated.