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

Cassandra integration seems to crash the agent when driver not available #805

Closed
fmonniot opened this issue Jul 6, 2020 · 1 comment
Closed

Comments

@fmonniot
Copy link
Contributor

fmonniot commented Jul 6, 2020

Hello there,

I tried to update my kamon-bundle to version 2.1.2 and in doing so I encounter the error java.lang.NoClassDefFoundError: com/datastax/driver/core/Session (complete stack trace below) on startup. As my application does not use Cassandra, it seems pretty logical that the class was not found. It's less logical that kanela try to load it by default :)

Complete stack trace
Unable to start Kanela Agent. Please remove -javaagent from your startup arguments and contact Kanela support.:
java.lang.NoClassDefFoundError: com/datastax/driver/core/Session
	at kamon.instrumentation.cassandra.driver.DriverInstrumentation.<init>(DriverInstrumentation.scala:35)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
	at java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:166)
	at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:404)
	at java.base/java.lang.Class.newInstance(Class.java:591)
	at kanela.agent.InstrumentationLoader.lambda$loadInstrumentation$b85f757d$1(InstrumentationLoader.java:58)
	at kanela.agent.libs.io.vavr.control.Try.of(Try.java:75)
	at kanela.agent.InstrumentationLoader.loadInstrumentation(InstrumentationLoader.java:56)
	at kanela.agent.InstrumentationLoader.lambda$null$1(InstrumentationLoader.java:46)
	at kanela.agent.libs.io.vavr.collection.List.flatMap(List.java:898)
	at kanela.agent.InstrumentationLoader.lambda$load$4(InstrumentationLoader.java:46)
	at kanela.agent.libs.io.vavr.collection.List.map(List.java:1038)
	at kanela.agent.InstrumentationLoader.load(InstrumentationLoader.java:43)
	at kanela.agent.Kanela.lambda$null$0(Kanela.java:79)
	at kanela.agent.util.classloader.InstrumentationClassPath.use(InstrumentationClassPath.java:84)
	at kanela.agent.Kanela.lambda$start$1(Kanela.java:68)
	at kanela.agent.util.Execution.timed(Execution.java:32)
	at kanela.agent.util.Execution.runWithTimeSpent(Execution.java:41)
	at kanela.agent.Kanela.start(Kanela.java:67)
	at kanela.agent.Kanela.agentmain(Kanela.java:54)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
	at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:513)
	at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallAgentmain(InstrumentationImpl.java:535)
Caused by: java.lang.ClassNotFoundException: com.datastax.driver.core.Session
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	at kamon.instrumentation.cassandra.driver.DriverInstrumentation.<init>(DriverInstrumentation.scala:35)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
	at java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:166)
	at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:404)
	at java.base/java.lang.Class.newInstance(Class.java:591)
	at kanela.agent.InstrumentationLoader.lambda$loadInstrumentation$b85f757d$1(InstrumentationLoader.java:58)
	at kanela.agent.libs.io.vavr.control.Try.of(Try.java:75)
	at kanela.agent.InstrumentationLoader.loadInstrumentation(InstrumentationLoader.java:56)
	at kanela.agent.InstrumentationLoader.lambda$null$1(InstrumentationLoader.java:46)
	at kanela.agent.libs.io.vavr.collection.List.flatMap(List.java:898)
	at kanela.agent.InstrumentationLoader.lambda$load$4(InstrumentationLoader.java:46)
	at kanela.agent.libs.io.vavr.collection.List.map(List.java:1038)
	at kanela.agent.InstrumentationLoader.load(InstrumentationLoader.java:43)
	at kanela.agent.Kanela.lambda$null$0(Kanela.java:79)
	at kanela.agent.util.classloader.InstrumentationClassPath.use(InstrumentationClassPath.java:84)
	at kanela.agent.Kanela.lambda$start$1(Kanela.java:68)
	at kanela.agent.util.Execution.timed(Execution.java:32)
	at kanela.agent.util.Execution.runWithTimeSpent(Execution.java:41)
	at kanela.agent.Kanela.start(Kanela.java:67)
	at kanela.agent.Kanela.agentmain(Kanela.java:54)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
	at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:513)
	at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallAgentmain(InstrumentationImpl.java:535) 
ivantopo added a commit to ivantopo/Kamon that referenced this issue Jul 7, 2020
ivantopo added a commit to ivantopo/Kamon that referenced this issue Jul 7, 2020
ivantopo added a commit to ivantopo/Kamon that referenced this issue Jul 7, 2020
@fmonniot
Copy link
Contributor Author

fmonniot commented Jul 7, 2020

Thanks for the quick fix !

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