quarkusio/quarkus · error · ConfigurationException

Hibernate Search activated explicitly for persistence unit '

Error message

Hibernate Search activated explicitly for persistence unit '${puName}', but the Hibernate Search extension was disabled at build time. If you want Hibernate Search to be active for this persistence unit, you must set '${enabledPropertyKey}' to 'true' at build time. If you don't want Hibernate Search to be active for this persistence unit, you must leave '${activePropertyKey}' unset or set it to 'false'.

What it means

When the Hibernate Search Elasticsearch extension was disabled at build time (quarkus.hibernate-search-orm.enabled=false), the runtime checkNoExplicitActiveTrue verifies that no persistence unit explicitly sets active=true. If one does, it throws a ConfigurationException explaining the contradiction: an explicitly activated PU cannot work because the extension's runtime init was disabled at build time.

Source

Thrown at extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRecorder.java:104

    public HibernateOrmIntegrationRuntimeInitListener createRuntimeInitListener(
            HibernateSearchOrmElasticsearchMapperContext mapperContext,
            List<HibernateOrmIntegrationRuntimeInitListener> integrationRuntimeInitListeners) {
        HibernateSearchElasticsearchRuntimeConfigPersistenceUnit puConfig = runtimeConfig.getValue()
                .persistenceUnits()
                .get(mapperContext.persistenceUnitName);
        return new HibernateSearchIntegrationRuntimeInitListener(mapperContext, puConfig,
                integrationRuntimeInitListeners);
    }

    public void checkNoExplicitActiveTrue() {
        for (var entry : runtimeConfig.getValue().persistenceUnits().entrySet()) {
            var config = entry.getValue();
            if (config.active().orElse(false)) {
                var puName = entry.getKey();
                String enabledPropertyKey = HibernateSearchElasticsearchRuntimeConfig.extensionPropertyKey("enabled");
                String activePropertyKey = mapperPropertyKey(puName, "active");
                throw new ConfigurationException(
                        "Hibernate Search activated explicitly for persistence unit '" + puName
                                + "', but the Hibernate Search extension was disabled at build time."
                                + " If you want Hibernate Search to be active for this persistence unit, you must set '"
                                + enabledPropertyKey
                                + "' to 'true' at build time."
                                + " If you don't want Hibernate Search to be active for this persistence unit, you must leave '"
                                + activePropertyKey
                                + "' unset or set it to 'false'.",
                        Set.of(enabledPropertyKey, activePropertyKey));
            }
        }
    }

    public HibernateOrmIntegrationRuntimeInitListener createRuntimeInitInactiveListener() {
        return new HibernateSearchIntegrationRuntimeInitInactiveListener();
    }

    public Supplier<ActiveResult> checkActiveSupplier(String persistenceUnitName) {

View on GitHub (pinned to e1c734241f)

Solutions

  1. Remove quarkus.hibernate-search-orm."<puName>".active=true (leave active unset) if Hibernate Search is not needed for that PU
  2. Set quarkus.hibernate-search-orm.enabled=true at build time if Hibernate Search should be active for that persistence unit
  3. Check profile-specific overrides and environment variables (QUARKUS_HIBERNATE_SEARCH_ORM_...ACTIVE) that may set active=true only in some environments

Example fix

// before
quarkus.hibernate-search-orm.enabled=false
quarkus.hibernate-search-orm."default".active=true
// after (want Hibernate Search)
quarkus.hibernate-search-orm.enabled=true
// or (don't want it): remove the active=true line entirely
Defensive patterns

Strategy: validation

Validate before calling

// Build-time/runtime consistency check:
boolean buildTimeEnabled = Boolean.parseBoolean(config.getProperty("quarkus.hibernate-search-orm.enabled", "true"));
String puActive = config.getProperty("quarkus.hibernate-search-orm.\"default\".active");
if (!buildTimeEnabled && Boolean.parseBoolean(puActive)) {
  throw new IllegalStateException("Remove per-PU active=true or set quarkus.hibernate-search-orm.enabled=true");
}

Prevention

When it happens

Trigger: At runtime startup: runtime config contains quarkus.hibernate-search-orm."<pu>".active=true (config.active().orElse(false)) for some persistence unit while the extension was disabled at build time (quarkus.hibernate-search-orm.enabled=false), and disableHibernateSearchRuntimeInit calls checkNoExplicitActiveTrue.

Common situations: Disabling the extension at build time for faster tests/dev while leaving a stale per-PU active=true in application.properties or an env var/profile (e.g. %prod) that only appears at runtime; multi-PU apps where one PU's config was not cleaned up.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/2c0864cbb8c35d0b. Report an issue: GitHub.