quarkusio/quarkus · error · UnsupportedOperationException

This isn't used for schema generation - see…

Error message

This isn't used for schema generation - see SessionFactoryObserverForSchemaExport instead

What it means

FastBootEntityManagerFactoryBuilder replaces Hibernate's normal EMF bootstrap in Quarkus; schema generation is not driven through the standard EntityManagerFactoryBuilder.generateSchema path. Instead Quarkus performs schema export via SessionFactoryObserverForSchemaExport, so calling generateSchema directly is an explicit UnsupportedOperationException.

Solutions

  1. Let Quarkus handle schema generation via configuration: quarkus.hibernate-orm.database.generation=(create|drop-and-create|update).
  2. Use Hibernate SchemaExport/SchemaUpdate tooling explicitly if you need manual control.
  3. Register schema work through a SessionFactoryObserverForSchemaExport-compatible mechanism instead of the JPA bootstrap API.

Example fix

// before
emfBuilder.generateSchema();
// after
// application.properties
quarkus.hibernate-orm.database.generation=drop-and-create
Defensive patterns

Strategy: try-catch

Validate before calling

// Guard custom tooling before invoking generateSchema
if (emfBuilder instanceof FastBootEntityManagerFactoryBuilder) {
    throw new IllegalStateException("Use quarkus.hibernate-orm.database.generation instead");
}

Try / catch

try {
    builder.generateSchema();
} catch (UnsupportedOperationException e) {
    log.warn("Schema generation handled by Quarkus config; set "
        + "quarkus.hibernate-orm.database.generation instead");
}

Prevention

When it happens

Trigger: Calling EMFBuilder.generateSchema() (or Persistence.generateSchema / javax.persistence.schema-generation via the raw EMF) on Quarkus's fast-boot EMF — e.g. custom tooling invoking JPA schema generation APIs at runtime.

Common situations: Porting standard Hibernate/JPA code that calls generateSchema into a Quarkus app; running a schema tool harness expecting the JPA bootstrap contract.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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

Appendix: source

Thrown at extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/boot/FastBootEntityManagerFactoryBuilder.java:108

            populate(puDescriptor.getName(), optionsBuilder, standardServiceRegistry);
            return new SessionFactoryImpl(metadata, optionsBuilder.buildOptions(),
                    metadata.getTypeConfiguration().getMetadataBuildingContext().getBootstrapContext());
        } catch (Exception e) {
            throw persistenceException("Unable to build Hibernate SessionFactory", e);
        } finally {
            closeImportScripts();
        }
    }

    @Override
    public void cancel() {
        // nothing?
    }

    @Override
    public void generateSchema() {
        try {
            throw new UnsupportedOperationException(
                    "This isn't used for schema generation - see SessionFactoryObserverForSchemaExport instead");
        } finally {
            closeImportScripts();
        }
    }

    protected final void closeImportScripts() {
        importScripts.close();
    }

    protected PersistenceException persistenceException(String message, Exception cause) {
        // Provide a comprehensible message if there is an issue with SSL support
        Throwable t = cause;
        while (t != null) {
            if (t instanceof NoSuchAlgorithmException) {
                message += "Unable to enable SSL support. You might be in the case where you used the `quarkus.ssl.native=false` configuration"
                        + " and SSL was not disabled automatically for your driver.";
                break;

View on GitHub (pinned to e1c734241f)