{"record":{"id":"d2b41f68a3aba4dc","repo":"quarkusio/quarkus","slug":"hibernate-orm-activated-explicitly-for-persistence","errorCode":null,"errorMessage":"Hibernate ORM activated explicitly for persistence unit '<puName>', but the Hibernate ORM extension was disabled at build time. If you want Hibernate ORM to be active for this persistence unit, you must set '<enabledPropertyKey>' to 'true' at build time. If you don't want Hibernate ORM to be active for this persistence unit, you must leave '<activePropertyKey>' unset or set it to 'false'.","messagePattern":"Hibernate ORM activated explicitly for persistence unit '<puName>', but the Hibernate ORM extension was disabled at build time\\. If you want Hibernate ORM to be active for this persistence unit, you must set '<enabledPropertyKey>' to 'true' at build time\\. If you don't want Hibernate ORM to be active for this persistence unit, you must leave '<activePropertyKey>' unset or set it to 'false'\\.","errorType":"exception","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/HibernateOrmDisabledRecorder.java","lineNumber":24,"sourceCode":"import io.quarkus.runtime.annotations.Recorder;\nimport io.quarkus.runtime.configuration.ConfigurationException;\n\n@Recorder\npublic class HibernateOrmDisabledRecorder {\n    private final RuntimeValue<HibernateOrmRuntimeConfig> runtimeConfig;\n\n    public HibernateOrmDisabledRecorder(final RuntimeValue<HibernateOrmRuntimeConfig> runtimeConfig) {\n        this.runtimeConfig = runtimeConfig;\n    }\n\n    public void checkNoExplicitActiveTrue() {\n        for (var entry : runtimeConfig.getValue().persistenceUnits().entrySet()) {\n            var config = entry.getValue();\n            if (config.active().isPresent() && config.active().get()) {\n                var puName = entry.getKey();\n                String enabledPropertyKey = HibernateOrmRuntimeConfig.extensionPropertyKey(\"enabled\");\n                String activePropertyKey = HibernateOrmRuntimeConfig.puPropertyKey(puName, \"active\");\n                throw new ConfigurationException(\n                        \"Hibernate ORM activated explicitly for persistence unit '\" + puName\n                                + \"', but the Hibernate ORM extension was disabled at build time.\"\n                                + \" If you want Hibernate ORM to be active for this persistence unit, you must set '\"\n                                + enabledPropertyKey\n                                + \"' to 'true' at build time.\"\n                                + \" If you don't want Hibernate ORM to be active for this persistence unit, you must leave '\"\n                                + activePropertyKey\n                                + \"' unset or set it to 'false'.\",\n                        Set.of(enabledPropertyKey, activePropertyKey));\n            }\n        }\n    }\n\n}\n","sourceCodeStart":6,"sourceCodeEnd":39,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/HibernateOrmDisabledRecorder.java#L6-L39","documentation":"When the Hibernate ORM extension is disabled at build time (quarkus.hibernate-orm.enabled=false), a persistence unit may still be explicitly marked active at runtime. HibernateOrmDisabledRecorder.checkNoExplicitActiveTrue detects this contradiction and throws ConfigurationException instructing the developer to either enable the extension at build time or leave active unset/false for that PU.","triggerScenarios":"checkNoExplicitActiveTrue (called from disableHibernateOrm) iterates persistenceUnits(); for any PU where active().isPresent() && active==true while the extension was disabled at build time, it throws, interpolating the resolved enabledPropertyKey (quarkus.hibernate-orm.enabled) and activePropertyKey (quarkus.hibernate-orm.\"<pu>\".active).","commonSituations":"Extension disabled via a profile (e.g. %%test) while another profile sets a PU active=true; re-enabling a PU without re-enabling the extension; config inheritance pulling active=true into builds where the extension is off.","solutions":["Set quarkus.hibernate-orm.enabled=true at build time if the PU should be active.","Remove quarkus.hibernate-orm.\"<pu>\".active=true (leave unset or false) if Hibernate should stay disabled.","Audit all profiles so the build-time enabled flag and per-PU active flags are consistent."],"exampleFix":"// before (application.properties)\nquarkus.hibernate-orm.enabled=false\nquarkus.hibernate-orm.\"audit\".active=true\n// after (option A)\nquarkus.hibernate-orm.enabled=true\nquarkus.hibernate-orm.\"audit\".active=true\n// after (option B)\nquarkus.hibernate-orm.enabled=false\n# leave quarkus.hibernate-orm.\"audit\".active unset or false","handlingStrategy":"validation","validationCode":"// via ConfigProvider\nvar cfg = ConfigProvider.getConfig();\nboolean enabled = cfg.getOptionalValue(\"quarkus.hibernate-orm.enabled\", Boolean.class).orElse(true);\nboolean puActive = cfg.getOptionalValue(\"quarkus.hibernate-orm.\\\"mypu\\\".active\", Boolean.class).orElse(false);\nif (!enabled && puActive) {\n    throw new IllegalStateException(\"Extension disabled at build time but PU marked active\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When disabling quarkus.hibernate-orm.enabled, remove all per-PU active=true overrides.","Check all config profiles (%%dev, %%test, prod) for conflicting flags.","Enable the extension at build time first, then mark individual PUs active."],"tags":["quarkus","hibernate-orm","configuration","build-time","disabled-extension"],"backgroundTag":"extension-disabled-active-conflict","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"}