microsoft / botbuilder-java

The Microsoft Bot Framework provides what you need to build and connect intelligent bots that interact naturally wherever your users are talking, from text/sms to Skype, Slack, Office 365 mail and other popular services.
http://botframework.com
MIT License
178 stars 115 forks source link

botbuilder-java does not work with springframework 6 (Spring Boot 3) #1521

Open martinqcz opened 7 months ago

martinqcz commented 7 months ago

Github issues should be used for bugs and feature requests. Use Stack Overflow for general "how-to" questions.

Version

What package version of the SDK are you using. 4.14.3

Describe the bug

Give a clear and concise description of what the bug is. When the bot-integration-spring jar is used together with springboot 3 (ie. spring 6.x), BotController is throwing NoSuchMethodError. That is because there HttpStatus enum in spring6 implements HttpStatusCode interface and ResponseEntity constructor requires parameter of type HttpStatusCode.

There is not needed any change in the source code, but the module needs to be compiled against spring6 classes in order to fix this issue.

To Reproduce

Steps to reproduce the behavior: Try to use the bot-integration-spring dependency with spring boot 3 and reach the BotController incomming endpoint (POST /api/messages)

Expected behavior

Give a clear and concise description of what you expected to happen.

No exception is thrown.

Screenshots

If applicable, add screenshots to help explain your problem.

Caused by: java.lang.NoSuchMethodError: 'void org.springframework.http.ResponseEntity.(org.springframework.http.HttpStatus)' at com.microsoft.bot.integration.spring.BotController.lambda$incoming$0(BotController.java:94) at java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:934) at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:911) at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510) at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2147) at kotlinx.coroutines.future.CompletableFutureCoroutine.onCompleted(Future.kt:57) at kotlinx.coroutines.AbstractCoroutine.onCompletionInternal(AbstractCoroutine.kt:93) at kotlinx.coroutines.JobSupport.tryFinalizeSimpleState(JobSupport.kt:294) at kotlinx.coroutines.JobSupport.tryMakeCompleting(JobSupport.kt:856) at kotlinx.coroutines.JobSupport.makeCompletingOnce$kotlinx_coroutines_core(JobSupport.kt:828) at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:100) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42) at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

Additional context

Add any other context about the problem here.