I have a Kotlin-based, Spring Boot, native application. When targeted at SpringBoot 3.0.0-M5 it compiles and runs (natively) without error. When targeted at SpringBoot 3.0.0-RC1 it gets the following runtime error
Failed to create query for method public abstract java.lang.Object org.springframework.data.repository.kotlin.CoroutineCrudRepository.count(kotlin.coroutines.Continuation); No property 'count' found for type 'Customer'
The application is located at https://github.com/ketronkowski/spring-kotlin-native
The data class and repository interface in the application are defined as
data class Customer(@Id val id: Int?, val name: String)
interface CustomerRepository : CoroutineCrudRepository<Customer, Int>
and have the following runtime hints class imported
class MyHints: RuntimeHintsRegistrar {
override fun registerHints(hints: RuntimeHints, classLoader: ClassLoader?) {
listOf(Customer::class.java, Array<Instant>::class.java, Array<ZonedDateTime>::class.java).forEach {
hints.reflection().registerType(it, *MemberCategory.values())
}
}
}
The gradle command to reproduce the problem is ./gradlew nativeRun. Line 4 of build.gradle.kts contains the spring boot version number target.
Comment From: jamesward
I was able to reproduce this with graalvm-ce-java17-22.2.0 but with graalvm-ce-java17-22.3.0 everything worked.
Comment From: ketronkowski
Ah, that is it. I confirmed that it is working with the new GraalVM release.
Sorry I did not try that new release of GraalVM first.
Comment From: scottfrederick
We have issue #32924 to try to make these GrallVm compatibility problems easier to diagnose.