question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`java.lang.NoClassDefFoundError: kotlinx/coroutines/test/TestDispatcher` when upgrading to 5.1.0

See original GitHub issue

Which version of Kotest are you using 5.1.0

Currently using 5.0.3 with the following dependencies:

    testImplementation("io.kotest:kotest-assertions-core:5.0.3")
    testImplementation("io.kotest:kotest-runner-junit5:5.0.3")
    testImplementation("io.kotest:kotest-property:5.0.3")

DescribeSpec tests work fine.

Upgrade to 5.1.0 and now all the tests are failing with:

java.lang.NoClassDefFoundError: kotlinx/coroutines/test/TestDispatcher
        at io.kotest.engine.test.interceptors.CoroutineDispatcherFactoryInterceptor.intercept(coroutineDispatcherFactoryInterceptor.kt:40)
        at io.kotest.engine.test.TestCaseExecutor$execute$2$1.invokeSuspend(TestCaseExecutor.kt:78)
        at io.kotest.engine.test.TestCaseExecutor$execute$2$1.invoke(TestCaseExecutor.kt)
        at io.kotest.engine.test.TestCaseExecutor$execute$2$1.invoke(TestCaseExecutor.kt)
        at io.kotest.engine.test.interceptors.SupervisorScopeInterceptor$intercept$2.invokeSuspend(SupervisorScopeInterceptor.kt:23)
        at io.kotest.engine.test.interceptors.SupervisorScopeInterceptor$intercept$2.invoke(SupervisorScopeInterceptor.kt)
        at io.kotest.engine.test.interceptors.SupervisorScopeInterceptor$intercept$2.invoke(SupervisorScopeInterceptor.kt)
        at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:89)
        at kotlinx.coroutines.SupervisorKt.supervisorScope(Supervisor.kt:61)
        at io.kotest.engine.test.interceptors.SupervisorScopeInterceptor.intercept(SupervisorScopeInterceptor.kt:22)
        at io.kotest.engine.test.TestCaseExecutor$execute$2$1.invokeSuspend(TestCaseExecutor.kt:78)
        at io.kotest.engine.test.TestCaseExecutor$execute$2$1.invoke(TestCaseExecutor.kt)
        at io.kotest.engine.test.TestCaseExecutor$execute$2$1.invoke(TestCaseExecutor.kt)
        at io.kotest.engine.test.interceptors.InvocationCountCheckInterceptor.intercept(InvocationCountCheckInterceptor.kt:29)
        at io.kotest.engine.test.TestCaseExecutor$execute$2$1.invokeSuspend(TestCaseExecutor.kt:78)
        at io.kotest.engine.test.TestCaseExecutor$execute$2$1.invoke(TestCaseExecutor.kt)
        at io.kotest.engine.test.TestCaseExecutor$execute$2$1.invoke(TestCaseExecutor.kt)
        at io.kotest.engine.test.interceptors.TestFinishedInterceptor.intercept(TestFinishedInterceptor.kt:21)
        at io.kotest.engine.test.TestCaseExecutor$execute$2$1.invokeSuspend(TestCaseExecutor.kt:78)
        at io.kotest.engine.test.TestCaseExecutor$execute$2$1.invoke(TestCaseExecutor.kt)
        at io.kotest.engine.test.TestCaseExecutor$execute$2$1.invoke(TestCaseExecutor.kt)
        at io.kotest.engine.test.TestCaseExecutor.execute(TestCaseExecutor.kt:79)
        at io.kotest.engine.spec.runners.SingleInstanceSpecRunner.runTest(SingleInstanceSpecRunner.kt:112)
        at io.kotest.engine.spec.runners.SingleInstanceSpecRunner.access$runTest(SingleInstanceSpecRunner.kt:31)
        at io.kotest.engine.spec.runners.SingleInstanceSpecRunner$execute$interceptAndRun$2$2.invokeSuspend(SingleInstanceSpecRunner.kt:51)
        at io.kotest.engine.spec.runners.SingleInstanceSpecRunner$execute$interceptAndRun$2$2.invoke(SingleInstanceSpecRunner.kt)
        at io.kotest.engine.spec.runners.SingleInstanceSpecRunner$execute$interceptAndRun$2$2.invoke(SingleInstanceSpecRunner.kt)
        at io.kotest.engine.test.scheduler.SequentialTestScheduler$schedule$3$1$1.invokeSuspend(SequentialTestScheduler.kt:20)
        at (Coroutine boundary.()
        at io.kotest.engine.test.TestCaseExecutor$execute$2$1.invokeSuspend(TestCaseExecutor.kt:78)
        at io.kotest.engine.test.TestCaseExecutor$execute$2$1.invokeSuspend(TestCaseExecutor.kt:78)
        at io.kotest.engine.test.interceptors.TestFinishedInterceptor.intercept(TestFinishedInterceptor.kt:21)
        at io.kotest.engine.test.TestCaseExecutor$execute$2$1.invokeSuspend(TestCaseExecutor.kt:78)
        at io.kotest.engine.spec.runners.SingleInstanceSpecRunner.runTest(SingleInstanceSpecRunner.kt:112)
        at io.kotest.engine.spec.runners.SingleInstanceSpecRunner$execute$interceptAndRun$2$2.invokeSuspend(SingleInstanceSpecRunner.kt:51)
        at io.kotest.engine.test.scheduler.SequentialTestScheduler$schedule$3$1$1.invokeSuspend(SequentialTestScheduler.kt:20)
        at io.kotest.engine.test.scheduler.SequentialTestScheduler.schedule(SequentialTestScheduler.kt:18)
        at io.kotest.engine.spec.runners.SingleInstanceSpecRunner.execute_gIAlu_s$interceptAndRun(SingleInstanceSpecRunner.kt:49)
        at io.kotest.engine.spec.runners.SingleInstanceSpecRunner$execute$3.invokeSuspend(SingleInstanceSpecRunner.kt:58)
        at io.kotest.engine.spec.runners.SingleInstanceSpecRunner.execute-gIAlu-s(SingleInstanceSpecRunner.kt:56)
        at io.kotest.engine.spec.JvmSpecExecutorDelegate.execute(createSpecExecutorDelegate.kt:71)
        at io.kotest.engine.spec.SpecExecutor$specInterceptors$initial$1.invokeSuspend(SpecExecutor.kt:106)
        at io.kotest.engine.spec.interceptor.ConfigurationInContextInterceptor$intercept$2.invokeSuspend(ConfigurationInContextInterceptor.kt:23)
        at io.kotest.engine.spec.interceptor.ConfigurationInContextInterceptor.intercept-0E7RQCE(ConfigurationInContextInterceptor.kt:22)
        at io.kotest.engine.spec.SpecExecutor$specInterceptors$3$1.invokeSuspend(SpecExecutor.kt:115)
        at io.kotest.engine.spec.interceptor.SpecExtensionInterceptor$intercept$2.invokeSuspend(SpecExtensionInterceptor.kt:21)
        at io.kotest.engine.spec.SpecExtensions$intercept$initial$1.invokeSuspend(SpecExtensions.kt:143)
        at io.kotest.engine.spec.SpecExtensions.intercept(SpecExtensions.kt:154)
        at io.kotest.engine.spec.interceptor.SpecExtensionInterceptor.intercept-0E7RQCE(SpecExtensionInterceptor.kt:21)
        at io.kotest.engine.spec.SpecExecutor$specInterceptors$3$1.invokeSuspend(SpecExecutor.kt:115)
        at io.kotest.engine.spec.interceptor.ProjectContextInterceptor$intercept$2.invokeSuspend(ProjectContextInterceptor.kt:21)
        at io.kotest.engine.spec.interceptor.ProjectContextInterceptor.intercept-0E7RQCE(ProjectContextInterceptor.kt:20)
        at io.kotest.engine.spec.SpecExecutor$specInterceptors$3$1.invokeSuspend(SpecExecutor.kt:115)
        at io.kotest.engine.spec.SpecExecutor.specInterceptors-gIAlu-s(SpecExecutor.kt:116)
        at io.kotest.engine.spec.SpecExecutor$referenceInterceptors$innerExecute$1.invokeSuspend(SpecExecutor.kt:84)
        at io.kotest.engine.spec.interceptor.FinalizeSpecInterceptor.intercept-0E7RQCE(FinalizeSpecInterceptor.kt:19)
        at io.kotest.engine.spec.SpecExecutor$referenceInterceptors$3$1.invokeSuspend(SpecExecutor.kt:89)
        at io.kotest.engine.spec.interceptor.PrepareSpecInterceptor.intercept-0E7RQCE(PrepareSpecInterceptor.kt:20)
        at io.kotest.engine.spec.SpecExecutor$referenceInterceptors$3$1.invokeSuspend(SpecExecutor.kt:89)
        at io.kotest.engine.spec.interceptor.ApplyExtensionsInterceptor.intercept-0E7RQCE(ApplyExtensionsInterceptor.kt:35)
        at io.kotest.engine.spec.SpecExecutor$referenceInterceptors$3$1.invokeSuspend(SpecExecutor.kt:89)
        at io.kotest.engine.spec.interceptor.SpecFinishedInterceptor.intercept-0E7RQCE(SpecFinishedInterceptor.kt:18)
        at io.kotest.engine.spec.SpecExecutor$referenceInterceptors$3$1.invokeSuspend(SpecExecutor.kt:89)
        at io.kotest.engine.spec.interceptor.SpecStartedInterceptor.intercept-0E7RQCE(SpecStartedInterceptor.kt:19)
        at io.kotest.engine.spec.SpecExecutor$referenceInterceptors$3$1.invokeSuspend(SpecExecutor.kt:89)
        at io.kotest.engine.spec.interceptor.SpecRefExtensionInterceptor$intercept$inner$1.invokeSuspend(SpecRefExtensionInterceptor.kt:24)
        at io.kotest.engine.spec.interceptor.SpecRefExtensionInterceptor.intercept-0E7RQCE(SpecRefExtensionInterceptor.kt:27)
        at io.kotest.engine.spec.SpecExecutor$referenceInterceptors$3$1.invokeSuspend(SpecExecutor.kt:89)
        at io.kotest.engine.spec.interceptor.RequiresTagSpecInterceptor.intercept-0E7RQCE(RequiresTagSpecInterceptor.kt:35)
        at io.kotest.engine.spec.SpecExecutor$referenceInterceptors$3$1.invokeSuspend(SpecExecutor.kt:89)
        at io.kotest.engine.spec.interceptor.TagsExcludedSpecInterceptor.intercept-0E7RQCE(TagsExcludedDiscoveryExtension.kt:32)
        at io.kotest.engine.spec.SpecExecutor$referenceInterceptors$3$1.invokeSuspend(SpecExecutor.kt:89)
        at io.kotest.engine.spec.interceptor.SystemPropertySpecFilterInterceptor.intercept-0E7RQCE(SystemPropertySpecFilterInterceptor.kt:49)
        at io.kotest.engine.spec.SpecExecutor$referenceInterceptors$3$1.invokeSuspend(SpecExecutor.kt:89)
        at io.kotest.engine.spec.interceptor.SpecFilterInterceptor.intercept-0E7RQCE(SpecFilterInterceptor.kt:37)
        at io.kotest.engine.spec.SpecExecutor$referenceInterceptors$3$1.invokeSuspend(SpecExecutor.kt:89)
        at io.kotest.engine.spec.interceptor.IgnoredSpecInterceptor.intercept-0E7RQCE(IgnoredSpecInterceptor.kt:42)
        at io.kotest.engine.spec.SpecExecutor$referenceInterceptors$3$1.invokeSuspend(SpecExecutor.kt:89)
        at io.kotest.engine.spec.interceptor.EnabledIfSpecInterceptor.intercept-0E7RQCE(EnabledIfSpecInterceptor.kt:40)
        at io.kotest.engine.spec.SpecExecutor$referenceInterceptors$3$1.invokeSuspend(SpecExecutor.kt:89)
        at io.kotest.engine.ConcurrentTestSuiteScheduler$schedule$8$1$2.invokeSuspend(ConcurrentTestSuiteScheduler.kt:71)

        Caused by:
        java.lang.NoClassDefFoundError: kotlinx/coroutines/test/TestDispatcher
            at io.kotest.engine.test.interceptors.CoroutineDispatcherFactoryInterceptor.intercept(coroutineDispatcherFactoryInterceptor.kt:40)
            at io.kotest.engine.test.TestCaseExecutor$execute$2$1.invokeSuspend(TestCaseExecutor.kt:78)
            at io.kotest.engine.test.TestCaseExecutor$execute$2$1.invoke(TestCaseExecutor.kt)
            at io.kotest.engine.test.TestCaseExecutor$execute$2$1.invoke(TestCaseExecutor.kt)
            at io.kotest.engine.test.interceptors.SupervisorScopeInterceptor$intercept$2.invokeSuspend(SupervisorScopeInterceptor.kt:23)
            at io.kotest.engine.test.interceptors.SupervisorScopeInterceptor$intercept$2.invoke(SupervisorScopeInterceptor.kt)
            at io.kotest.engine.test.interceptors.SupervisorScopeInterceptor$intercept$2.invoke(SupervisorScopeInterceptor.kt)
            at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:89)
            at kotlinx.coroutines.SupervisorKt.supervisorScope(Supervisor.kt:61)
            at io.kotest.engine.test.interceptors.SupervisorScopeInterceptor.intercept(SupervisorScopeInterceptor.kt:22)
            at io.kotest.engine.test.TestCaseExecutor$execute$2$1.invokeSuspend(TestCaseExecutor.kt:78)
            at io.kotest.engine.test.TestCaseExecutor$execute$2$1.invoke(TestCaseExecutor.kt)
            at io.kotest.engine.test.TestCaseExecutor$execute$2$1.invoke(TestCaseExecutor.kt)
            at io.kotest.engine.test.interceptors.InvocationCountCheckInterceptor.intercept(InvocationCountCheckInterceptor.kt:29)
            at io.kotest.engine.test.TestCaseExecutor$execute$2$1.invokeSuspend(TestCaseExecutor.kt:78)
            at io.kotest.engine.test.TestCaseExecutor$execute$2$1.invoke(TestCaseExecutor.kt)
            at io.kotest.engine.test.TestCaseExecutor$execute$2$1.invoke(TestCaseExecutor.kt)
            at io.kotest.engine.test.interceptors.TestFinishedInterceptor.intercept(TestFinishedInterceptor.kt:21)
            at io.kotest.engine.test.TestCaseExecutor$execute$2$1.invokeSuspend(TestCaseExecutor.kt:78)
            at io.kotest.engine.test.TestCaseExecutor$execute$2$1.invoke(TestCaseExecutor.kt)
            at io.kotest.engine.test.TestCaseExecutor$execute$2$1.invoke(TestCaseExecutor.kt)
            at io.kotest.engine.test.TestCaseExecutor.execute(TestCaseExecutor.kt:79)
            at io.kotest.engine.spec.runners.SingleInstanceSpecRunner.runTest(SingleInstanceSpecRunner.kt:112)
            at io.kotest.engine.spec.runners.SingleInstanceSpecRunner.access$runTest(SingleInstanceSpecRunner.kt:31)
            at io.kotest.engine.spec.runners.SingleInstanceSpecRunner$execute$interceptAndRun$2$2.invokeSuspend(SingleInstanceSpecRunner.kt:51)
            at io.kotest.engine.spec.runners.SingleInstanceSpecRunner$execute$interceptAndRun$2$2.invoke(SingleInstanceSpecRunner.kt)
            at io.kotest.engine.spec.runners.SingleInstanceSpecRunner$execute$interceptAndRun$2$2.invoke(SingleInstanceSpecRunner.kt)
            at io.kotest.engine.test.scheduler.SequentialTestScheduler$schedule$3$1$1.invokeSuspend(SequentialTestScheduler.kt:20)
            at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
            at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
            at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:274)
            at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
            at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
            at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
            at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
            at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
            at io.kotest.common.RunBlockingKt.runBlocking(runBlocking.kt:3)
            at io.kotest.engine.TestEngineLauncher.launch(TestEngineLauncher.kt:194)
            at io.kotest.runner.junit.platform.KotestJunitPlatformTestEngine.execute(KotestJunitPlatformTestEngine.kt:80)
            at io.kotest.runner.junit.platform.KotestJunitPlatformTestEngine.execute(KotestJunitPlatformTestEngine.kt:44)
            at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:107)
            at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)
            at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)
            at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
            at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
            at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
            at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
            at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
            at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53)
            at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:99)
            at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$000(JUnitPlatformTestClassProcessor.java:79)
            at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.stop(JUnitPlatformTestClassProcessor.java:75)
            at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61)
            at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
            at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.base/java.lang.reflect.Method.invoke(Method.java:568)
            at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
            at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
            at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
            at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
            at jdk.proxy1/jdk.proxy1.$Proxy2.stop(Unknown Source)
            at org.gradle.api.internal.tasks.testing.worker.TestWorker$3.run(TestWorker.java:193)
            at org.gradle.api.internal.tasks.testing.worker.TestWorker.executeAndMaintainThreadName(TestWorker.java:129)
            at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:100)
            at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:60)
            at org.gradle.process.internal.worker.child.ActionExecutionWorker.execute(ActionExecutionWorker.java:56)
            at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:133)
            at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:71)
            at worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:69)
            at worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:74)

            Caused by:
            java.lang.ClassNotFoundException: kotlinx.coroutines.test.TestDispatcher
                at io.kotest.engine.test.interceptors.CoroutineDispatcherFactoryInterceptor.intercept(coroutineDispatcherFactoryInterceptor.kt:40)
                ... 70 more

