quarkus: Quarkus 3.4.x - Build failure: java.lang.Object is used as an embeddable but does not have an @Embeddable annotation

Discussed in https://github.com/quarkusio/quarkus/discussions/36368

<div type='discussions-op-text'>

Originally posted by jimbogithub October 10, 2023 I’m seeing this new build error with Quarkus 3.4.2 (was fine for 3.3.3 and prior):

java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
	[error]: Build step io.quarkus.hibernate.orm.deployment.HibernateOrmProcessor#defineJpaEntities threw an exception: java.lang.IllegalStateException: io.quarkus.builder.BuildException: Build failure: java.lang.Object is used as an embeddable but does not have an @Embeddable annotation.
	at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:867)
	at io.quarkus.builder.BuildContext.run(BuildContext.java:282)
	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
	at java.base/java.lang.Thread.run(Thread.java:833)
	at org.jboss.threads.JBossThread.run(JBossThread.java:501)
Caused by: io.quarkus.builder.BuildException: Build failure: java.lang.Object is used as an embeddable but does not have an @Embeddable annotation.
	at io.quarkus.hibernate.orm.deployment.JpaJandexScavenger.collectEmbeddedType(JpaJandexScavenger.java:513)
	at io.quarkus.hibernate.orm.deployment.JpaJandexScavenger.enlistEmbeddedsAndElementCollections(JpaJandexScavenger.java:323)
	at io.quarkus.hibernate.orm.deployment.JpaJandexScavenger.discoverModelAndRegisterForReflection(JpaJandexScavenger.java:95)
	at io.quarkus.hibernate.orm.deployment.HibernateOrmProcessor.defineJpaEntities(HibernateOrmProcessor.java:409)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:858)

I can’t find any explicit use of Object as an embedded type in our JPA models. Is it possible that https://github.com/quarkusio/quarkus/issues/35598 / https://github.com/quarkusio/quarkus/pull/35822 has caused this?</div>

Looks like the new @Embeddable checks are being polluted by abstract super-structure and causing false positives.

About this issue

  • Original URL
  • State: closed
  • Created 9 months ago
  • Comments: 16 (13 by maintainers)

Most upvoted comments

Ignoring bride methods does fix the problem, thanks @Ladicek ! I wouldn’t have thought of this.

Created https://github.com/quarkusio/quarkus/pull/36713

Understood. On my side, I was thinking I would add an implementation of the CDI Language Model (which is in fact independent of CDI) as a separate module of Jandex, and it would also include the annotation transformation layer. That should be good enough for a vast majority of users in Quarkus, but Jandex would still be available. In case anyone is interested, the API is in https://github.com/jakartaee/cdi/tree/main/lang-model/src/main/java/jakarta/enterprise/lang/model