opentracing-contrib / java-specialagent

Automatic instrumentation for 3rd-party libraries in Java applications with OpenTracing.
Apache License 2.0
185 stars 46 forks source link

Jaeger exporter stopped working #589

Open william-tran opened 4 years ago

william-tran commented 4 years ago

When running with these flags

-javaagent:/Users/wtran/.m2/repository/io/opentracing/contrib/specialagent/opentracing-specialagent/1.7.4/opentracing-specialagent-1.7.4.jar -Dsa.log.level=FINER -Dsa.exporter=/Users/wtran/.m2/repository/io/opentracing/contrib/jaeger-client-bundle/1.0.0/jaeger-client-bundle-1.0.0.jar

Specialagent errors with

<<<<<<<<<<<<<<<<<<<< Loading Trace Exporter >>>>>>>>>>>>>>>>>>>>

Resolving tracer:
  /Users/wtran/.m2/repository/io/opentracing/contrib/jaeger-client-bundle/1.0.0/jaeger-client-bundle-1.0.0.jar
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

>>>>>>>>>>>>>>>>>>>> Loaded Trace Exporter <<<<<<<<<<<<<<<<<<<<<

>>>>>>>>>>>>> Loading of AgentRule(s) is Deferred <<<<<<<<<<<<<

Terminating initialization of SpecialAgent due to:
java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException
    at io.opentracing.contrib.specialagent.OpenTracingAdapter.loadTracer(OpenTracingAdapter.java:110)
    at io.opentracing.contrib.specialagent.SpecialAgent.loadAdapter(SpecialAgent.java:418)
    at io.opentracing.contrib.specialagent.SpecialAgent.loadRules(SpecialAgent.java:452)
    at io.opentracing.contrib.specialagent.SpecialAgent.load(SpecialAgent.java:327)
    at io.opentracing.contrib.specialagent.SpecialAgent.init(SpecialAgent.java:169)
    at io.opentracing.contrib.specialagent.SpecialAgent.premain(SpecialAgent.java:138)
    at io.opentracing.contrib.specialagent.SpecialAgent.premain(SpecialAgent.java:119)
    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:566)
    at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(Unknown Source)
    at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
    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:566)
    at io.opentracing.contrib.specialagent.OpenTracingAdapter.loadDeferredTracer(OpenTracingAdapter.java:208)
    at io.opentracing.contrib.specialagent.OpenTracingAdapter.loadTracer(OpenTracingAdapter.java:107)
    ... 12 more
Caused by: java.lang.NoClassDefFoundError: java/sql/Time
    at com.google.gson.Gson.<init>(Gson.java:240)
    at com.google.gson.Gson.<init>(Gson.java:174)
    at io.jaegertracing.internal.samplers.HttpSamplingManager.<init>(HttpSamplingManager.java:34)
    at io.jaegertracing.Configuration$SamplerConfiguration.createSampler(Configuration.java:386)
    at io.jaegertracing.Configuration.getTracerBuilder(Configuration.java:225)
    at io.jaegertracing.Configuration.getTracer(Configuration.java:247)
    at io.jaegertracing.tracerresolver.internal.JaegerTracerFactory.getTracer(JaegerTracerFactory.java:24)
    at io.jaegertracing.tracerresolver.internal.JaegerTracerFactory.getTracer(JaegerTracerFactory.java:21)
    at io.opentracing.contrib.tracerresolver.TracerResolver.getFromFactory(TracerResolver.java:190)
    at io.opentracing.contrib.tracerresolver.TracerResolver.resolveTracer(TracerResolver.java:123)
    at io.opentracing.contrib.tracerresolver.TracerResolver.resolveTracer(TracerResolver.java:79)
    ... 18 more
Caused by: java.lang.ClassNotFoundException: java.sql.Time
    at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    ... 29 more

This is on openjdk 11.

william-tran commented 4 years ago

Also, this was working in 1.6.0.

william-tran commented 4 years ago

I think this has something to do with the Jaeger exporter, because -Dsa.exporter=jaeger fails the same way

jgoeres commented 4 years ago

I also ran into this during my very first experiments with the specialagent, I am using 1.7.4. I am using Azul Zulu OpenJDK:

openjdk version "11.0.7" 2020-04-14 LTS
OpenJDK Runtime Environment Zulu11.39+16-SA (build 11.0.7+10-LTS)
OpenJDK 64-Bit Server VM Zulu11.39+16-SA (build 11.0.7+10-LTS, mixed mode)

I tried to resolve this by adding the java.sql module like this:

--add-modules java.sql

but that didn't help. I tried 1.6.1 and this seems to work.

jgoeres commented 3 years ago

Any news on this?