quarkusio/quarkus · error · PersistenceException

The FastbootHibernateProvider PersistenceProvider can not su

Error message

The FastbootHibernateProvider PersistenceProvider can not support runtime provided properties. Make sure you set all properties you need in the configuration resources before building the application.

What it means

Quarkus builds Hibernate configuration at build time; the FastBoot persistence provider resolves everything from the application's build-time configuration resources. If a caller passes a non-empty properties map to createEntityManagerFactory, Quarkus cannot honor those runtime-provided properties and throws PersistenceException.

Source

Thrown at extensions/hibernate-reactive/runtime/src/main/java/io/quarkus/hibernate/reactive/runtime/FastBootHibernateReactivePersistenceProvider.java:351

        for (ProvidedService<?> providedService : recordedState.getProvidedServices()) {
            if (!runtimeInitiatedServiceClasses.contains(providedService.serviceRole())) {
                serviceRegistryBuilder.addService(providedService);
            }
        }

        StandardServiceRegistryImpl standardServiceRegistry = serviceRegistryBuilder.buildNewServiceRegistry();

        standardServiceRegistry.getService(SchemaManagementTool.class)
                .setCustomDatabaseGenerationTarget(new ReactiveGenerationTarget(standardServiceRegistry));

        return standardServiceRegistry;
    }

    @SuppressWarnings("rawtypes")
    private void verifyProperties(Map properties) {
        if (properties != null && properties.size() != 0) {
            throw new PersistenceException(
                    "The FastbootHibernateProvider PersistenceProvider can not support runtime provided properties. "
                            + "Make sure you set all properties you need in the configuration resources before building the application.");
        }
    }

    private boolean isProvider(PersistenceUnitDescriptor persistenceUnit) {
        Map<Object, Object> props = Collections.emptyMap();
        String requestedProviderName = FastBootHibernatePersistenceProvider.extractRequestedProviderName(persistenceUnit,
                props);
        if (requestedProviderName == null) {
            // We'll always assume we are the best possible provider match unless the user
            // explicitly asks for a different one.
            return true;
        }
        return FastBootHibernateReactivePersistenceProvider.class.getName().equals(requestedProviderName)
                || IMPLEMENTATION_NAME.equals(requestedProviderName)
                || FastBootHibernatePersistenceProvider.class.getName().equals(requestedProviderName)
                || "org.hibernate.jpa.HibernatePersistenceProvider".equals(requestedProviderName);

View on GitHub (pinned to e1c734241f)

Solutions

  1. Move every property into application.properties under quarkus.hibernate-orm.* (and quarkus.datasource.*)
  2. Call the no-properties overload: Persistence.createEntityManagerFactory(name)
  3. Use Quarkus CDI injection of EntityManagerFactory instead of manual Persistence bootstrap
  4. Use environment variables/config profiles (-Dquarkus.profile) for per-environment values instead of runtime maps

Example fix

// before
Map<String, String> props = Map.of("hibernate.hbm2ddl.auto", "update");
EntityManagerFactory emf = Persistence.createEntityManagerFactory("default", props);

// after
EntityManagerFactory emf = Persistence.createEntityManagerFactory("default");
// application.properties:
// quarkus.hibernate-orm.schema-management.strategy=update
Defensive patterns

Strategy: validation

Validate before calling

if (properties != null && !properties.isEmpty()) {
    throw new IllegalArgumentException("Move Hibernate properties to application.properties");
}
EntityManagerFactory emf = Persistence.createEntityManagerFactory(puName);

Type guard

boolean safeToBootstrap(Map<String,?> props) { return props == null || props.isEmpty(); }

Try / catch

try {
    emf = Persistence.createEntityManagerFactory(puName, props);
} catch (PersistenceException e) {
    if (e.getMessage().contains("runtime provided properties")) { migratePropsToConfig(props); }
    throw e;
}

Prevention

When it happens

Trigger: Calling Persistence.createEntityManagerFactory(name, properties) (or EntityManagerFactoryBuilder via PersistenceProvider with properties) with a non-null, non-empty Map; detected by FastBootHibernateReactivePersistenceProvider.verifyProperties during bootstrap.

Common situations: Porting standard Hibernate/JPA bootstrap code that passes JDBC url, credentials or hibernate.* settings as a Map; frameworks/libraries that programmatically pass properties; moving from vanilla Hibernate (properties accepted) to Quarkus reactive (not allowed).

Related errors


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