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
When trying to mock classes when there is opentelemetry-javaagent-extension-api jar in the classpath, it fails with error:
Underlying exception : org.mockito.exceptions.base.MockitoException: Could not modify all classes [interface java.sql.Connection, interface java.lang.AutoCloseable, interface java.sql.Wrapper]
...
Caused by: java.lang.AbstractMethodError: Receiver class org.mockito.internal.creation.bytebuddy.InlineBytecodeGenerator$ParameterWritingVisitorWrapper does not define or inherit an implementation of the resolved method 'abstract org.objectweb.asm.ClassVisitor wrap(net.bytebuddy.description.type.TypeDescription, org.objectweb.asm.ClassVisitor, net.bytebuddy.implementation.Implementation$Context, net.bytebuddy.pool.TypePool, net.bytebuddy.description.field.FieldList, net.bytebuddy.description.method.MethodList, int, int)' of interface net.bytebuddy.asm.AsmVisitorWrapper.
It seems as if the ClassVisitor class in the asm dependency of byte-buddy (org.objectweb.asm.ClassVisitor) is being incorrectly used instead of ClassVisitor from byte-buddy's own jar (net.bytebuddy.jar.asm.ClassVisitor).
OS: mac sonoma 14.4.1
Java: openjdk version "17.0.8.1"
Mockito: 5.11.0
The text was updated successfully, but these errors were encountered:
pradeep-tux
changed the title
Mockito does not work with OTEL instrumentation jars
Mockito does not work with OTEL extension in classpath
May 12, 2024
pradeep-tux
changed the title
Mockito does not work with OTEL extension in classpath
Mockito does not work with OTEL extension api in classpath
May 12, 2024
When trying to mock classes when there is
opentelemetry-javaagent-extension-api
jar in the classpath, it fails with error:It seems as if the
ClassVisitor
class in the asm dependency of byte-buddy (org.objectweb.asm.ClassVisitor
) is being incorrectly used instead of ClassVisitor from byte-buddy's own jar (net.bytebuddy.jar.asm.ClassVisitor
).Example - https://github.com/pradeep-tux/oss-issues/tree/mockito_bytebuddy_class_override
Just run the tests within the project - those would fail with the above error
Environment:
OS: mac sonoma 14.4.1
Java: openjdk version "17.0.8.1"
Mockito: 5.11.0
The text was updated successfully, but these errors were encountered: