# Unit tests based on mockito fail with openjdk8 on Xenial

**URL:** <https://travis-ci.community/t/unit-tests-based-on-mockito-fail-with-openjdk8-on-xenial/13590>\
**Category:** Java\
**Tags:** xenial\
**Created:** [February 15, 2023, 11:07am UTC](https://travis-ci.community/t/unit-tests-based-on-mockito-fail-with-openjdk8-on-xenial/13590 "2023-02-15T11:07:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alt-k](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/alt-k/32/8011_2.png) [@alt-k](https://travis-ci.community/u/alt-k)\
**Post date:** [February 15, 2023, 11:07am UTC](https://travis-ci.community/t/unit-tests-based-on-mockito-fail-with-openjdk8-on-xenial/13590/1 "2023-02-15T11:07:12Z")

</div>

Hi community !

Since yesterday we are having issues during Java builds on xenial environment.  
Our TravisCI configuration has not changed since a while.  
We use the openJDK 8 but some unit tests fail with the following error:

```auto
java.lang.IllegalStateException: Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
Caused by: java.lang.IllegalStateException: Failed to load interface org.mockito.plugins.MockMaker implementation declared in sun.misc.CompoundEnumeration@6107227e
Caused by: java.lang.IllegalStateException: Failed to load MockMaker implementation: mock-maker-inline
Caused by: java.lang.IllegalStateException: Internal problem occurred, please report it. Mockito is unable to load the default implementation of class that is a part of Mockito distribution. Failed to load interface org.mockito.plugins.MockMaker
Caused by: org.mockito.exceptions.base.MockitoInitializationException: 
Could not initialize inline Byte Buddy mock maker. (This mock maker is not supported on Android.)
Are you running a JRE instead of a JDK? The inline mock maker needs to be run on a JDK.
Java : 1.8
JVM vendor name : Private Build
JVM vendor version : 25.292-b10
JVM name : OpenJDK 64-Bit Server VM
JVM version : 1.8.0_292-8u292-b10-0ubuntu1~16.04.1-b10
JVM info : mixed mode
OS name : Linux
OS version : 4.15.0-1098-gcp
Caused by: java.lang.IllegalStateException: No compatible attachment provider is available

```

Is there a change that affects Java builds on Xenial?

The build image provisioning date and time changed between successful and failed builds.  
Latest successful build:

```auto
Build language: java
Build dist: xenial
Build id: 260625977
Job id: 595907204
Runtime kernel version: 4.15.0-1098-gcp
travis-build version: dcbd738d
Build image provisioning date and time
Mon Oct 3 09:51:07 UTC 2022

```

Failed build:

```auto
Build language: java
Build dist: xenial
Build id: 260662733
Job id: 596003619
Runtime kernel version: 4.15.0-1098-gcp
travis-build version: dcbd738d
Build image provisioning date and time
Tue Feb 14 12:33:43 UTC 2023

```

Below the Travis CI configuration:

```auto
dist: xenial

language: java

cache:
  directories:
    - "${HOME}/.m2"

jdk:
  - openjdk8

```