Manually adding org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.0 as a test dependency resolves the issue.

    testImplementation("io.kotest:kotest-assertions-core:5.1.0")
    testImplementation("io.kotest:kotest-runner-junit5:5.1.0")
    testImplementation("io.kotest:kotest-property:5.1.0")
    testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.0")

I would expect Kotest to either bring in this dependency for us or update the documentation to say it’s required out of the box. We have no ProjectConfig for these unit tests.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

31reactions
frozenicecommented, Jan 19, 2022

TL;DR: add kotlin-coroutines.version=1.6.0 to gradle.properties when using Spring Boot.


@busches @lenguyenthanh are you using Spring? Because that was the culprit here.

Spring’s io.spring.dependency-management Gradle Plugin pre-defines versions for several dependencies (according to the respective Spring Boot version’s BOM, see here for Spring Boot 2.6.2). These are versions of those dependencies Spring Boot (in that version) is built / tested against. That’s why you can simply write implementation("org.springframework.boot:spring-boot-starter-webflux") without a version, btw. You can see easily what versions are defined by executing the dependencyManagement Gradle task in your Spring Boot project (I’m using Spring Boot 2.6.2):

...
    org.jetbrains.kotlinx:kotlinx-coroutines-test 1.5.2
...

By requiring kotest 5.1.0 as a dependency I get version 1.5.2 of org.jetbrains.kotlinx:kotlinx-coroutines-test. You can check what version you get by expanding External Libraries in IntelliJ (at the bottom of the file tree on the left) or by executing the Gradle task dependencies (which gives more information in a tree format):

