3 Replies Latest reply on Mar 7, 2012 9:01 AM by galder.zamarreno

    CacheLoader configuration in Infinispan 5.1.2

    ursudheesh

      From the user guide the cache loader are said to be configured as :

       

       

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

         <!-- We can have multiple cache loaders, which get chained -->

         <loader class="org.infinispan.loaders.file.FileCacheStore"

                 fetchPersistentState="true"

                 purgerThreads="3"

                 purgeSynchronously="true"

                 ignoreModifications="false"

                 purgeOnStartup="false">

            <!-- See the documentation for more configuration examples and flags. -->

            <properties>

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

            </properties>

            <singletonStore enabled="true" pushStateWhenCoordinator="true" pushStateTimeout="20000"/>

            <async enabled="true" flushLockTimeout="15000" threadPoolSize="5"/>

         </loader>

      </loaders>

       

       

       

       

       

       

       

       

       

      However when use a similar configuration in my cache config,

       

      <namedCache name="InfinispanClientTest">

       

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

                                    <loader class="org.infinispan.loaders.file.FileCacheStore"

                                              purgeOnStartup="true">

                                              <properties>

                                                        <property name="location" value="out/Node1" />

                                              </properties>

                                    </loader>

                          </loaders>

       

                          <jmxStatistics enabled="true" />

                          <storeAsBinary enabled="true" />

                          <clustering mode="replication">

                                    <stateRetrieval timeout="20000" fetchInMemoryState="true"/>

                                    <sync replTimeout="30000" />

                          </clustering>

            </namedCache>

       

       

       

       

       

      i get the following errors:

       

       

      cvc-attribute.3: The value 'org.infinispan.loaders.file.FileCacheStore' of attribute 'class' on element 'loader' is not valid with respect to its type, 'int'.

       

       

       

       

      Can you pls provide the correct usage?

       

      Regards

      Sudheesh

        • 1. Re: CacheLoader configuration in Infinispan 5.1.2
          utk4rsh

          Hi, Sudhesh.

           

          I just tried the same, and its working. Probably the location parameter is wrong or you might have missed the transport tag details in the global tag.

          Here's my config file:

           

          <infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
             xmlns="urn:infinispan:config:5.1">
          <global>
              <transport transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport">
                  <properties>
                      <property name="configurationFile" value="jgroups.xml"/>
                  </properties>
              </transport>
          </global>
          <namedCache name="CacheStore">
             <loaders passivation="false" shared="false" preload="true">
                    <loader class="org.infinispan.loaders.file.FileCacheStore" fetchPersistentState="true"
                         ignoreModifications="false" purgeOnStartup="false">
                      <properties>
                           <property name="location" value="C:\infinispan\store2e"/>
                         </properties>
                    </loader>
              </loaders>
              <jmxStatistics enabled="true" />
                  <storeAsBinary enabled="true" />
                  <clustering mode="distribution">
                      <stateRetrieval timeout="20000" fetchInMemoryState="true"/>
                      <sync replTimeout="30000" />
                   </clustering>
          </namedCache>
          </infinispan>
          
          • 2. Re: CacheLoader configuration in Infinispan 5.1.2
            mmogley

            It may be working, but the xsd seems to be wrong here.  It seems that the class attribute type should be 'xsd:string'.

            • 3. Re: CacheLoader configuration in Infinispan 5.1.2
              galder.zamarreno