Uploaded image for project: 'Commons JCS'
  1. Commons JCS
  2. JCS-194

NullPointerException in IndexedDiskCache.addToRecycleBin(...)

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • jcs-2.2
    • jcs-3.0
    • Indexed Disk Cache
    • None

    Description

      Note: this is not the same as https://issues.apache.org/jira/browse/JCS-158, which has already been fixed in the jcs-2.2 version used here.

      With the attached mini-project, we get a NullPointerException when the cache is loaded from disk:

      java.lang.NullPointerException
      at org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCache.addToRecycleBin(IndexedDiskCache.java:1145)
      at org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCache$LRUMapSizeLimited.processRemovedLRU(IndexedDiskCache.java:1738)
      at org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCache$LRUMapSizeLimited.processRemovedLRU(IndexedDiskCache.java:1637)
      at org.apache.commons.jcs.utils.struct.AbstractLRUMap.put(AbstractLRUMap.java:344)
      at org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCache$LRUMapSizeLimited.put(IndexedDiskCache.java:1685)
      at org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCache$LRUMapSizeLimited.put(IndexedDiskCache.java:1637)
      at org.apache.commons.jcs.utils.struct.AbstractLRUMap.putAll(AbstractLRUMap.java:187)
      at org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCache.loadKeys(IndexedDiskCache.java:339)
      at org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCache.initializeStoreFromPersistedData(IndexedDiskCache.java:285)
      at org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCache.initializeKeysAndData(IndexedDiskCache.java:250)
      at org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCache.<init>(IndexedDiskCache.java:183)
      at org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory.createCache(IndexedDiskCacheFactory.java:60)
      at org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory.createCache(IndexedDiskCacheFactory.java:33)
      at org.apache.commons.jcs.engine.control.CompositeCacheConfigurator.parseAuxiliary(CompositeCacheConfigurator.java:500)
      at org.apache.commons.jcs.engine.control.CompositeCacheConfigurator.parseRegion(CompositeCacheConfigurator.java:261)
      at org.apache.commons.jcs.engine.control.CompositeCacheConfigurator.parseRegion(CompositeCacheConfigurator.java:161)
      at org.apache.commons.jcs.engine.control.CompositeCacheConfigurator.parseRegions(CompositeCacheConfigurator.java:136)
      at org.apache.commons.jcs.engine.control.CompositeCacheManager.doConfigure(CompositeCacheManager.java:490)
      at org.apache.commons.jcs.engine.control.CompositeCacheManager.configure(CompositeCacheManager.java:441)
      at org.apache.commons.jcs.engine.control.CompositeCacheManager.configure(CompositeCacheManager.java:391)
      at org.apache.commons.jcs.engine.control.CompositeCacheManager.configure(CompositeCacheManager.java:373)
      at org.apache.commons.jcs.engine.control.CompositeCacheManager.configure(CompositeCacheManager.java:362)
      at org.apache.commons.jcs.engine.control.CompositeCacheManager.getInstance(CompositeCacheManager.java:190)
      at org.apache.commons.jcs.engine.control.CompositeCacheManager.getInstance(CompositeCacheManager.java:161)
      at org.apache.commons.jcs.JCS.getCacheManager(JCS.java:172)
      at org.apache.commons.jcs.JCS.getInstance(JCS.java:190)
      at ch.locatee.test.App.main(App.java:18)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:282)
      at java.lang.Thread.run(Thread.java:748)
      

       

      This does not happen if (in my mini project), all the objects are the same size. It seems like the last element inserted into the cache has to be much bigger.

       

       

      Attachments

        1. jcsbug.tgz
          3 kB
          Benedikt Köppel

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            tv Thomas Vandahl
            benedikt.koeppel@locatee.ch Benedikt Köppel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment