7 Replies Latest reply on Mar 8, 2012 8:25 AM by David Beltrán

    Infinispan preload custom application class from file persistence

    David Beltrán Newbie

      Hi,

       

      I would like to know what's the easy way to get the infinispan Cache configurated like EAGER and file persistence to preload our custom applicattion classes. We can put and get the classes without problems, but when we restart the server we get the following excepcion:

       

      14:19:55,411 ERROR [org.infinispan.loaders.file.FileCacheStore] (pool-15-thread-1) ISPN000062: Error while reading from file: /var/lib/jboss-as-7.1.0.Final/standalone/configuration/pcci/escache/persistencia/CachePersistenciaFichero/1610233856: java.lang.ClassNotFoundException: com.eliopseinalia.pcci.escache.test.junit.dominio.ESCacheTestCiudad from [Module "org.jboss.as.clustering.infinispan:main" from local module loader @177b3cd (roots: /var/lib/jboss-as-7.1.0.Final/modules)]
          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
          at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)
          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
          at java.lang.Class.forName0(Native Method) [rt.jar:1.6.0_30]
          at java.lang.Class.forName(Class.java:247) [rt.jar:1.6.0_30]
          at org.jboss.marshalling.AbstractClassResolver.loadClass(AbstractClassResolver.java:135) [jboss-marshalling-1.3.9.GA.jar:1.3.9.GA]
          at org.jboss.marshalling.AbstractClassResolver.resolveClass(AbstractClassResolver.java:116) [jboss-marshalling-1.3.9.GA.jar:1.3.9.GA]
          at org.jboss.marshalling.river.RiverUnmarshaller.doReadClassDescriptor(RiverUnmarshaller.java:892)
          at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1204)
          at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:272)
          at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:209)
          at org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:37) [jboss-marshalling-1.3.9.GA.jar:1.3.9.GA]
          at org.infinispan.container.entries.ImmortalCacheEntry$Externalizer.readObject(ImmortalCacheEntry.java:158) [infinispan-core-5.1.1.FINAL.jar:5.1.1.FINAL]
          at org.infinispan.container.entries.ImmortalCacheEntry$Externalizer.readObject(ImmortalCacheEntry.java:148) [infinispan-core-5.1.1.FINAL.jar:5.1.1.FINAL]
          at org.infinispan.marshall.jboss.ExternalizerTable$ExternalizerAdapter.readObject(ExternalizerTable.java:399) [infinispan-core-5.1.1.FINAL.jar:5.1.1.FINAL]
          at org.infinispan.marshall.jboss.ExternalizerTable.readObject(ExternalizerTable.java:287) [infinispan-core-5.1.1.FINAL.jar:5.1.1.FINAL]
          at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:351)
          at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:209)
          at org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:37) [jboss-marshalling-1.3.9.GA.jar:1.3.9.GA]
          at org.infinispan.loaders.bucket.Bucket$Externalizer.readObject(Bucket.java:157) [infinispan-core-5.1.1.FINAL.jar:5.1.1.FINAL]
      ...
      

      I understand tha infinispan can't locate our classes, and we have created a jar with the classes that infinispan is looking for, but we don't know where to put it. Of course the lib folder doesn't work. I haved tried to create a simple module with our jar and to add a dependece in the infinispan module but this doesn't work either.

       

      Any help would be appreciate. Thank you in advance,

       

      David