{"record":{"id":"c9c572435c335af5","repo":"quarkusio/quarkus","slug":"value-found-for-getnonjtadatasource-not-support","errorCode":null,"errorMessage":"Value found for #getNonJtaDataSource : not supported","messagePattern":"Value found for #getNonJtaDataSource : not supported","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/boot/QuarkusPersistenceUnitDescriptor.java","lineNumber":223,"sourceCode":"    private static void verifyIgnoredFields(final PersistenceUnitDescriptor toClone) {\n        // This one needs to be ignored:\n        // if ( toClone.getPersistenceUnitRootUrl() != null ) {\n        // throw new UnsupportedOperationException( \"Value found for\n        // #getPersistenceUnitRootUrl : not supported yet\" );\n        // }\n\n        // getMappingFiles() is ignored and replaced with an empty list,\n        // because we don't need Hibernate ORM to parse the mappings files:\n        // they are parsed at compile time and side-loaded during static init.\n\n        if (toClone.getJarFileUrls() != null && !toClone.getJarFileUrls().isEmpty()) {\n            throw new UnsupportedOperationException(\"Value found for #getJarFileUrls : not supported yet\");\n        }\n        if (toClone.getJtaDataSource() != null) {\n            throw new UnsupportedOperationException(\"Value found for #getJtaDataSource : not supported yet\");\n        }\n        if (toClone.getNonJtaDataSource() != null) {\n            throw new UnsupportedOperationException(\"Value found for #getNonJtaDataSource : not supported\");\n        }\n    }\n\n    @Override\n    public String toString() {\n        return \"QuarkusPersistenceUnitDescriptor{\" +\n                \"name='\" + name + '\\'' +\n                \", providerClassName='\" + providerClassName + '\\'' +\n                \", useQuotedIdentifiers=\" + useQuotedIdentifiers +\n                \", transactionType=\" + persistenceUnitTransactionType +\n                \", validationMode=\" + validationMode +\n                \", sharedCacheMode=\" + sharedCacheMode +\n                \", managedClassNames=\" + managedClassNames +\n                \", properties=\" + properties +\n                \", isReactive=\" + reactive +\n                '}';\n    }\n","sourceCodeStart":205,"sourceCodeEnd":241,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/boot/QuarkusPersistenceUnitDescriptor.java#L205-L241","documentation":"Same verification path as the JTA case: verifyIgnoredFields rejects non-JTA data sources too. Quarkus does not consume a DataSource from the persistence unit descriptor; all database wiring goes through Quarkus configuration. A non-null getNonJtaDataSource() throws this UnsupportedOperationException (note: message says 'not supported' without 'yet').","triggerScenarios":"A PersistenceUnitDescriptor/PersistenceUnitInfo passed into Quarkus boot has setNonJtaDataSource(...) called, e.g. from programmatic bootstrap code mimicking Java SE Hibernate setup.","commonSituations":"Reusing descriptors from Spring Boot/Java SE Hibernate setups where non-JTA DataSource is standard; helper libraries that populate nonJtaDataSource automatically; tests constructing PersistenceUnitInfo manually with a DataSource.","solutions":["Ensure getNonJtaDataSource() is null; configure the database via quarkus.datasource.* properties instead.","Delete setNonJtaDataSource calls from custom descriptor construction code.","Bind the persistence unit to a named Quarkus data source using quarkus.hibernate.orm.datasource if multiple data sources exist."],"exampleFix":"// before\ndescriptor.setNonJtaDataSource(ds);\n// after\ndescriptor.setNonJtaDataSource(null); // let Quarkus wire the datasource via config","handlingStrategy":"validation","validationCode":"if (desc.getNonJtaDataSource() != null) {\n    throw new IllegalStateException(\"Set quarkus.datasource.* config instead of non-JTA datasource on the descriptor\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    quarkusBoot();\n} catch (UnsupportedOperationException e) {\n    if (e.getMessage().contains(\"getNonJtaDataSource\")) {\n        log.error(\"Remove setNonJtaDataSource; let Quarkus wire the datasource\");\n    }\n}","preventionTips":["Do not call setNonJtaDataSource in Quarkus apps","Migrate Java SE style DataSource bootstrap to quarkus.datasource.* config","Audit library-provided PersistenceUnitInfo for DataSource fields"],"tags":["hibernate-orm","datasource","persistence-xml","unsupported"],"backgroundTag":"unsupported-persistence-unit-descriptor","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}