Skip to content
Advertisement

java.util.concurrent.ExecutionException: java.lang.NoSuchMethodError

I have a few Scala test classes in a gradle project that work just fine when run individually. But when run through the gradle test task, it fails with the following error in beforeEach of all classes –

JavaScript

The line that it is failing at is creating an instance of a Scala case class which has some default values assigned to all vars. And from the error, it looks like it is failing to create a default java list in that case class. The case class used has multiple lists.

JavaScript

Given that individually the test classes work, I am not sure how is it different when running through test. Any clues that could help me with this? Thanks.

Advertisement

Answer

Seems JDK incompatibility with Scala version.

could you please check the Java & Scala versions mapped accordingly.

from scala website:

JavaScript
Advertisement