-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hibernate tries to reflectively access Service methods not registered for reflection #45525
Comments
/cc @yrodiere |
This is used for the This feature is only used in one built-in service in Hibernate ORM ( We could enable reflection on all service classes, but that's a shame, since it'll only be useful for a single service class -- and custom services, if that's even usable in Quarkus (in native mode, I doubt it). What's more, there's a perfectly reasonable alternative that doesn't require reflection: implementing We unfortunately can't enable reflection only on service classes that do use I'd be tempted to just document @zakkak what's the timeline for your changes? If they can wait until Hibernate ORM 7.0, we could solve this much more cleanly (e.g. by providing a way to disable |
It's not clear, as per oracle/graal#5173 (comment)
What's the ETA for the ORM 7.0 release, and respectively for Quarkus transitioning to it?
It's not clear to me what you mean by this? Do you refer to enablung reflection for all service classes?
There is a discussion about Relaxing
Note that the classes are already reachable, so enabling reflection for |
Yes.
CR1 is being discussed, so I imagine a few weeks, 2 months tops. (this is not a promise, just a guess :) )
Okay, if you're fine with it, so am I :)
If we want to automate this and never think about it ever again, we'd have to look (through Jandex?) for all implementations of That's dozens of classes though, some of which may not even be reachable. If we want to be more precise, we'd have to somehow maintain a hardcoded list of all service classes are are not retrieved through reflections. Alternatively, we could leverage a GraalVM "feature" that registers the methods of a Service class for reflection only if it's reachable? I know it's doable as I've done something like it there: Lines 55 to 57 in 7c14d42
|
Describe the bug
Hibernate seems to be reflectively accessing methods from service classes that we don't register for reflection in native-mode.
The methods are accessed in https://github.com/hibernate/hibernate-orm/blob/9d52e3c9dfc49a9be804220c2382055d5901daa9/hibernate-core/src/main/java/org/hibernate/service/internal/AbstractServiceRegistryImpl.java#L293
Relates to #41995
Expected behavior
All reflective accesses should be registered.
Actual behavior
Reflective accesses are not registered resulting in warnings like the following when using
-H:ThrowMissingRegistrationErrors=
:How to Reproduce?
Output of
uname -a
orver
No response
Output of
java -version
21.0.5
Mandrel or GraalVM version (if different from Java)
Mandrel-24.1.1.0-Final
Quarkus version or git rev
No response
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
No response
The text was updated successfully, but these errors were encountered: