title: Mockito shipped within Spring Boot fails to attach to JVM (OpenJDK 11)
body: <p>I have a bunch of Spring Boot 2.5.6 applications that use Mockito for unit testing. The version of Mockito that is used is the one that comes shipped within SB itself (3.9.0). The JDK is OpenJDK 11.0.12+0. Everything was working fine until yesterday, this morning I suddenly cannot run any Mockito-based tests, all of them fail with the following:</p>
  <pre><code>Caused by: java.lang.IllegalStateException: Failed to load interface org.mockito.plugins.MockMaker implementation declared in java.lang.CompoundEnumeration@7c51f34b
  Caused by: java.lang.reflect.InvocationTargetException
  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               : 11
  JVM vendor name    : Homebrew
  JVM vendor version : 11.0.12+0
  JVM name           : OpenJDK 64-Bit Server VM
  JVM version        : 11.0.12+0
  JVM info           : mixed mode
  OS name            : Mac OS X
  OS version         : 12.0.1
  
  Caused by: java.lang.IllegalStateException: Could not self-attach to current VM using external process
  </code></pre>
  <p>I cannot identify anything that has changed between yesterday and today.</p>
  <p>Things I have tried with no success:</p>
  <ul>
  <li>Re-run with Java 17.</li>
  <li>Re-install Java 11.</li>
  <li>Install a JDK 11 from a different vendor (Microsoft OpenJDK)</li>
  <li>Add <code>-Djdk.attach.allowAttachSelf=true</code>, both to command line and to <code>&lt;argLine&gt;</code> parameter within surefire configuration, as suggested <a href="https://stackoverflow.com/questions/55504785/how-to-get-rid-of-could-not-initialize-plugin-interface-org-mockito-plugins-mo">here</a></li>
  <li>Add <code>-XX:+StartAttachListener</code> as suggested <a href="https://stackoverflow.com/a/25439003/6166627">here</a></li>
  <li>Restart the computer</li>
  <li>Ensure the firewall allows the <code>java</code> process to receive incoming connections as per <a href="https://support.apple.com/en-us/HT201642" rel="nofollow noreferrer">here</a></li>
  <li>(Temporarily) stop any security software that may prevent connections from happening</li>
  <li>Review <code>JAVA_HOME</code> and the different Java installations on my machine in case the process was trying to attach to the wrong Java as per <a href="https://githubmemory.com/repo/raphw/byte-buddy/issues/1118" rel="nofollow noreferrer">here</a></li>
  </ul>
  <p>In case it matters, this is on an MBP M1. Other members of the team are able to build with no problem.</p>