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

CoroutineUtils- Mono - ClassCastException coming when upgrading Springboot to 3.4.1 #34288

Open
rgcs2299 opened this issue Jan 20, 2025 · 1 comment
Assignees
Labels
status: waiting-for-feedback We need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged or decided on theme: kotlin An issue related to Kotlin support

Comments

@rgcs2299
Copy link

rgcs2299 commented Jan 20, 2025

Hi Team,

We have upgraded springboot version from 3.1.2 to 3.4.1 as per the latest stable version.
We are seeing class cast exceptions while fetching the objects from database via JPA with return type as Mono.
If we change the Mono to Flux it is working fine.

Exception Stack Trace:

Original Stack Trace:\n\t\tat org.springframework.core.CoroutinesUtils.lambda$invokeSuspendingFunction$4(CoroutinesUtils.java:135)\n","error.stack_trace":"java.lang.ClassCastException: class com.entity cannot be cast to class reactor.core.publisher.Mono (com.entity and reactor.core.publisher.Mono are in unnamed module of loader 'app')

This used to work fine before upgrading

suspend fun findByUpiReqId(upiRequestId: String): Mono<TransactionDetails>

If we change it to Flux it works fine now , after upgrading

suspend fun findByUpiReqId(upiRequestId: String): Flux<TransactionDetails>

Springboot reactive application in Kotlin (v1.8).

Can you please look into this !

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jan 20, 2025
@rgcs2299 rgcs2299 changed the title CoroutineUtils- ClassCastException comming when upgrading pringboot to 3.4.1 CoroutineUtils- Mono - ClassCastException comming when upgrading Springboot to 3.4.1 Jan 20, 2025
@rgcs2299 rgcs2299 changed the title CoroutineUtils- Mono - ClassCastException comming when upgrading Springboot to 3.4.1 CoroutineUtils- Mono - ClassCastException coming when upgrading Springboot to 3.4.1 Jan 20, 2025
@sdeleuze sdeleuze self-assigned this Jan 20, 2025
@sdeleuze sdeleuze added the theme: kotlin An issue related to Kotlin support label Jan 20, 2025
@sdeleuze
Copy link
Contributor

Please provide a self-contained reproducer as an attached archive or a link to a GitHub repository.

@sdeleuze sdeleuze added the status: waiting-for-feedback We need additional information before we can continue label Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-feedback We need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged or decided on theme: kotlin An issue related to Kotlin support
Projects
None yet
Development

No branches or pull requests

3 participants