Fix NPE in rmi server instrumentation
MODIFY
instrumentation/rmi/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rmi/server/RemoteServerInstrumentation.java
instrumentation/rmi/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rmi/server/RemoteServerInstrumentation.java
@@ -57,6 +57,9 @@ public class RemoteServerInstrumentation implements TypeInstrumentation {
// TODO review and unify with all other SERVER instrumentation
Context parentContext = THREAD_LOCAL_CONTEXT.getAndResetContext();
+ if (parentContext == null) {
+ return;
+ }
request = ClassAndMethod.create(declaringClass, methodName);
if (!instrumenter().shouldStart(parentContext, request)) {
return;

Fix NPE in rmi server instrumentation (#5042)