Skip to content
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

Always set parent of agent class loader to bootstrap class loader #5169

Merged
merged 2 commits into from Jan 19, 2022

Conversation

laurit
Copy link
Contributor

@laurit laurit commented Jan 18, 2022

Resolves #5156

@laurit laurit requested a review from a team as a code owner January 18, 2022 16:23
Copy link
Member

@trask trask left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

public static boolean isJavaBefore9() {
return System.getProperty("java.version").startsWith("1.");
private static ClassLoader createAgentClassLoader(String innerJarFilename, File javaagentFile) {
return new AgentClassLoader(javaagentFile, innerJarFilename, null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason to keep the parent argument in the constructor?

agentParent = null; // bootstrap
} else {
// platform classloader is parent of system in java 9+
agentParent = getPlatformClassLoader();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any idea why we were doing this before?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was inherited, my best guess is for access to java.sql package for some reason(?)

@trask trask merged commit c76345a into open-telemetry:main Jan 19, 2022
@laurit laurit deleted the null-parent-loader branch January 19, 2022 10:28
RashmiRam pushed a commit to RashmiRam/opentelemetry-auto-instr-java that referenced this pull request May 23, 2022
…en-telemetry#5169)

* Always set parent of agent class loader to bootstrap class loader

* remove parent class loader argument
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NoSuchMethodError when using agent and modules (JPMS) and selenium
3 participants