Skip to content

Ahead Of Time support for Querydsl #4244

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

Closed
susimsek opened this issue Dec 2, 2022 · 1 comment
Closed

Ahead Of Time support for Querydsl #4244

susimsek opened this issue Dec 2, 2022 · 1 comment
Assignees
Labels
theme: aot An issue related to Ahead-Of-Time processing type: bug A general bug

Comments

@susimsek
Copy link

susimsek commented Dec 2, 2022

hi spring graphql teams.i am using spring graphql with querydsl. When I compile the project as native, I am getting an error as follows. Can you provide aot support for Querydsl?
image

The reproduce example codes are shared via my Github, check here.

Spring boot version: 3.0.0

Kotlin version: 1.7.21

Java version: 17

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 2, 2022
@mp911de mp911de transferred this issue from spring-projects/spring-graphql Dec 2, 2022
@mp911de mp911de added type: bug A general bug theme: aot An issue related to Ahead-Of-Time processing and removed status: waiting-for-triage An issue we've not yet triaged labels Dec 2, 2022
@christophstrobl christophstrobl self-assigned this Dec 2, 2022
@christophstrobl
Copy link
Member

Thanks for reporting and the reproducer - we'll take care of it!
Please do not upload images of error messages but use code fences instead. Thank you.

Caused by: java.lang.IllegalStateException: No suitable constructor found on class org.springframework.data.mongodb.repository.support.ReactiveQuerydsIMongoPredicateExecutor to match the given arguments: org.springframework.data.mongodb.repository.support.MappingMongoEntityInformation,org.springframework.data.mongodb.core.ReactiveMongoTemplate.
Make sure you implement a constructor taking these
at org.springframework.data.repository.core.support.RepositoryFactorySupport.lambda$instantiateClass$6(RepositoryFactorySupport.java:572)~[spring-graphql-samples:3.0.0]
at [email protected]/java.util.Optional.orElseThrow(Optional.java:403)~[spring-graphql-samples:na]
at org.springframework.data.repository.core.support.RepositoryFactorySupport.instantiateClass(RepositoryFactorySupport.java:572)
~[spring-graphql-samples:3.0.0]
at org.springframework.data.mongodb.repository.support.ReactiveMongoRepositoryFactory.getRepositoryFragments(ReactiveMongoRepositoryFactory.java:106)
~[na:na]
at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepositoryComposition(RepositoryFactorySupport.java:428)~[spring-graphql-samples:3.0.0]
at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:293)
~[spring-graphql-samples:3.0.0]
at org. springframework.data.repository.core.support.RepositoryFactoryBeanSupport.lambda$afterPropertiesSet$5(RepositoryFactoryBeanSupport.java:279)~[spring-graphql-samples:3.0.0]
at org.springframework.data.util.Lazy.getNullable(Lazy.java:229)~[na:na]
at org.springframework.data.util.Lazy.get(Lazy.java:113)
~[na:na]
at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:285)~[spring-graphal-samples:3.0.0]
at org.springframework.data.mongodb.repository.support.ReactiveMongoRepositoryFactoryBean.afterPropertiesSet(ReactiveMongoRepositoryFactoryBean.java:116)~[spring-graphql-samples:4.0.0]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1797)~[spring-graphal-samples:6.0.2]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1747)~[spring-graphal-samples:6.0.2]
50 common frames omitted

@mp911de mp911de added this to the 4.0.2 (2022.0.2) milestone Jan 23, 2023
mp911de added a commit that referenced this issue Jan 23, 2023
Move QuerydslPredicateExecutor hints to RepositoryRuntimeHints.

See #4244
Original pull request: #4245
mp911de pushed a commit that referenced this issue Jan 23, 2023
This commit adds missing reflection configuration for Querydsl integration. We now also make sure to call the queryMixing getter instead of reading the field via reflection.

Closes #4244
Original pull request: #4245
mp911de added a commit that referenced this issue Jan 23, 2023
Move QuerydslPredicateExecutor hints to RepositoryRuntimeHints.

See #4244
Original pull request: #4245
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.

4 participants