apache/cassandra · critical · RuntimeException
Cannot find configured row cache provider class ${DatabaseDe
Error message
Cannot find configured row cache provider class ${DatabaseDescriptor.getRowCacheClassName()} What it means
CacheService.initRowCache reflectively instantiates the configured row cache provider class (DatabaseDescriptor.getRowCacheClassName()). If instantiation fails for any reason (class missing, wrong type, constructor exception), it throws RuntimeException naming the configured class, swallowing the underlying cause.
Source
Thrown at src/java/org/apache/cassandra/service/CacheService.java:158
*/
private AutoSavingCache<RowCacheKey, IRowCacheEntry> initRowCache()
{
logger.info("Initializing row cache with capacity of {} MiBs", DatabaseDescriptor.getRowCacheSizeInMiB());
CacheProvider<RowCacheKey, IRowCacheEntry> cacheProvider;
String cacheProviderClassName = DatabaseDescriptor.getRowCacheSizeInMiB() > 0
? DatabaseDescriptor.getRowCacheClassName() : "org.apache.cassandra.cache.NopCacheProvider";
try
{
Class<? extends CacheProvider> cacheProviderClass =
FBUtilities.classForNameWithoutInitialization(cacheProviderClassName, "row cache provider", CacheProvider.class);
@SuppressWarnings("unchecked")
CacheProvider<RowCacheKey, IRowCacheEntry> typedCacheProvider = cacheProviderClass.newInstance();
cacheProvider = typedCacheProvider;
}
catch (Exception e)
{
throw new RuntimeException("Cannot find configured row cache provider class " + DatabaseDescriptor.getRowCacheClassName());
}
// cache object
ICache<RowCacheKey, IRowCacheEntry> rc = cacheProvider.create();
AutoSavingCache<RowCacheKey, IRowCacheEntry> rowCache = new AutoSavingCache<>(rc, CacheType.ROW_CACHE, new RowCacheSerializer());
int rowCacheKeysToSave = DatabaseDescriptor.getRowCacheKeysToSave();
rowCache.scheduleSaving(DatabaseDescriptor.getRowCacheSavePeriod(), rowCacheKeysToSave);
return rowCache;
}
private AutoSavingCache<CounterCacheKey, ClockAndCount> initCounterCache()
{
logger.info("Initializing counter cache with capacity of {} MiBs", DatabaseDescriptor.getCounterCacheSizeInMiB());
long capacity = DatabaseDescriptor.getCounterCacheSizeInMiB() * 1024 * 1024;View on GitHub (pinned to 88fd0f6a0e)
Solutions
- Correct row_cache_class_in in cassandra.yaml or remove it to use the default provider
- Ensure the provider class JAR is on the classpath of every node
- Verify the class implements CacheProvider<RowCacheKey, IRowCacheEntry> and has a public no-arg constructor
- Check server logs for the suppressed cause of the newInstance() failure
Example fix
// cassandra.yaml // before row_cache_class_in: org.example.MyCacheProvider // after row_cache_class_in: org.apache.cassandra.cache.OHCProvider
Defensive patterns
Strategy: try-catch
Validate before calling
String cls = DatabaseDescriptor.getRowCacheClassName();
try { Class.forName(cls); }
catch (ClassNotFoundException e) { throw new IllegalStateException("Row cache provider not on classpath: " + cls); } Try / catch
try { cacheService.initRowCache(); } catch (RuntimeException e) { if (e.getMessage().startsWith("Cannot find configured row cache provider")) { /* revert to default OHCProvider and rethrow with cause */ } throw e; } Prevention
- Validate custom cache provider class names at config-load time with Class.forName
- Ship custom provider JARs with the node image and verify on startup
- Avoid swallowing the reflectiveInstantiationException cause when wrapping
When it happens
Trigger: Node startup with row_cache_class_in (or equivalent) set to a class that is not on the classpath, does not implement CacheProvider<RowCacheKey, IRowCacheEntry>, or fails in its no-arg constructor/newInstance.
Common situations: Typos in the fully-qualified class name in cassandra.yaml; custom cache provider JAR not shipped with the node; provider compiled against an incompatible Cassandra version.
Related errors
- Failed to instantiate %s
- Unable to create instance of IAutoRepairTokenRangeSplitter
- %s has authorization enabled which requires %s to enable aut
- %s requires %s
- %s can't be used with %s
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/9fd45d0d539d1713.
Report an issue: GitHub.