{"record":{"id":"f33b8cc09fd2e148","repo":"quarkusio/quarkus","slug":"no-vert-x-instance-has-been-registered-in-arc","errorCode":null,"errorMessage":"No Vert.x instance has been registered in ArC ?","messagePattern":"No Vert\\.x instance has been registered in ArC \\?","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/hibernate-reactive/runtime/src/main/java/io/quarkus/hibernate/reactive/runtime/FastBootHibernateReactivePersistenceProvider.java","lineNumber":396,"sourceCode":"        }\n\n        Pool pool;\n        try {\n            InjectableInstance<Pool> poolHandle = ReactiveDataSourceUtil.dataSourceInstance(datasourceName);\n            if (!poolHandle.isResolvable()) {\n                throw new IllegalStateException(\"No pool has been defined for persistence unit \" + persistenceUnitName);\n            }\n            // ClientProxy.unwrap is necessary to trigger exceptions on inactive datasources\n            pool = ClientProxy.unwrap(poolHandle.get());\n        } catch (RuntimeException e) {\n            throw PersistenceUnitUtil.unableToFindDataSource(persistenceUnitName, datasourceName, e);\n        }\n\n        serviceRegistry.addInitiator(new QuarkusReactiveConnectionPoolInitiator(pool));\n\n        InstanceHandle<Vertx> vertxHandle = Arc.container().instance(Vertx.class);\n        if (!vertxHandle.isAvailable()) {\n            throw new IllegalStateException(\"No Vert.x instance has been registered in ArC ?\");\n        }\n        serviceRegistry.addInitiator(new VertxInstanceInitiator(vertxHandle.get()));\n    }\n\n    private static void injectRuntimeConfiguration(HibernateOrmRuntimeConfigPersistenceUnit persistenceUnitConfig,\n            Builder runtimeSettingsBuilder) {\n\n        HibernateOrmRuntimeConfigPersistenceUnit.HibernateGenerationStrategy generationStrategy = persistenceUnitConfig\n                .schemaManagement().strategy();\n        if (!HibernateOrmRuntimeConfigPersistenceUnit.HibernateGenerationStrategy.NONE.equals(generationStrategy)\n                && persistenceUnitConfig.database().startOffline()) {\n            throw new PersistenceException(\n                    \"When using offline mode with `quarkus.hibernate-orm.database.start-offline=true`, the schema management strategy `quarkus.hibernate-orm.schema-management.strategy` must be unset or set to `none`\");\n        }\n\n        // Pass extraPhysicalTableTypes configuration\n        Optional<String> extraPhysicalTableTypes = persistenceUnitConfig.schemaManagement().extraPhysicalTableTypes();\n        if (extraPhysicalTableTypes.isPresent()) {","sourceCodeStart":378,"sourceCodeEnd":414,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/hibernate-reactive/runtime/src/main/java/io/quarkus/hibernate/reactive/runtime/FastBootHibernateReactivePersistenceProvider.java#L378-L414","documentation":"During bootstrap of a Hibernate Reactive persistence unit, Quarkus rewires Hibernate's service registry and injects the application's managed Vert.x instance (looked up as a CDI bean in ArC). This error means no Vert.x bean was available in the CDI container when the reactive connection pool initiator was being registered. It indicates the Quarkus runtime wiring that normally provides Vert.x did not run or was bypassed.","triggerScenarios":"Calling FastBootHibernateReactivePersistenceProvider.rewireMetadataAndExtractServiceRegistry/registerVertxAndPool in an environment where Arc.container() has no Vertx instance registered — e.g. bootstrapping Hibernate Reactive persistence units outside the normal Quarkus startup (manual EntityManagerFactory creation, tests that skip the Quarkus Vertx producer, custom bootstrap code).","commonSituations":"Programmatic EntityManagerFactory creation in tests or tools; running Hibernate Reactive code without the quarkus-vertx extension on the classpath or without Quarkus Arc container started; classloader isolation in dev-mode restarting before Vert.x bean is re-registered.","solutions":["Ensure the quarkus-vertx extension (a transitive dependency of quarkus-hibernate-reactive) is present and the application is started via Quarkus so the Vert.x bean is registered in ArC","Do not create the EntityManagerFactory manually; let Quarkus build it via the persistence provider (inject EntityManagerFactory or use @Inject)","Check for classloading issues in tests (e.g. QuarkusTest vs plain JUnit) — use @QuarkusTest so the container and Vert.x bean exist","If embedding Quarkus, verify Arc.container() is initialized before persistence bootstrap"],"exampleFix":"// before\nEntityManagerFactory emf = Persistence.createEntityManagerFactory(\"pu\"); // bypasses Quarkus wiring\n// after\n@QuarkusTest\nclass MyTest {\n  @Inject EntityManagerFactory emf; // Quarkus wires Vert.x + pool correctly\n}","handlingStrategy":"validation","validationCode":"import io.quarkus.arc.Arc;\nimport io.quarkus.arc.InstanceHandle;\nimport io.vertx.core.Vertx;\n\nInstanceHandle<Vertx> h = Arc.container().instance(Vertx.class);\nif (!h.isAvailable()) {\n    throw new IllegalStateException(\"Bootstrap without Quarkus container; Vert.x bean unavailable\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    emf = bootstrapPersistenceUnit();\n} catch (IllegalStateException e) {\n    if (e.getMessage().contains(\"No Vert.x instance\")) {\n        throw new IllegalStateException(\"Run inside Quarkus (@QuarkusTest / quarkus:dev); manual PU creation is unsupported for Hibernate Reactive\", e);\n    }\n    throw e;\n}","preventionTips":["Always bootstrap Hibernate Reactive via Quarkus (inject the EMF, use @QuarkusTest in tests)","Keep quarkus-vertx on the classpath (it is transitive via quarkus-hibernate-reactive but explicit checks help)","Avoid Persistence.createEntityManagerFactory for reactive PUs"],"tags":["quarkus","hibernate-reactive","cdi","vertx","bootstrap"],"backgroundTag":"missing-cdi-bean","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"}