java.lang.NoClassDefFoundError: kotlin/Result
    at kotlinx.coroutines.debug.AgentPremain.<clinit>(AgentPremain.kt:24)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
    at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)
Exception in thread "main" FATAL ERROR in native method: processing of -javaagent failed

Comment From: wilkinsona

It looks like you’re trying to start the application with -javaagent and Kotlin seems to be involved too. Neither of these is done by default so it would appear that the problem is caused by some changes that you have made or by the way in which you are starting the JVM. Unfortunately, I can’t help any more than that as you have only shared a partial stack trace and haven’t described what you’re trying to do.

If you believe there’s a problem with Spring Boot, please describe in some more detail any changes you have made and the steps you have followed to trigger the problem. We can then re-open this issue and take another look.

Comment From: huifer

"D:\Program Files\RedHat\java-1.8.0-openjdk-1.8.0.252-2\bin\java.exe" -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:52604,suspend=y,server=n -javaagent:D:/gradle_home/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-core-jvm/1.4.3/1051e11eb789ed1df93412bebe0f06e9d29160e4/kotlinx-coroutines-core-jvm-1.4.3.jar -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -javaagent:D:\jeb_tool\apps\IDEA-U\ch-0\212.4746.92\plugins\Groovy\lib\agent\gragent.jar -javaagent:D:\jeb_tool\apps\IDEA-U\ch-0\212.4746.92\plugins\java\lib\rt\debugger-agent.jar=file:/C:/Users/admin/AppData/Local/Temp/capture5.props -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true -Dfile.encoding=UTF-8 -classpath "D:\Program Files\RedHat\java-1.8.0-openjdk-1.8.0.252-2\jre\lib\charsets.jar;D:\Program Files\RedHat\java-1.8.0-openjdk-1.8.0.252-2\jre\lib\ext\access-bridge-64.jar;D:\Program Files\RedHat\java-1.8.0-openjdk-1.8.0.252-2\jre\lib\ext\cldrdata.jar;D:\Program Files\RedHat\java-1.8.0-openjdk-1.8.0.252-2\jre\lib\ext\dnsns.jar;D:\Program Files\RedHat\java-1.8.0-openjdk-1.8.0.252-2\jre\lib\ext\jaccess.jar;D:\Program Files\RedHat\java-1.8.0-openjdk-1.8.0.252-2\jre\lib\ext\localedata.jar;D:\Program Files\RedHat\java-1.8.0-openjdk-1.8.0.252-2\jre\lib\ext\nashorn.jar;D:\Program Files\RedHat\java-1.8.0-openjdk-1.8.0.252-2\jre\lib\ext\sunec.jar;D:\Program Files\RedHat\java-1.8.0-openjdk-1.8.0.252-2\jre\lib\ext\sunjce_provider.jar;D:\Program Files\RedHat\java-1.8.0-openjdk-1.8.0.252-2\jre\lib\ext\sunmscapi.jar;D:\Program Files\RedHat\java-1.8.0-openjdk-1.8.0.252-2\jre\lib\ext\sunpkcs11.jar;D:\Program Files\RedHat\java-1.8.0-openjdk-1.8.0.252-2\jre\lib\ext\zipfs.jar;D:\Program Files\RedHat\java-1.8.0-openjdk-1.8.0.252-2\jre\lib\jce.jar;D:\Program Files\RedHat\java-1.8.0-openjdk-1.8.0.252-2\jre\lib\jsse.jar;D:\Program Files\RedHat\java-1.8.0-openjdk-1.8.0.252-2\jre\lib\management-agent.jar;D:\Program Files\RedHat\java-1.8.0-openjdk-1.8.0.252-2\jre\lib\resources.jar;D:\Program Files\RedHat\java-1.8.0-openjdk-1.8.0.252-2\jre\lib\rt.jar;D:\desktop\git_repo\spring-ebk\spring-cloud\spring-boot\spring-boot-tests\spring-boot-smoke-tests\spring-boot-smoke-test-property-validation\build\classes\java\main;D:\desktop\git_repo\spring-ebk\spring-cloud\spring-boot\spring-boot-tests\spring-boot-smoke-tests\spring-boot-smoke-test-property-validation\build\resources\main;D:\desktop\git_repo\spring-ebk\spring-cloud\spring-boot\spring-boot-project\spring-boot-autoconfigure\build\classes\java\main;D:\desktop\git_repo\spring-ebk\spring-cloud\spring-boot\spring-boot-project\spring-boot-autoconfigure\build\classes\kotlin\main;D:\desktop\git_repo\spring-ebk\spring-cloud\spring-boot\spring-boot-project\spring-boot-autoconfigure\build\resources\main;D:\desktop\git_repo\spring-ebk\spring-cloud\spring-boot\spring-boot-project\spring-boot\build\classes\java\main;D:\desktop\git_repo\spring-ebk\spring-cloud\spring-boot\spring-boot-project\spring-boot\build\classes\kotlin\main;D:\desktop\git_repo\spring-ebk\spring-cloud\spring-boot\spring-boot-project\spring-boot\build\resources\main;D:\gradle_home\caches\modules-2\files-2.1\jakarta.annotation\jakarta.annotation-api\1.3.5\59eb84ee0d616332ff44aba065f3888cf002cd2d\jakarta.annotation-api-1.3.5.jar;D:\gradle_home\caches\modules-2\files-2.1\org.springframework\spring-core\5.3.7\4aad1b62bd347a806fe693c9d67b376a3ad8151c\spring-core-5.3.7.jar;D:\gradle_home\caches\modules-2\files-2.1\org.yaml\snakeyaml\1.27\359d62567480b07a679dc643f82fc926b100eed5\snakeyaml-1.27.jar;D:\gradle_home\caches\modules-2\files-2.1\org.springframework\spring-context\5.3.7\330b3957efdcdebe3550b8e2c5d45a4c25496626\spring-context-5.3.7.jar;D:\gradle_home\caches\modules-2\files-2.1\org.apache.logging.log4j\log4j-to-slf4j\2.13.3\966f6fd1af4959d6b12bfa880121d4a2b164f857\log4j-to-slf4j-2.13.3.jar;D:\gradle_home\caches\modules-2\files-2.1\ch.qos.logback\logback-classic\1.2.3\7c4f3c474fb2c041d8028740440937705ebb473a\logback-classic-1.2.3.jar;D:\gradle_home\caches\modules-2\files-2.1\org.slf4j\jul-to-slf4j\1.7.30\d58bebff8cbf70ff52b59208586095f467656c30\jul-to-slf4j-1.7.30.jar;D:\gradle_home\caches\modules-2\files-2.1\org.springframework\spring-jcl\5.3.7\ccd8bde38bad689737295fa220e1c70680676d72\spring-jcl-5.3.7.jar;D:\gradle_home\caches\modules-2\files-2.1\org.springframework\spring-aop\5.3.7\b86edd2455f8c4399068c999beb9ea2a9e7f2047\spring-aop-5.3.7.jar;D:\gradle_home\caches\modules-2\files-2.1\org.springframework\spring-beans\5.3.7\8b1eacd7aaa12f7d173a2f0836d28bd0c1b098fe\spring-beans-5.3.7.jar;D:\gradle_home\caches\modules-2\files-2.1\org.springframework\spring-expression\5.3.7\13351fce0a604957cd6a41478ebb54a953a0245e\spring-expression-5.3.7.jar;D:\gradle_home\caches\modules-2\files-2.1\org.slf4j\slf4j-api\1.7.30\b5a4b6d16ab13e34a88fae84c35cd5d68cac922c\slf4j-api-1.7.30.jar;D:\gradle_home\caches\modules-2\files-2.1\org.apache.logging.log4j\log4j-api\2.13.3\ec1508160b93d274b1add34419b897bae84c6ca9\log4j-api-2.13.3.jar;D:\gradle_home\caches\modules-2\files-2.1\ch.qos.logback\logback-core\1.2.3\864344400c3d4d92dfeb0a305dc87d953677c03c\logback-core-1.2.3.jar;D:\jeb_tool\apps\IDEA-U\ch-0\212.4746.92\lib\idea_rt.jar" smoketest.propertyvalidation.SamplePropertyValidationApplication

