{"record":{"id":"f08a6df96400f22a","repo":"quarkusio/quarkus","slug":"the-narayana-jta-extension-does-not-have-a-datasou","errorCode":null,"errorMessage":"The Narayana JTA extension does not have a datasource configured as the JDBC object store, so it defaults to the default datasource, but that datasource is not configured. To solve this, either configure the default datasource, referring to https://quarkus.io/guides/datasource for guidance, or configure the datasource to use in the Narayana JTA extension ","messagePattern":"The Narayana JTA extension does not have a datasource configured as the JDBC object store, so it defaults to the default datasource, but that datasource is not configured\\. To solve this, either configure the default datasource, referring to https://quarkus\\.io/guides/datasource for guidance, or configure the datasource to use in the Narayana JTA extension ","errorType":"exception","errorClass":"ConfigurationException","httpStatus":null,"severity":"critical","filePath":"extensions/narayana-jta/runtime/src/main/java/io/quarkus/narayana/jta/runtime/NarayanaJtaRecorder.java","lineNumber":158,"sourceCode":"    }\n\n    private void setJDBCObjectStore(String name, TransactionManagerConfiguration config) {\n        final ObjectStoreEnvironmentBean instance = BeanPopulator.getNamedInstance(ObjectStoreEnvironmentBean.class, name);\n        instance.setObjectStoreType(JDBCStore.class.getName());\n        instance.setJdbcDataSource(new QuarkusDataSource(config.objectStore().datasource()));\n        instance.setCreateTable(config.objectStore().createTable());\n        instance.setDropTable(config.objectStore().dropTable());\n        instance.setTablePrefix(config.objectStore().tablePrefix());\n    }\n\n    public void startRecoveryService(Map<String, String> configuredDataSourcesConfigKeys,\n            Set<String> dataSourcesWithTransactionIntegration, boolean xaResourcesPresent, ShutdownContext context) {\n\n        if (transactions.getValue().objectStore().type().equals(ObjectStoreType.JDBC)) {\n            final String objectStoreDataSourceName;\n            if (transactions.getValue().objectStore().datasource().isEmpty()) {\n                if (!DataSourceUtil.hasDefault(configuredDataSourcesConfigKeys.keySet())) {\n                    throw new ConfigurationException(\n                            \"The Narayana JTA extension does not have a datasource configured as the JDBC object store,\"\n                                    + \" so it defaults to the default datasource,\"\n                                    + \" but that datasource is not configured.\"\n                                    + \" To solve this, either configure the default datasource,\"\n                                    + \" referring to https://quarkus.io/guides/datasource for guidance,\"\n                                    + \" or configure the datasource to use in the Narayana JTA extension \"\n                                    + \" by setting property 'quarkus.transaction-manager.object-store.datasource' to the name of a configured datasource.\");\n                }\n                objectStoreDataSourceName = DataSourceUtil.DEFAULT_DATASOURCE_NAME;\n            } else {\n                objectStoreDataSourceName = transactions.getValue().objectStore().datasource().get();\n\n                if (!configuredDataSourcesConfigKeys.keySet().contains(objectStoreDataSourceName)) {\n                    throw new ConfigurationException(\n                            \"The Narayana JTA extension is configured to use the datasource '\"\n                                    + objectStoreDataSourceName\n                                    + \"' but that datasource is not configured.\"\n                                    + \" To solve this, either configure datasource \" + objectStoreDataSourceName","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/narayana-jta/runtime/src/main/java/io/quarkus/narayana/jta/runtime/NarayanaJtaRecorder.java#L140-L176","documentation":"At startup, when the transaction object store type is JDBC and no object-store datasource is named, Narayana falls back to the default datasource. If no default datasource is configured either, the recorder throws this ConfigurationException during startRecoveryService. Startup aborts; the app cannot begin transaction recovery.","triggerScenarios":"application.properties has quarkus.transaction-manager.object-store.type=jdbc, no quarkus.transaction-manager.object-store.datasource set, and no quarkus.datasource.* default datasource is configured (e.g. only named datasources exist, or no datasource at all).","commonSituations":"Enabling the JDBC object store in an app that uses only named datasources; forgetting quarkus.datasource.db-kind/credentials; enabling jdbc object store in tests without a test datasource; following old docs that assumed a default datasource always exists.","solutions":["Configure the default datasource (quarkus.datasource.db-kind, url, username, password)","Or explicitly set quarkus.transaction-manager.object-store.datasource=<name-of-a-configured-datasource>","Or change quarkus.transaction-manager.object-store.type away from jdbc (e.g. file-system) if a DB store is not required"],"exampleFix":"# before\nquarkus.transaction-manager.object-store.type=jdbc\n# after\nquarkus.datasource.db-kind=postgresql\nquarkus.datasource.username=quarkus\nquarkus.datasource.password=quarkus\nquarkus.datasource.jdbc.url=jdbc:postgresql://localhost:5432/quarkus\nquarkus.transaction-manager.object-store.type=jdbc","handlingStrategy":"validation","validationCode":"boolean ok = ConfigProvider.getConfig().getOptionalValue(\"quarkus.transaction-manager.object-store.datasource\", String.class).isPresent() || ConfigProvider.getConfig().getOptionalValue(\"quarkus.datasource.db-kind\", String.class).isPresent(); if (!ok) throw new IllegalStateException(\"JDBC object store needs a default or named datasource\");","typeGuard":null,"tryCatchPattern":"try { app.start(); } catch (ConfigurationException e) { if (e.getMessage().contains(\"Narayana JTA extension does not have a datasource\")) { /* configure default datasource */ } throw e; }","preventionTips":["When using object-store.type=jdbc, always configure a datasource in the same profile","Prefer an explicit named object-store datasource over relying on the default","Smoke-test startup per profile (dev/test/prod configs differ)"],"tags":["narayana-jta","configuration","datasource","object-store","startup"],"backgroundTag":"missing-datasource-configuration","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}