You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by valodzka January 14, 2022
I'm trying to add agent to my project but see the issue during startup (stack trace below). I think issue is that:
Project uses java module system (JPMS)
Project has selenium-remote as dependency which has opentelementry as dependency
In combination it causes that incorrect version of autoconfigure loaded (shaded vs unshaded).
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at io.opentelemetry.javaagent.bootstrap.AgentInitializer.initialize(AgentInitializer.java:40)
at io.opentelemetry.javaagent.OpenTelemetryAgent.agentmain(OpenTelemetryAgent.java:51)
at io.opentelemetry.javaagent.OpenTelemetryAgent.premain(OpenTelemetryAgent.java:44)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:491)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:503)
Caused by: java.lang.NoSuchMethodError: 'io.opentelemetry.sdk.resources.Resource io.opentelemetry.sdk.resources.Resource.create(io.opentelemetry.javaagent.shaded.io.opentelemetry.api.common.Attributes)'
at io.opentelemetry.javaagent.tooling.AutoVersionResourceProvider.createResource(AutoVersionResourceProvider.java:26)
at io.opentelemetry.sdk.autoconfigure@1.10.0-alpha/io.opentelemetry.sdk.autoconfigure.ResourceConfiguration.configureResource(ResourceConfiguration.java:42)
at io.opentelemetry.sdk.autoconfigure@1.10.0-alpha/io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdkBuilder.build(AutoConfiguredOpenTelemetrySdkBuilder.java:186)
at io.opentelemetry.javaagent.tooling.OpenTelemetryInstaller.installAgentTracer(OpenTelemetryInstaller.java:63)
at io.opentelemetry.javaagent.tooling.OpenTelemetryInstaller.beforeAgent(OpenTelemetryInstaller.java:35)
at io.opentelemetry.javaagent.tooling.AgentInstaller.runBeforeAgentListeners(AgentInstaller.java:192)
at io.opentelemetry.javaagent.tooling.AgentInstaller.installBytebuddyAgent(AgentInstaller.java:122)
at io.opentelemetry.javaagent.tooling.AgentInstaller.installBytebuddyAgent(AgentInstaller.java:100)
... 13 more
This is a bug in opentelemetry agent. Agent uses a custom class loader to load most of the agent classes. Unfortunately when running with jpms agent classes that are present in application get loaded from application instead of agent.
The text was updated successfully, but these errors were encountered:
valodzka
changed the title
NoSuchMethodError when using agent and modules and selenium
NoSuchMethodError when using agent and modules (JPMS) and selenium
Jan 17, 2022
Discussed in #5126
Originally posted by valodzka January 14, 2022
I'm trying to add agent to my project but see the issue during startup (stack trace below). I think issue is that:
In combination it causes that incorrect version of autoconfigure loaded (shaded vs unshaded).
As stated by @laurit
The text was updated successfully, but these errors were encountered: