Problem with Wildfly and Akka 2.6 related to flight recorder (jdk.jfr.Event)

Just wanted to let you know the following because I could not really find a solution to this on the internet:

I’ve just upgraded my project from Akka 2.5 to 2.6.9 We currently use Wildfly together with Akka (well, I know this is probably not the greatest idea, but we currently have to do it).

When I first started Wildfly I got the following error:

15:01:16,898 WARN [org.jb.m.define ] (EE-ManagedExecutorService-default-Thread-1) corrID= caller= user= Failed to define class akka.remote.artery.jfr.TransportStarted in Module "deployment.mym.war" from Service Module Loader: java.lang.NoClassDefFoundError: Failed to link akka/remote/artery/jfr/TransportStarted (Module "deployment.mym.war" from Service Module Loader): jdk/jfr/Event

Somehow due to JBoss/Wildfly classloading jdk.jfr.Event doesn’t seem to be accessible for Akka. I played around with jboss-deployment-structure.xml etc. but could not solve the problem so far. However I could fix it by adding the following to my application.conf:

akka {
  java-flight-recorder {
    enabled = false

For me it’s ok currently but I would still be interested if anyone figured out how to solve this without disabling the flight-recorder.

1 Like