...
+--- io.kotest:kotest-runner-junit5:5.1.0
|    \--- io.kotest:kotest-runner-junit5-jvm:5.1.0
|         +--- io.kotest:kotest-framework-api:5.1.0
|         |    \--- io.kotest:kotest-framework-api-jvm:5.1.0
|         |         +--- org.jetbrains.kotlinx:kotlinx-coroutines-test:{require 1.6.0; reject _} -> 1.5.2
|         |         |    +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2 (*)
|         |         |    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.30 -> 1.6.10 (*)
|         |         +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.10 (*)
...

You can see that io.kotest:kotest-framework-api-jvm:5.1.0 requests version 1.6.0 of org.jetbrains.kotlinx:kotlinx-coroutines-test (verify on mvnrepository), but the actual version that is finally used is 1.5.2 (as defined by Spring).

kotlinx/coroutines/test/TestDispatcher ist not included in version 1.5.2 (as defined by Spring Boot), but is included in version 1.6.0 (as required by kotest) of org.jetbrains.kotlinx:kotlinx-coroutines-test.

Now, you could manually require the 1.6.0 version of org.jetbrains.kotlinx:kotlinx-coroutines-test, but that leads to (potential) problems, because many other coroutine dependencies will still be version 1.5.2 - which can break things.

Fortunately Spring Boot allows overriding those pre-defined versions. Refer to the Version Properties appendix in Spring Boot’s documentation (see here for Spring Boot 2.6.2).

