Compilation Crash NoClassDefFoundError for sbt

Upgrading to Gatling 3 happened at the same time as a required move to artifactory so I’m not sure which if one or both are responsible but I’m getting the following error running my simulation on Ubuntu. Mac OS seems fine as well as Intellij. I’ve tried adding sbt to the pom and a few different strategies for resolving dependencies, no luck.

java.lang.NoClassDefFoundError: Could not initialize class$
	at scala.collection.parallel.mutable.ParArray$Map.leaf(ParArray.scala:656)

Any suggestions on how to fix?


Corrupted downloaded sbt artifact? Try removing ~/.sbt.

I don’t see a ~/.sbt directory. I tried deleting everything from my .m2/repositories directory as well as mvn clean. Still same error

Pure shot in the dark: this class seems to be using JNA, which by default extracts a native lib in /tmp and loads it.
Is /tmp mounted with noexec?

That was definitely it, excellent nighttime shooting :wink:

Remounting with exec fixes the problem, though I’d prefer to change the java temp directory but haven’t had much success:

JAVA_OPTS="" MAVEN_OPTS="" mvn gatling:test

Still uses /tmp/

The following worked for me when using gatling-charts-highcharts-bundle-3.0.3/bin/ :

export JAVA_OPTS="$JAVA_OPTS -Djna.tmpdir=/opt/tmp"