Affects: \


I need to provide a suspend function as last parameter, my older project version using Spring Boot 2.4 was working properly.

Updating to Spring Boot 3.4, I get an error about null parameter when using xxx: suspend (id: String) -> java.nio.file.Path:

java.lang.NullPointerException: Parameter specified as non-null is null: method kotlin.jvm.JvmClassMappingKt.getJavaClass, parameter <this>
    at kotlin.jvm.JvmClassMappingKt.getJavaClass(JvmClassMapping.kt)
    at org.springframework.core.CoroutinesUtils.lambda$invokeSuspendingFunction$2(CoroutinesUtils.java:131)
    at kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsJvmKt$createCoroutineUnintercepted$$inlined$createCoroutineFromSuspendFunction$IntrinsicsKt__IntrinsicsJvmKt$4.invokeSuspend(IntrinsicsJvm.kt:270)

Converting the lambda function to interface and providing and object also failing:

java.lang.ClassCastException: class kotlin.reflect.jvm.internal.KTypeParameterImpl cannot be cast to class kotlin.reflect.KClass (kotlin.reflect.jvm.internal.KTypeParameterImpl and kotlin.reflect.KClass are in unnamed module of loader 'app')
    at org.springframework.core.CoroutinesUtils.lambda$invokeSuspendingFunction$2(CoroutinesUtils.java:130)
    Suppressed: The stacktrace has been enhanced by Reactor, refer to additional information below: 
Assembly trace from producer [reactor.core.publisher.MonoCreate] :
    reactor.core.publisher.Mono.create(Mono.java:203)
    kotlinx.coroutines.reactor.MonoKt.monoInternal(Mono.kt:87)

The database logic:

imagen

The corouter calling the database logic:

imagen

Comment From: userquin

upps, seems to be this one: https://github.com/spring-projects/spring-framework/issues/32552