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

Latest 2.7.2 leads to NoClassDefFoundError #1341

Closed
jchapuis opened this issue May 27, 2024 · 5 comments
Closed

Latest 2.7.2 leads to NoClassDefFoundError #1341

jchapuis opened this issue May 27, 2024 · 5 comments

Comments

@jchapuis
Copy link

Updating to the latest 2.7.2 version makes our services crash at startup with

Unable to start Kanela Agent. Please remove -javaagent from your startup arguments and contact Kanela support.:

 java.lang.NoClassDefFoundError: org/apache/http/client/methods/HttpUriRequest      at 
 
 kamon.instrumentation.apache.httpclient.ApacheHttpClientInstrumentation.<init>(ApacheHttpClientInstrumentation.scala:26)
@jchapuis jchapuis changed the title Latest 2.7.2 update NoClassDefFoundError Latest 2.7.2 leads to NoClassDefFoundError May 27, 2024
@Dichotomia
Copy link

Same problem here

[main] ERROR 2024-05-27 09:10:11 Logger : Unable to start Kanela Agent. Please remove -javaagent from your startup arguments and contact Kanela support.: java.lang.NoClassDefFoundError: org/apache/http/client/methods/HttpUriRequest at kamon.instrumentation.apache.httpclient.ApacheHttpClientInstrumentation.<init>(ApacheHttpClientInstrumentation.scala:26) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Unknown Source) at java.base/java.lang.reflect.ReflectAccess.newInstance(Unknown Source) at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(Unknown Source) at java.base/java.lang.Class.newInstance(Unknown Source) 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:902) at kanela.agent.InstrumentationLoader.lambda$load$4(InstrumentationLoader.java:46) at kanela.agent.libs.io.vavr.collection.List.map(List.java:1042) at kanela.agent.InstrumentationLoader.load(InstrumentationLoader.java:43) at kanela.agent.Kanela.lambda$null$0(Kanela.java:78) at kanela.agent.util.classloader.InstrumentationClassPath.use(InstrumentationClassPath.java:84) at kanela.agent.Kanela.lambda$start$1(Kanela.java:67) 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:66) at kanela.agent.Kanela.premain(Kanela.java:46) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(Unknown Source) at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(Unknown Source) Caused by: java.lang.ClassNotFoundException: org.apache.http.client.methods.HttpUriRequest at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source) at java.base/java.lang.ClassLoader.loadClass(Unknown Source) at kamon.instrumentation.apache.httpclient.ApacheHttpClientInstrumentation.<init>(ApacheHttpClientInstrumentation.scala:26) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Unknown Source) at java.base/java.lang.reflect.ReflectAccess.newInstance(Unknown Source) at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(Unknown Source) at java.base/java.lang.Class.newInstance(Unknown Source) 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:902) at kanela.agent.InstrumentationLoader.lambda$load$4(InstrumentationLoader.java:46) at kanela.agent.libs.io.vavr.collection.List.map(List.java:1042) at kanela.agent.InstrumentationLoader.load(InstrumentationLoader.java:43) at kanela.agent.Kanela.lambda$null$0(Kanela.java:78) at kanela.agent.util.classloader.InstrumentationClassPath.use(InstrumentationClassPath.java:84) at kanela.agent.Kanela.lambda$start$1(Kanela.java:67) 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:66) at kanela.agent.Kanela.premain(Kanela.java:46) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(Unknown Source) at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(Unknown Source)

@amiguez
Copy link

amiguez commented May 27, 2024

This issue is reproducible based on the g8 template:
https://github.com/theiterators/pekko-http-quickstart-scala.g8

disabling apache http client instrumentalization allows the service to start.

kanela.modules.apache-httpclient.enabled = no

@Dichotomia
Copy link

I think it is related to #1330

@rg-p

@essobedo
Copy link

essobedo commented Jun 5, 2024

FYI, this issue seems to be fixed by #1343 which is part of 2.7.3 that has just been released so upgrading to 2.7.3 fixed the issue on my side

@hughsimpson
Copy link
Contributor

Thanks for the feedback @essobedo, closing this

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

5 participants