Fix ClassNotFoundException on Wildfly (#1593)

This commit is contained in:
Trask Stalnaker 2020-11-08 20:59:36 -08:00 committed by GitHub
parent 71f91877ab
commit 8ee2533c96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -18,7 +18,6 @@ import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
import com.google.auto.service.AutoService;
import io.opentelemetry.instrumentation.api.internal.BootstrapPackagePrefixesHolder;
import io.opentelemetry.javaagent.instrumentation.api.CallDepthThreadLocalMap;
import io.opentelemetry.javaagent.tooling.Constants;
import io.opentelemetry.javaagent.tooling.Instrumenter;
@ -90,7 +89,12 @@ public final class ClassLoaderInstrumentation extends Instrumenter.Default {
}
try {
for (String prefix : BootstrapPackagePrefixesHolder.getBoostrapPackagePrefixes()) {
// TODO (trask) need to load BootstrapPackagePrefixesHolder itself from the bootstrap class
// loader, but at the same time need to be careful about re-entry due to comment above,
// so for now using the old constant, which works because Constants is injected into the
// class loader
// for (String prefix : BootstrapPackagePrefixesHolder.getBoostrapPackagePrefixes()) {
for (String prefix : Constants.BOOTSTRAP_PACKAGE_PREFIXES) {
if (name.startsWith(prefix)) {
try {
return Class.forName(name, false, null);