Maven plugin does not work anymore on Ubuntu with latest OpenJDK 8

Hello guys.

At Datastax, we just identified an issue with Gatling and OpenJDK 8u181 on Ubuntu. Trying to run the Gatling maven plugin demo fails with this error:

Error: Could not find or load main class io.gatling.mojo.MainWithArgsInFile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------

The error can be reproduced on an up to date Ubuntu (xenial) system. The exact Java version is:

openjdk version “1.8.0_181”
OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-1ubuntu0.16.04.1-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)

The important bit is b13-1 in the version string. According to Ubuntu’s changelog, that version arrived through the security update channel a few days ago. I ran the same command on an out-of-date machine and it worked well. The exact Java version was this (Note the b13-0 in th version string):

openjdk version “1.8.0_181”
OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-0ubuntu0.16.04.1-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)

Has this issue already been raised? What should be the way forward?

Thanks in advance for your help

Hi,

No, never heard of this one.
We run OpenJDK 1.8.0_181-b13 (from AdoptOpenJDK) with no issue on MacOS and Fedora (maven version is 3.5.3).

I fail to see how the problem could be on our side.
Are you sure you don’t have something broken on your machine (full filesystem, no write permissions, exhausted memory)?

Hi Guys,

I'm facing the exact same problem since a few days!

openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-1ubuntu0.18.04.1-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)

Regards

Daniel

My2cents: as 8u181 works perfectly fine on other system, it’s more likely a bug with the latest Ubuntu OpenJDK package This [issue](https://bugs.launchpad.net/ubuntu/+source/openjdk-8/+bug/1801051 looks similar) looks pretty similar.
Try installing from AdoptOpenJDK. If that fixes your issue, please fill a bug against Ubuntu.

I have fixed the issue by upgrading to JDK11:

java version "11.0.1" 2018-10-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.1+13-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.1+13-LTS, mixed mode)

I was in the process of migrating to Gatling 3 anyway :slight_smile:

Cheers

Daniel

I was also facin same issue, Updating Openjdk to 11 from openjdk8 solved my problem, Thanks guys.

As suspected, this is a Debian package bug: there was a new check introduced in OpenJDK but the Debian package is missing a later commit that disabled it by default.

Other java build components are affected, such as surefire.

The workaround for this in gatling-maven-plugin version 2.2.4 is to explicitely set:

-Dgatling.zincJvmArgs=’-Djdk.net.URLClassPath.disableClassPathURLCheck=true’ -Dgatling.jvmArgs=’-Djdk.net.URLClassPath.disableClassPathURLCheck=true’

Alternatively this can be in the pom :

io.gatling gatling-maven-plugin ${gatling-plugin.version} -Djdk.net.URLClassPath.disableClassPathURLCheck=true -Djdk.net.URLClassPath.disableClassPathURLCheck=true