You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The agent class will be loaded by the system class loader (see ClassLoader.getSystemClassLoader).
I.e., the Java agent must see the classpath! It actually means more than that. The agent and the application share a class loader so they have access to the same static fields etc.
This results in a failure whenever a Java agent tries to access a class that is contained on the classpath, but not in the agent JAR.
A related problem is that the spec says:
The agent JAR is appended to the system class path.
But this isn't implemented.
The text was updated successfully, but these errors were encountered:
Actually, what happens is that the master context is used by the agent, and not the application's context, which is created by RunJava, which is launched after the agent.
This points the way to a possible fix: set up the isolated context in a java agent that is always passed first to the JVM.
The
-javaagent
flag is passed to the JVM injava.cc
, but the classpath is handled byRunJava
. This is not how Java agents work!The spec says this:
I.e., the Java agent must see the classpath! It actually means more than that. The agent and the application share a class loader so they have access to the same static fields etc.
This results in a failure whenever a Java agent tries to access a class that is contained on the classpath, but not in the agent JAR.
A related problem is that the spec says:
But this isn't implemented.
The text was updated successfully, but these errors were encountered: