6 Replies Latest reply on Mar 13, 2012 6:58 PM by mmogley

    CacheLoader defined in XML not being created

    mmogley

      I have a strange issue.  I'm trying to bootstrap Infinispan from an external xml file using Spring. as follows:

       

      <bean

        id="cacheManager"

        class="org.infinispan.spring.provider.SpringEmbeddedCacheManagerFactoryBean"

        p:configurationFileLocation="classpath:/infinispan.xml"/>

       

      My configuration:

       

      <infinispan

        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

        xmlns="urn:infinispan:config:5.1"

        xsi:schemaLocation="

          urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd

        " 

      >

        <global>

          <transport clusterName="infinispan-ws">

            <properties>

              <property name="configurationFile" value="jgroups_mcast.xml"/>

            </properties>

          </transport>

        </global>

       

        <default>

          <loaders preload="true" shared="false">

            <loader class="PerstCacheStore"

              fetchPersistentState="true"

              ignoreModifications="false"

              purgeOnStartup="false"

            >       

              <properties>

                <property name="flushInterval" value="10000" />

                <property name="location" value="${java.io.tmpdir}/infinispan" />

                <property name="lockAcquistionTimeout" value="600000" />

                <property name="pagePoolSize" value="16000000" />

              </properties>

            </loader>

          </loaders>

       

          <storeAsBinary />            

        </default>

       

        <namedCache name="testCache">

          <clustering mode="replication">

            <stateRetrieval fetchInMemoryState="true"/>

            <sync/>

          </clustering>

       

          <expiration lifespan="300000" wakeUpInterval="5000"/>

       

          <eviction maxEntries="100" strategy="LRU"/>  

        </namedCache>

      </infinispan>

       

      This works without any apparent errors. However, the resulting InfinispanConfiguration - on inspection in debug mode - has no loader defined.

       

      I've paired down the configuration to just show the relevant details.  PerstCacheStore is a custom cache store I wrote to integrate with Perst.  As I said, there are no errors on startup, and I'm able to store and retrieve data from the cache (and replication is working).  However, no cache entries are being persisted.  Could this be related to the fact that the Spring provider is attempting to unmarshal the xml using JAXB?  I've read that this has been deprecated and Infinispan 5.1 now uses stax-based parsing.

       

      In my debugging, I noticed that the resulting CacheLoaderManagerConfig does seem to represent the 'loaders' element ('preload' is set to true), but its 'cacheLoaderConfigs' list property remains empty

       

      My environment:

       

      - Infinispan 5.2.0, latest snapshot (but same issue with Infinispan 5.1.2.CR1)

      - JDK 6, patch 30

      - Tomcat 6.0.32

       

      Any ideas?

       

      Thanks in advance.

       

      Michael