0

I am trying to run testcase using mockk and junit 5. Whenever I am trying to run the testcases I am getting this error, "java.lang.IllegalStateException: Could not self-attach to current VM using external process".

java.lang.IllegalStateException: Could not self-attach to current VM using external process
            at net.bytebuddy.agent.ByteBuddyAgent.installExternal(ByteBuddyAgent.java:700)
            at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:631)
            at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:611)
            at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:563)
            at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:540)
            at io.mockk.proxy.jvm.JvmMockKAgentFactory.initInstrumentation(JvmMockKAgentFactory.kt:127)
            at io.mockk.proxy.jvm.JvmMockKAgentFactory.init(JvmMockKAgentFactory.kt:33)
            at io.mockk.impl.JvmMockKGateway.<init>(JvmMockKGateway.kt:46)
            at io.mockk.impl.JvmMockKGateway.<clinit>(JvmMockKGateway.kt:186)
            ... 1 more

I am using JDK 17 and IntelliJ IDEA 2022.2.3 (Community Edition). bytebuddy versions:-

mockk:1.13.2

I was expecting that the testcases run without any exceptions or error.

  • Please try this https://stackoverflow.com/a/55525173/ If it doesn't help, also try the suggestions in this issue's description https://stackoverflow.com/q/69929229/ – y.bedrov Dec 01 '22 at 12:05

0 Answers0