So just add the following to your project’s gradle.properties:

kotlin-coroutines.version=1.6.0

Now all kotlinx-coroutines dependencies will use version 1.6.0, including org.jetbrains.kotlinx:kotlinx-coroutines-test.

7reactions
buschescommented, Jan 19, 2022

@frozenice thanks! I did it via extra["kotlin-coroutines.version"] = "1.6.0" in build.gradle.kts but same thing in the end.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I solve "java.lang.NoClassDefFoundError"?
My team recently saw this error after upgrading an rpm that supplied a service. The rpm and the software inside of it had...
Read more >
Cannot run any jobs at all - NoClassDefFoundError (Page 1 ...
I can not run any jobs in Talend. No matter what job I setup, when I go to run I get: Exception in...
Read more >
Error Starting Jboss-5.1.0.GA-java.lang.ClassNo...
Hi, I am getting these errors while starting jboss- 2012-03-16 11:50:15124 INFO [org.jboss.web.tomcat.service.deployers.
Read more >
Error: 'java.lang.NoClassDefFoundError...' during install
You are installing Lotus Enterprise Integrator (LEI) and after entering the VNC password, the screen flashes the following error: "java.io.
Read more >
javax/xml/bind/JAXBException" exception. - TIBCO Support
After upgrade of TIBCO Spotfire, updating/restarting the Node Manager from Admin console results in "java.lang.NoClassDefFoundError: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found