9 Replies Latest reply on Feb 2, 2005 1:33 PM by Ben Wang

    Relationship between CachePreload and Eviction Policy

    R G Newbie

      Hi, I am getting problems while configure my treecache-service.xml with EvictionPolicy and CacheLoader in JBossCache 1.2 (on a JBoss 4.0.1 server).
      I've got the following message:

      Starting failed jboss.cache:service=TreeCache
      org.jboss.util.NestedRuntimeException: - nested throwable: (java.lang.NullPointerException)
      ......
      Caused by: java.lang.NullPointerException
      at org.jboss.cache.eviction.LRUPolicy.nodeVisited(LRUPolicy.java:100)


      This is my service.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      
       <server>
      
       <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar"/>
      
       <mbean code="org.jboss.cache.TreeCache"
       name="jboss.cache:service=TreeCache">
       <depends>jboss:service=Naming</depends>
       <depends>jboss:service=TransactionManager</depends>
      
       <attribute name="JndiName">myJNDIName</attribute>
      
       <attribute name="TransactionManagerLookupClass">org.jboss.cache.JBossTransactionManagerLookup</attribute>
      
       <attribute name="IsolationLevel">SERIALIZABLE</attribute>
      
       <attribute name="CacheMode">LOCAL</attribute>
      
       <attribute name="UseReplQueue">false</attribute>
      
       <attribute name="ReplQueueInterval">60000</attribute>
      
       <attribute name="ReplQueueMaxElements">100</attribute>
      
       <attribute name="InitialStateRetrievalTimeout">5000</attribute>
      
       <attribute name="SyncReplTimeout">10000</attribute>
      
       <attribute name="LockAcquisitionTimeout">30000</attribute>
      
       <attribute name="EvictionPolicyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
      
      
       <attribute name="EvictionPolicyConfig">
       <config>
       <attribute name="wakeUpIntervalSeconds">30</attribute>
       <region name="/_default_">
       <attribute name="maxNodes">5000</attribute>
       <attribute name="timeToIdleSeconds">1000</attribute>
       </region>
       </config>
       </attribute>
      
       <attribute name="CacheLoaderClass">org.jboss.cache.loader.FileCacheLoader</attribute>
       <attribute name="CacheLoaderConfig">
       location=C:/tmp</attribute>
       <attribute name="CacheLoaderShared">false</attribute>
       <attribute name="CacheLoaderPreload">/</attribute>
       <attribute name="CacheLoaderFetchTransientState">false</attribute>
       <attribute name="CacheLoaderFetchPersistentState">true</attribute>
       </mbean>
       </server>
      

      The problem dissapear when I don't Preload any node with CacheLoader.

      Thanks all.