While running mvn clean install I am getting below error after all the test cases are passed.
Exception in thread "Thread-3" java.lang.NoClassDefFoundError: akka/actor/CoordinatedShutdown$$anonfun$totalTimeout$1
at akka.actor.CoordinatedShutdown.totalTimeout(CoordinatedShutdown.scala:377)
at akka.actor.CoordinatedShutdown$$anonfun$initJvmHook$1.apply(CoordinatedShutdown.scala:109)
at akka.actor.CoordinatedShutdown$$anon$2.run(CoordinatedShutdown.scala:395)
Caused by: java.lang.ClassNotFoundException: akka.actor.CoordinatedShutdown$$anonfun$totalTimeout$1
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 3 more
If it happens after all your tests has completed it is likely triggered by tests leaking a running ActorSystem
rather than stopping it before they complete. Make sure you always terminate the ActorSystem
s that you start in the tests.
The actual exception could also indicate that you have mixed versions of Akka modules in your project, they must all be of the same Akka version. This can happen if you have some transitive dependency pulling in modules of Akka that you do not explicitly use yourself. If that is the case you will need to add explicit dependencies to make sure all modules are from the same Akka version.