{"record":{"id":"d624b9cf5aa6ccc3","repo":"apache/cassandra","slug":"unable-to-create-an-instance-of-the-compression-se","errorCode":null,"errorMessage":"Unable to create an instance of the compression service provider for %s","messagePattern":"Unable to create an instance of the compression service provider for (.+?)","errorType":"exception","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/utils/FBUtilities.java","lineNumber":760,"sourceCode":"\n    public static AbstractCompressionProvider newCompressionProvider(String className) throws ConfigurationException\n    {\n        try\n        {\n            if (!className.contains(\".\"))\n                className = \"org.apache.cassandra.io.compress.\" + className;\n\n            Class<? extends AbstractCompressionProvider> compressionProviderClass =\n                FBUtilities.classForNameWithoutInitialization(className, \"compression service provider\", AbstractCompressionProvider.class);\n            return compressionProviderClass.getConstructor().newInstance();\n        }\n        catch (ConfigurationException e)\n        {\n            throw e;\n        }\n        catch (Exception e)\n        {\n            throw new ConfigurationException(String.format(\"Unable to create an instance of the compression service provider for %s\", className), e);\n        }\n    }\n\n    /**\n     * Loads and initializes a class.\n     *\n     * @return The Class for the given name.\n     * @param classname Fully qualified classname.\n     * @param readable Descriptive noun for the role the class plays.\n     * @throws ConfigurationException If the class cannot be found.\n     */\n    public static <T> Class<T> classForName(String classname, String readable) throws ConfigurationException\n    {\n        try\n        {\n            return (Class<T>)Class.forName(classname);\n        }\n        catch (ClassNotFoundException | NoClassDefFoundError e)","sourceCodeStart":742,"sourceCodeEnd":778,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/utils/FBUtilities.java#L742-L778","documentation":"newCompressionProvider reflectively constructs the configured AbstractCompressionProvider used for custom compression implementations. Any construction failure (other than an existing ConfigurationException) is wrapped in a ConfigurationException naming the class. This happens at startup when a custom compression provider is configured.","triggerScenarios":"compression provider configuration (e.g. class_name under compression_options) pointing to a class that is absent, not an AbstractCompressionProvider, missing the expected (Map) constructor, or whose constructor throws.","commonSituations":"Custom compression jar not shipped to the cluster; typo in class name; constructor throws on bad parameters; API change after Cassandra upgrade.","solutions":["Correct the provider class name in configuration","Add the provider jar to lib/ on all nodes and restart","Verify the class extends AbstractCompressionProvider with a public (Map) constructor","Check the chained cause for constructor failures"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"try { Class<?> c = Class.forName(className, false, getClass().getClassLoader());\n      if (!AbstractCompressionProvider.class.isAssignableFrom(c)) throw new IllegalArgumentException(\"not an AbstractCompressionProvider: \" + className); }\ncatch (ClassNotFoundException e) { throw new IllegalArgumentException(\"compression provider not found\", e); }","typeGuard":null,"tryCatchPattern":"try {\n    provider = FBUtilities.newCompressionProvider(className);\n} catch (ConfigurationException e) {\n    // fall back to default compressor or abort startup with cause\n    throw new IllegalStateException(\"compression provider init failed\", e);\n}","preventionTips":["Only configure class_name when using a non-default compression provider","Ship provider jars with the same version everywhere","Keep the (Map) constructor public and stable","Check schema compression_options for stale class names after upgrades"],"tags":["config","compression","reflection"],"backgroundTag":"class-not-found","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}