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

Missing native-image reflection hint for org.springframework.data.domain.Unpaged #3025

Closed
mmoayyed opened this issue Jan 15, 2024 · 7 comments
Assignees
Labels
theme: aot An issue related to Ahead-Of-Time processing type: bug A general bug

Comments

@mmoayyed
Copy link

Environment

  • Spring Data 3.2.2
  • Spring Boot 3.2.1
  • GraalVM 21.0.1+12.1 (build 21.0.1+12-jvmci-23.1-b19)

Problem

It appears that org.springframework.data.domain.Unpaged needs a few native-image hints:

Caused by: java.lang.ExceptionInInitializerError: null
	at org.springframework.data.web.config.SpringDataJacksonConfiguration.pageModule(SpringDataJacksonConfiguration.java:46)
	at org.springframework.data.web.config.SpringDataJacksonConfiguration__BeanDefinitions.lambda$getPageModuleInstanceSupplier$1(SpringDataJacksonConfiguration__BeanDefinitions.java:46)
	at org.springframework.util.function.ThrowingFunction.apply(ThrowingFunction.java:63)
	at org.springframework.util.function.ThrowingFunction.apply(ThrowingFunction.java:51)
	at org.springframework.beans.factory.aot.BeanInstanceSupplier.lambda$withGenerator$0(BeanInstanceSupplier.java:171)
	at org.springframework.util.function.ThrowingBiFunction.apply(ThrowingBiFunction.java:68)
	at org.springframework.util.function.ThrowingBiFunction.apply(ThrowingBiFunction.java:54)
	at org.springframework.beans.factory.aot.BeanInstanceSupplier.lambda$get$2(BeanInstanceSupplier.java:206)
	at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:58)
	at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:46)
	at org.springframework.beans.factory.aot.BeanInstanceSupplier.invokeBeanSupplier(BeanInstanceSupplier.java:218)
	at org.springframework.beans.factory.aot.BeanInstanceSupplier.get(BeanInstanceSupplier.java:206)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.obtainInstanceFromSupplier(DefaultListableBeanFactory.java:949)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1216)
	... 134 common frames omitted
Caused by: java.lang.IllegalArgumentException: Could not find class [org.springframework.data.domain.Unpaged]
	at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:355)
	at org.springframework.data.web.config.SpringDataJacksonConfiguration$PageModule.<clinit>(SpringDataJacksonConfiguration.java:57)
	... 148 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.springframework.data.domain.Unpaged
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.hub.ClassForNameSupport.forName(ClassForNameSupport.java:122)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.hub.ClassForNameSupport.forName(ClassForNameSupport.java:86)
	at [email protected]/java.lang.Class.forName(DynamicHub.java:1346)
	at [email protected]/java.lang.Class.forName(DynamicHub.java:1335)
	at org.springframework.util.ClassUtils.forName(ClassUtils.java:304)
	at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:345)
	... 149 common frames omitted

I suspect this is new in 3.2.2 as I think 3.2.1 did OK in this area.

Link to GitHub Actions job that showcases the failure.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 15, 2024
@christophstrobl christophstrobl self-assigned this Jan 15, 2024
@christophstrobl christophstrobl added the theme: aot An issue related to Ahead-Of-Time processing label Jan 15, 2024
@christophstrobl
Copy link
Member

@mmoayyed thanks for reporting - we'll take care of that

@christophstrobl christophstrobl added type: regression A regression from a previous release and removed status: waiting-for-triage An issue we've not yet triaged labels Jan 15, 2024
@christophstrobl
Copy link
Member

related to: #2987

@christophstrobl
Copy link
Member

@mmoayyed snapshot builds for 3.2.x-3025-SNAPSHOT should be available soon in case you wan't to give them a try.

@mmoayyed
Copy link
Author

Thank you. Will do.

@mmoayyed
Copy link
Author

3.2.x-3025-SNAPSHOT removed the issue. Thank you!

@christophstrobl
Copy link
Member

Thank you very much @mmoayyed for confirming the fix works!

@mp911de mp911de linked a pull request Jan 22, 2024 that will close this issue
@mp911de mp911de added this to the 3.2.3 (2023.1.3) milestone Jan 22, 2024
@mp911de mp911de added type: bug A general bug and removed type: regression A regression from a previous release labels Jan 22, 2024
mp911de pushed a commit that referenced this issue Jan 22, 2024
Remove unused imports.

See: #3025
Original pull request: #3026
mp911de pushed a commit that referenced this issue Jan 22, 2024
The PageModule is loading the Unpaged type via its name which requires additional reflection configuration for native images.

Closes: #3025
Original pull request: #3026
mp911de added a commit that referenced this issue Jan 22, 2024
Move hints into AOT package to align with other hints. Reduce visibility.

See: #3025
Original pull request: #3026
mp911de pushed a commit that referenced this issue Jan 22, 2024
Remove unused imports.

See: #3025
Original pull request: #3026
mp911de added a commit that referenced this issue Jan 22, 2024
Move hints into AOT package to align with other hints. Reduce visibility.

See: #3025
Original pull request: #3026
@mp911de mp911de changed the title Missing native-image reflection hint for org.springframework.data.domain.Unpaged? Missing native-image reflection hint for org.springframework.data.domain.Unpaged Jan 22, 2024
@karlohrabar
Copy link

what's the solution then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: aot An issue related to Ahead-Of-Time processing type: bug A general bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants