I've updated to 2.2.6 and last night I needed to run Kotlin coroutine functions inside of non coroutines because I see no other way of making EventListener work with coroutines. However I forgot that I updated from 2.2.5 and spent like 5h fixing bug unsuccessfully. I got the error that App cannot instantiate CoroutineContext or Dispatchers.Default (or any other dispatcher). I used both runBlocking and GlobalScope. When I downgraded back to 2.2.5 everything started working.
Sample log for Dispatcher fail:
Caused by: java.lang.NoClassDefFoundError: Could not initialize class kotlinx.coroutines.Dispatchers
```
Same goes for GlobalScope, log is a bit different (didn't save it) but bottom line it fails while trying to start new coroutine context.
I'm reporting mainly to save someone from fixing non-existing bugs in theirown code. It Googled this, asked on Gitter, no one knows (or cares since I don't get any replies). If this is a known issue I'm sorry but it's impossible to find it.
**Comment From: wilkinsona**
Thanks for taking the time to report the problem to us. Spring Boot itself doesn't include any Kotlin coroutine support so I suspect the cause of the problem is elsewhere. To help us to figure out where it is so that it can be addressed, can you please provide a small sample that reproduces the problem? You can do so by zipping up a project and attaching it to this issue or by pushing something to a separate repository.
**Comment From: haris-zynka**
Hi, since procject is too big and I can't use that to show you I tried making new one. And I can't even compile through IntelliJ some problems with gradle for Kotlin. I'll research more and let you know if I can get this to work. It might be IntellJ specific bug.
**Comment From: haris-zynka**
While trying to reproduce the bug I figured out that adding 1.3.71 plugin for kotlin jvm and spring fixes the issue. Before it was 1.3.61. Sorry but this was my mistake, it was not related to spring but rather kotlin plugin for spring.
kotlin("jvm") version "1.3.71" kotlin("plugin.spring") version "1.3.71" ```
Comment From: wilkinsona
Thanks for letting us know.