Skip to content
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

Generate proxy and register reflection for default sorting during AOT. #4747

Closed
wants to merge 4 commits into from

Conversation

christophstrobl
Copy link
Member

This PR makes sure to generate required cglib proxies during AOT phase so they are ready to use within a native image. Prior to this change default sorting raised an error as class generation is not allowed in a GraalVM native image.

Resolves: #4744

This commit makes sure to generate required cglib proxies during AOT phase so they are ready to use within a native image. Prior to this change default sorting raised an error as class generation is not allowed in a GraalVM native image.
@mp911de
Copy link
Member

mp911de commented Jul 22, 2024

Why do we even have the need for proxying the Query class? In all other places where we amend the query, we do this via proper methods. Did we consider (or why did we reject) something like query.sort(query.getSortObjectOr(() -> Document.parse(method.getAnnotatedSort())))?

@christophstrobl
Copy link
Member Author

Some years back (when GraalVM had not released) using proxies allowed to sneak in the default sorting without changing the original sort object. Without changing internals there's no other way to support the arrangement for previous versions. Going forward it makes sense to work on a solution that can do without it.

Removes the need for proxying.
mp911de pushed a commit that referenced this pull request Jul 23, 2024
This commit makes sure to generate required cglib proxies during AOT phase so they are ready to use within a native image. Prior to this change default sorting raised an error as class generation is not allowed in a GraalVM native image.

Original pull request: #4747
Closes #4744
mp911de pushed a commit that referenced this pull request Jul 23, 2024
This commit makes sure to generate required cglib proxies during AOT phase so they are ready to use within a native image. Prior to this change default sorting raised an error as class generation is not allowed in a GraalVM native image.

Original pull request: #4747
Closes #4744
mp911de pushed a commit that referenced this pull request Jul 23, 2024
This commit makes sure to generate required cglib proxies during AOT phase so they are ready to use within a native image. Prior to this change default sorting raised an error as class generation is not allowed in a GraalVM native image.

Original pull request: #4747
Closes #4744
mp911de added a commit that referenced this pull request Jul 23, 2024
Removes the need for proxying.

Original pull request: #4747
See #4744
@mp911de mp911de added the type: bug A general bug label Jul 23, 2024
@mp911de mp911de added this to the 4.2.9 (2023.1.9) milestone Jul 23, 2024
@mp911de
Copy link
Member

mp911de commented Jul 23, 2024

That's merged and backported now. For 4.4.x, we replaced query proxying with a proper query copy.

@mp911de mp911de closed this Jul 23, 2024
@mp911de mp911de deleted the issue/4744 branch July 23, 2024 07:08
@mp911de mp911de self-assigned this Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@Query with sort does not work in Native Image (Unexpected AOP exception)
2 participants