Comment From: wilkinsona

-javaagent:D:/gradle_home/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-core-jvm/1.4.3/1051e11eb789ed1df93412bebe0f06e9d29160e4/kotlinx-coroutines-core-jvm-1.4.3.jar appears to be the cause of the problem. As I said above, Spring Boot does not apply that configuration by default. You need to correct the arguments that are being passed to the JVM or, if they are out of your control, report the problem to the maintainers of the tool that is launching the JVM for you.

Comment From: huifer

-javaagent:D:/gradle_home/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-core-jvm/1.4.3/1051e11eb789ed1df93412bebe0f06e9d29160e4/kotlinx-coroutines-core-jvm-1.4.3.jar appears to be the cause of the problem. As I said above, Spring Boot does not apply that configuration by default. You need to correct the arguments that are being passed to the JVM or, if they are out of your control, report the problem to the maintainers of the tool that is launching the JVM for you.

This command is generated from IDEA

Comment From: wilkinsona

In that case you should check the run/debug configuration that you're using to see why the Coroutines agent is being added and disable it if possible. If that's not possible, you could raise the problem with JetBrains. It is out of Spring Boot's control so there's nothing more that we can do to help you here.

Comment From: huifer

I just booted it and it was normal, but this is what happens when I start it with debug。Here is my startup configuration: SpringBoot smoketest.propertyvalidation.SamplePropertyValidationApplication start error

Comment From: bclozel

@huifer, see https://youtrack.jetbrains.com/issue/KTIJ-19286

Comment From: huifer

@bclozel I have found my solution through this document, thank you very much,Allow me to post a screenshot of my solution: SpringBoot smoketest.propertyvalidation.SamplePropertyValidationApplication start error