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

Dynamic Attach to Tomcat process fails with NullPointerException #612

Open
danbtl opened this issue Jul 26, 2022 · 0 comments
Open

Dynamic Attach to Tomcat process fails with NullPointerException #612

danbtl opened this issue Jul 26, 2022 · 0 comments

Comments

@danbtl
Copy link

danbtl commented Jul 26, 2022

Attempting to attach to a Tomcat 9.0.4 process:

java -jar opentracing-specialagent-1.7.4.jar ${PID_OF_TOMCAT}

Throws the following Exception in the Tomcat process:

Terminating initialization of SpecialAgent due to:
java.lang.NullPointerException: Cannot invoke "java.lang.ClassLoader.getResourceAsStream(String)" because the return value of "java.lang.Thread.getContextClassLoader()" is null
	at io.opentracing.contrib.specialagent.AssembleUtil.loadProperties(AssembleUtil.java:881)
	at io.opentracing.contrib.specialagent.SpecialAgent.init(SpecialAgent.java:152)
	at io.opentracing.contrib.specialagent.SpecialAgent.premain(SpecialAgent.java:138)
	at io.opentracing.contrib.specialagent.SpecialAgent.premain(SpecialAgent.java:119)
	at io.opentracing.contrib.specialagent.SpecialAgent.agentmain(SpecialAgent.java:109)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:577)
	at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:491)
	at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallAgentmain(InstrumentationImpl.java:513)

Java Version:

# java -version
openjdk version "18.0.1.1" 2022-04-22
OpenJDK Runtime Environment (build 18.0.1.1+2)
OpenJDK 64-Bit Server VM (build 18.0.1.1+2, mixed mode)

Not sure if I'm doing something wrong.

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

No branches or pull requests

1 participant