File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 57
57
import java .util .List ;
58
58
import java .util .Map ;
59
59
import java .util .Objects ;
60
+ import java .util .concurrent .ThreadLocalRandom ;
60
61
import java .util .logging .LogManager ;
61
62
import java .util .logging .Logger ;
62
63
import java .util .stream .Stream ;
@@ -123,6 +124,11 @@ private static void installBytebuddyAgent(
123
124
EmbeddedInstrumentationProperties .setPropertiesLoader (extensionClassLoader );
124
125
setDefineClassHandler ();
125
126
FieldBackedImplementationConfiguration .configure (earlyConfig );
127
+ // preload ThreadLocalRandom to avoid occasional
128
+ // java.lang.ClassCircularityError: java/util/concurrent/ThreadLocalRandom
129
+ // see https://github.com/raphw/byte-buddy/issues/1666 and
130
+ // https://bugs.openjdk.org/browse/JDK-8164165
131
+ ThreadLocalRandom .current ();
126
132
127
133
AgentBuilder agentBuilder =
128
134
new AgentBuilder .Default (
You can’t perform that action at this time.
0 commit comments