Skip to content

Support for dynamically generated entity classes in Hibernate ORM extension #49017

@Naros

Description

@Naros

Describe the bug

See the reproducer - https://github.com/Naros/quarkus-mrp-build-time-entity

When running mvn install

[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:3.23.4:build (default) on project quarkus-mrp-build-time-entity-integration-tests: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR]         [error]: Build step io.quarkus.hibernate.orm.deployment.HibernateOrmProcessor#jpaEntitiesIndexer threw an exception: java.lang.IllegalStateException: Failed to index: io.github.naros.OutboxEvent
[ERROR]         at io.quarkus.deployment.index.IndexingUtil.indexClass(IndexingUtil.java:170)
[ERROR]         at io.quarkus.deployment.index.IndexingUtil.indexClass(IndexingUtil.java:148)
[ERROR]         at io.quarkus.hibernate.orm.deployment.HibernateOrmProcessor.jpaEntitiesIndexer(HibernateOrmProcessor.java:380)
[ERROR]         at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:733)
[ERROR]         at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:856)
[ERROR]         at io.quarkus.builder.BuildContext.run(BuildContext.java:255)
[ERROR]         at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2651)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2630)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor.runThreadBody(EnhancedQueueExecutor.java:1622)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1589)
[ERROR]         at java.base/java.lang.Thread.run(Thread.java:1583)
[ERROR]         at org.jboss.threads.JBossThread.run(JBossThread.java:501)
[ERROR] Caused by: java.lang.IllegalArgumentException: stream cannot be null
[ERROR]         at org.jboss.jandex.Indexer.indexWithSummary(Indexer.java:2584)
[ERROR]         at io.quarkus.deployment.index.IndexingUtil.indexClass(IndexingUtil.java:165)
[ERROR]         ... 12 more
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :quarkus-mrp-build-time-entity-integration-tests

Expected behavior

The dynamic entity is indexed, available, and can be used by Hibernate.

Actual behavior

The entity cannot be found and Quarkus throws an obscure error.

How to Reproduce?

See reproducer in the bug details.

Output of uname -a or ver

Linux fedora 6.14.5-300.fc42.x86_64 #1 SMP PREEMPT_DYNAMIC Fri May 2 14:16:46 UTC 2025 x86_64 GNU/Linux

Output of java -version

java version "21.0.6" 2025-01-21 LTS Java(TM) SE Runtime Environment (build 21.0.6+8-LTS-188) Java HotSpot(TM) 64-Bit Server VM (build 21.0.6+8-LTS-188, mixed mode, sharing)

Quarkus version or git rev

3.23.4

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.9.8 (36645f6c9b5079805ea5009217e36f2cffd34256)

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions