{"record":{"id":"2f3ca7cb713cdcfb","repo":"apache/seatunnel","slug":"unable-to-instantiate-the-database-history-class","errorCode":null,"errorMessage":"Unable to instantiate the database history class \" + config.getString(HistorizedRelationalDatabaseConnectorConfig.DATABASE_HISTORY)","messagePattern":"Unable to instantiate the database history class \" \\+ config\\.getString\\(HistorizedRelationalDatabaseConnectorConfig\\.DATABASE_HISTORY\\)","errorType":"exception","errorClass":"ConnectException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/io/debezium/relational/HistorizedRelationalDatabaseConnectorConfig.java","lineNumber":149,"sourceCode":"                tableIdMapper,\n                DEFAULT_SNAPSHOT_FETCH_SIZE,\n                columnFilterMode);\n        this.useCatalogBeforeSchema = useCatalogBeforeSchema;\n        this.logicalName = logicalName;\n        this.connectorClass = connectorClass;\n        this.multiPartitionMode = multiPartitionMode;\n    }\n\n    /** Returns a configured (but not yet started) instance of the database history. */\n    public DatabaseHistory getDatabaseHistory() {\n        Configuration config = getConfig();\n        DatabaseHistory databaseHistory =\n                config.getInstance(\n                        HistorizedRelationalDatabaseConnectorConfig.DATABASE_HISTORY,\n                        DatabaseHistory.class,\n                        () -> HistorizedRelationalDatabaseConnectorConfig.class.getClassLoader());\n        if (databaseHistory == null) {\n            throw new ConnectException(\n                    \"Unable to instantiate the database history class \"\n                            + config.getString(\n                                    HistorizedRelationalDatabaseConnectorConfig.DATABASE_HISTORY));\n        }\n\n        // Do not remove the prefix from the subset of config properties ...\n        Configuration dbHistoryConfig =\n                config.subset(DatabaseHistory.CONFIGURATION_FIELD_PREFIX_STRING, false)\n                        .edit()\n                        .withDefault(DatabaseHistory.NAME, getLogicalName() + \"-dbhistory\")\n                        .withDefault(\n                                KafkaDatabaseHistory.INTERNAL_CONNECTOR_CLASS,\n                                connectorClass.getName())\n                        .withDefault(KafkaDatabaseHistory.INTERNAL_CONNECTOR_ID, logicalName)\n                        .build();\n\n        DatabaseHistoryListener listener =\n                config.getBoolean(JMX_METRICS_ENABLED)","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/io/debezium/relational/HistorizedRelationalDatabaseConnectorConfig.java#L131-L167","documentation":"In the vendored Debezium code inside connector-cdc-base, getDatabaseHistory instantiates the class named by the 'database.history' config property via reflection. If config.getInstance returns null (class missing on the classpath, not a DatabaseHistory, or the property is unset with no default), a ConnectException is thrown saying the database history class could not be instantiated.","triggerScenarios":"Setting database.history (HistorizedRelationalDatabaseConnectorConfig.DATABASE_HISTORY) to a class name that is not on the classpath, is misspelled, or doesn't implement DatabaseHistory; omitting the property without a viable default.","commonSituations":"Typos or wrong package in the database.history value; shaded/uber-jar missing Debezium history classes due to dependency exclusion; copying a Flink CDC config into SeaTunnel with incompatible class names.","solutions":["Set database.history to a valid implementation available on the classpath, e.g. io.debezium.relational.history.MemoryDatabaseHistory (or FileDatabaseHistory with its storage path configured)","Check the class name for typos and confirm the containing jar is in the plugin dependencies","Inspect the root cause logged by config.getInstance for ClassNotFound/linkage errors","Align the property with the SeaTunnel CDC connector's supported history implementations"],"exampleFix":"// before\ndatabase.history = \"io.debezium.relational.history.StoreDatabaseHistory\"\n// after\ndatabase.history = \"io.debezium.relational.history.MemoryDatabaseHistory\"","handlingStrategy":"try-catch","validationCode":"String cls = config.getString(HistorizedRelationalDatabaseConnectorConfig.DATABASE_HISTORY);\ntry {\n    Class.forName(cls).asSubclass(DatabaseHistory.class);\n} catch (Throwable t) {\n    throw new IllegalStateException(\"database.history class unavailable: \" + cls, t);\n}","typeGuard":null,"tryCatchPattern":"try {\n    engineConfig.getDatabaseHistory();\n} catch (ConnectException e) {\n    LOG.error(\"Fix database.history property: {}\", e.getMessage());\n    throw e;\n}","preventionTips":["Use io.debezium.relational.history.MemoryDatabaseHistory unless file history is needed","Confirm the history class jar ships in the connector's dependency set","Avoid copying database.history class names from other CDC frameworks"],"tags":["cdc","debezium","reflection"],"backgroundTag":"class-not-found","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}