-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Not possible to run as agent #4404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
These |
When javaagent attaches, these classes are still not loaded. As I understand, these classes must be declared in Anyway, what's the working configuration for javaagent? Can any example be attached to this repository? |
I'm not sure which example you want attached. Here's a full step-by-step example that's as simple as possible, without relying on Gradle or anything else except the bare necessities:
import kotlinx.coroutines.*
import kotlin.time.*
fun main() {
runBlocking {
delay(Duration.INFINITE)
}
}
I've just verified that it works. |
But what to do in case of nested spring-boot jar when another copy of kotlix-coroutines-core-jvm and kotlin-stdlib are prepacked? |
I still don't see why something should be different in that scenario. If you can show us an example of a project for which the debug agent doesn't work, we will look into the problem and help you. |
spring.zip |
Thanks for the repro! TL;DR: when building a fat-jar, Spring Boot uses its own executable JAR format and the application classes and dependencies are loaded by a special Spring classloader ( I am not aware of straightforward solutions here (probably worth raising it in Spring Boot repo), only of palliatives:
|
Thanks for the response. Closing it for now as it's more spring-related. |
Describe the bug
The documentation says:
When trying to run my spring-boot app with the agent I get the following error:
The
AgentPremain
class itself declares that:So I assumed that I need to load kotlin-coroutines-core as agent, but I get the following error:
The text was updated successfully, but these errors were encountered: