Guava Cache - InvalidCacheLoadException on refresh
Guava Cache - InvalidCacheLoadException on refresh I have created a cache using CacheBuilder. I have used ExpireAfterWrite and RefreshAfterWrite. I have overrided cacheloader load and reload function. Practically in reload I am calling load by creating ListenableFutureTask and submitting it to ExecutorService. Below is stack trace I am getting - WARNING: Exception thrown during refresh [junit] com.google.common.cache.CacheLoader$InvalidCacheLoadException: CacheLoader returned null for key abc. [junit] at com.google.common.cache.LocalCache$Segment.getAndRecordStats(Unknown Source) [junit] at com.google.common.cache.LocalCache$Segment$1.run(Unknown Source) [junit] at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(Unknown Source) [junit] at com.google.common.util.concurrent.ImmediateFuture.addListener(Unknown Source) [junit] at com.google.common.cache.LocalCache$Segment.loadAsync(Unknown Source) [junit] ...
