Skip to content

Conversation

yrodiere
Copy link
Member

@yrodiere yrodiere commented Oct 6, 2025

Fixes a problem reported by @mzellho (thank you!) here: we abstain from creating entity proxies for abstract classes at build time, but in practice... there is no reason to not create them.

The problem seems to have been introduced by mistake here when adding conditions to prevent the creation of proxies for final classes (which, indeed, simply cannot be proxied). It was made more visible by #49591 which revamped the warnings (and maybe added some?) and removed some fallback behavior that could generate proxies at static init.

Copy link

quarkus-bot bot commented Oct 6, 2025

/cc @gsmet (hibernate-orm)

yrodiere referenced this pull request Oct 6, 2025
This replaces these logs:

2025-08-18 15:25:43,530 WARN  [io.qua.hib.orm.run.pro.ProxyDefinitions] (main) Could not generate an enhanced proxy for entity 'io.quarkus.hibernate.orm.applicationfieldaccess.PublicFieldAccessInheritanceTest$MyAbstractEntity' (class='io.quarkus.hibernate.orm.applicationfieldaccess.PublicFieldAccessInheritanceTest.MyAbstractEntity') as it's abstract. Your application might perform better if this class was non-abstract.
2025-08-18 15:25:44,075 WARN  [org.hib.met.int.EntityRepresentationStrategyPojoStandard] (JPA Startup Thread) HHH000305: Could not create proxy factory for:io.quarkus.hibernate.orm.applicationfieldaccess.PublicFieldAccessInheritanceTest$MyAbstractEntity: org.hibernate.HibernateException: Could not lookup a pre-generated proxy class definition for entity 'io.quarkus.hibernate.orm.applicationfieldaccess.PublicFieldAccessInheritanceTest$MyAbstractEntity'. Falling back to enforced eager mode for this entity!
	at io.quarkus.hibernate.orm.runtime.customized.QuarkusProxyFactory.postInstantiate(QuarkusProxyFactory.java:60)
	[...]

With these:

2025-08-18 16:03:26,754 WARN  [org.hib.met.int.EntityRepresentationStrategyPojoStandard] (JPA Startup Thread) HHH000305: Could not create proxy factory for:io.quarkus.hibernate.orm.applicationfieldaccess.PublicFieldAccessInheritanceTest$MyAbstractEntity: org.hibernate.HibernateException: Could not lookup a pre-generated proxy class definition for entity 'io.quarkus.hibernate.orm.applicationfieldaccess.PublicFieldAccessInheritanceTest$MyAbstractEntity' (class='io.quarkus.hibernate.orm.applicationfieldaccess.PublicFieldAccessInheritanceTest.MyAbstractEntity'): this class is abstract. Your application might perform better if this class was non-abstract.
	at io.quarkus.hibernate.orm.runtime.customized.QuarkusProxyFactory.postInstantiate(QuarkusProxyFactory.java:77)
	[...]

Also, this *might* prevent unnecessary warnings in some cases if
our implementation of ProxyDefinitions#needsProxyGeneration turns out to
have false positives, because in that case Hibernate ORM won't requrest
the proxy class on bootstrap, and thus we won't log anything.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

Copy link

quarkus-bot bot commented Oct 7, 2025

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit 05e0a71.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.


Flaky tests - Develocity

⚙️ JVM Tests - JDK 17

📦 test-framework/jacoco/runtime

io.quarkus.jacoco.runtime.DataFileWatchTest.waitForDataFileThatNeverAppears - History

  • Expecting value to be false but was true - org.opentest4j.AssertionFailedError
org.opentest4j.AssertionFailedError: 

Expecting value to be false but was true
	at io.quarkus.jacoco.runtime.DataFileWatchTest.waitForDataFileThatNeverAppears(DataFileWatchTest.java:208)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
  • Expecting value to be false but was true - org.opentest4j.AssertionFailedError
org.opentest4j.AssertionFailedError: 

Expecting value to be false but was true
	at io.quarkus.jacoco.runtime.DataFileWatchTest.waitForDataFileThatNeverAppears(DataFileWatchTest.java:208)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)

io.quarkus.jacoco.runtime.DataFileWatchTest.waitForPreexistingDataFileThatNeverChanges - History

  • Expecting value to be false but was true - org.opentest4j.AssertionFailedError
org.opentest4j.AssertionFailedError: 

Expecting value to be false but was true
	at io.quarkus.jacoco.runtime.DataFileWatchTest.waitForPreexistingDataFileThatNeverChanges(DataFileWatchTest.java:241)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)

⚙️ JVM Tests - JDK 25

📦 extensions/smallrye-graphql/deployment

io.quarkus.smallrye.graphql.deployment.CompletionStageTest.testSourcePost - History

  • 1 expectation failed. Expected status code <200> but was <500>. - java.lang.AssertionError
java.lang.AssertionError: 
1 expectation failed.
Expected status code <200> but was <500>.

	at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:483)
	at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:73)

@gsmet gsmet merged commit f72af1e into quarkusio:main Oct 8, 2025
52 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.29 - main milestone Oct 8, 2025
@gsmet gsmet modified the milestones: 3.29 - main, 3.28.3 Oct 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants