When Mockito-inline is added to hudi-tests-common, this library will be included to tests that run in our docker image in Azure CI, and the underlying library ByteBuddy will have conflicts with the docker image.
Currently solution is to avoid adding mockito-inline to hudi-tests-common to avoid the conflicts. But if some tests that run in docker image have to use mockito-inline, we will need to solve the problem.
{code:java}
Caused by: java.lang.IllegalStateException: Failed to load interface org.mockito.plugins.MockMaker implementation declared in sun.misc.CompoundEnumeration@138f0661
at org.mockito.internal.configuration.plugins.PluginInitializer.loadImpl(PluginInitializer.java:58)
at org.mockito.internal.configuration.plugins.PluginLoader.loadPlugin(PluginLoader.java:69)
at org.mockito.internal.configuration.plugins.PluginLoader.loadPlugin(PluginLoader.java:54)
at org.mockito.internal.configuration.plugins.PluginRegistry.(PluginRegistry.java:29)
at org.mockito.internal.configuration.plugins.Plugins.(Plugins.java:20)
at org.mockito.internal.util.MockUtil.(MockUtil.java:28)
... 76 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.mockito.internal.configuration.plugins.PluginInitializer.loadImpl(PluginInitializer.java:53)
... 81 more
Caused by: org.mockito.exceptions.base.MockitoInitializationException:
Could not initialize inline Byte Buddy mock maker.
It appears as if your JDK does not supply a working agent attachment mechanism.
Java : 1.8
JVM vendor name : Temurin
JVM vendor version : 25.402-b06
JVM name : OpenJDK 64-Bit Server VM
JVM version : 1.8.0_402-b06
JVM info : mixed mode
OS name : Linux
OS version : 6.8.0-1014-azure
at org.mockito.internal.creation.bytebuddy.InlineDelegateByteBuddyMockMaker.(InlineDelegateByteBuddyMockMaker.java:246)
at org.mockito.internal.creation.bytebuddy.InlineByteBuddyMockMaker.(InlineByteBuddyMockMaker.java:25)
... 86 more
Caused by: java.lang.IllegalStateException: Error during attachment using: net.bytebuddy.agent.ByteBuddyAgent$AttachmentProvider$Compound@6459f4ea
at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:636)
at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:609)
at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:561)
at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:538)
at org.mockito.internal.creation.bytebuddy.InlineDelegateByteBuddyMockMaker.(InlineDelegateByteBuddyMockMaker.java:117)
... 87 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.bytebuddy.agent.Attacher.install(Attacher.java:106)
at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:631)
... 91 more
Caused by: java.lang.UnsatisfiedLinkError: Native Library /opt/java/openjdk/jre/lib/amd64/libattach.so already loaded in another classloader
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1900)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1838)
at java.lang.Runtime.loadLibrary0(Runtime.java:843)
at java.lang.System.loadLibrary(System.java:1136)
at sun.tools.attach.LinuxVirtualMachine.(LinuxVirtualMachine.java:343)
at sun.tools.attach.LinuxAttachProvider.attachVirtualMachine(LinuxAttachProvider.java:63)
at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:208)
... 97 more
{code}
JIRA info
When Mockito-inline is added to
hudi-tests-common, this library will be included to tests that run in our docker image in Azure CI, and the underlying library ByteBuddy will have conflicts with the docker image.Currently solution is to avoid adding
mockito-inlinetohudi-tests-commonto avoid the conflicts. But if some tests that run in docker image have to use mockito-inline, we will need to solve the problem.{code:java}
Caused by: java.lang.IllegalStateException: Failed to load interface org.mockito.plugins.MockMaker implementation declared in sun.misc.CompoundEnumeration@138f0661
at org.mockito.internal.configuration.plugins.PluginInitializer.loadImpl(PluginInitializer.java:58)
at org.mockito.internal.configuration.plugins.PluginLoader.loadPlugin(PluginLoader.java:69)
at org.mockito.internal.configuration.plugins.PluginLoader.loadPlugin(PluginLoader.java:54)
at org.mockito.internal.configuration.plugins.PluginRegistry.(PluginRegistry.java:29)
at org.mockito.internal.configuration.plugins.Plugins.(Plugins.java:20)
at org.mockito.internal.util.MockUtil.(MockUtil.java:28)
... 76 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.mockito.internal.configuration.plugins.PluginInitializer.loadImpl(PluginInitializer.java:53)
... 81 more
Caused by: org.mockito.exceptions.base.MockitoInitializationException:
Could not initialize inline Byte Buddy mock maker.
It appears as if your JDK does not supply a working agent attachment mechanism.
Java : 1.8
JVM vendor name : Temurin
JVM vendor version : 25.402-b06
JVM name : OpenJDK 64-Bit Server VM
JVM version : 1.8.0_402-b06
JVM info : mixed mode
OS name : Linux
OS version : 6.8.0-1014-azure
at org.mockito.internal.creation.bytebuddy.InlineDelegateByteBuddyMockMaker.(InlineDelegateByteBuddyMockMaker.java:246)
at org.mockito.internal.creation.bytebuddy.InlineByteBuddyMockMaker.(InlineByteBuddyMockMaker.java:25)
... 86 more
Caused by: java.lang.IllegalStateException: Error during attachment using: net.bytebuddy.agent.ByteBuddyAgent$AttachmentProvider$Compound@6459f4ea
at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:636)
at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:609)
at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:561)
at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:538)
at org.mockito.internal.creation.bytebuddy.InlineDelegateByteBuddyMockMaker.(InlineDelegateByteBuddyMockMaker.java:117)
... 87 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.bytebuddy.agent.Attacher.install(Attacher.java:106)
at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:631)
... 91 more
Caused by: java.lang.UnsatisfiedLinkError: Native Library /opt/java/openjdk/jre/lib/amd64/libattach.so already loaded in another classloader
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1900)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1838)
at java.lang.Runtime.loadLibrary0(Runtime.java:843)
at java.lang.System.loadLibrary(System.java:1136)
at sun.tools.attach.LinuxVirtualMachine.(LinuxVirtualMachine.java:343)
at sun.tools.attach.LinuxAttachProvider.attachVirtualMachine(LinuxAttachProvider.java:63)
at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:208)
... 97 more
{code}
JIRA info