Akka version on Playframework

I am trying to integrate some existing code with a playback platform . I downloaded the 1.3.6 minimum Activafe Activator package . I created a play-java project and changed build.sbt with these lines:

 resolvers += "Local Maven Repository" at "file://"+Path.userHome.absolutePath+"/.m2/repository" libraryDependencies ++= Seq( "com.xxx" % "messages" % "0.0.1-SNAPSHOT" ) 

Then I added a link to one of my existing classes in Application.java . When I launched the activator run , it downloaded a large number of cans, including the one I added manually, and successfully compiled the code.

When it tries to start, I get an error message:

 $ ./activator run [info] Loading project definition from <APP_ROOT>/project [info] Set current project to my-proj (in build file:<APP_ROOT>) --- (Running the application, auto-reloading is enabled) --- java.lang.ClassNotFoundException: akka.event.slf4j.Slf4jLoggingFilter at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:348) at akka.actor.ReflectiveDynamicAccess$$anonfun$getClassFor$1.apply(DynamicAccess.scala:67) at akka.actor.ReflectiveDynamicAccess$$anonfun$getClassFor$1.apply(DynamicAccess.scala:66) at scala.util.Try$.apply(Try.scala:192) at akka.actor.ReflectiveDynamicAccess.getClassFor(DynamicAccess.scala:66) at akka.actor.ReflectiveDynamicAccess.createInstanceFor(DynamicAccess.scala:84) at akka.actor.ActorSystemImpl.<init>(ActorSystem.scala:612) at akka.actor.ActorSystem$.apply(ActorSystem.scala:143) at akka.actor.ActorSystem$.apply(ActorSystem.scala:127) at play.api.libs.concurrent.ActorSystemProvider$.start(Akka.scala:291) at play.core.server.DevServerStart$$anonfun$mainDev$1.apply(DevServerStart.scala:205) at play.core.server.DevServerStart$$anonfun$mainDev$1.apply(DevServerStart.scala:61) at play.utils.Threads$.withContextClassLoader(Threads.scala:21) at play.core.server.DevServerStart$.mainDev(DevServerStart.scala:60) at play.core.server.DevServerStart$.mainDevHttpMode(DevServerStart.scala:50) at play.core.server.DevServerStart.mainDevHttpMode(DevServerStart.scala) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at play.runsupport.Reloader$.startDevMode(Reloader.scala:223) at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.devModeServer$lzycompute$1(PlayRun.scala:74) at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.play$sbt$run$PlayRun$$anonfun$$anonfun$$anonfun$$devModeServer$1(PlayRun.scala:74) at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.apply(PlayRun.scala:100) at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.apply(PlayRun.scala:53) at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47) 

If you look at the version numbers, I think this is due to the fact that we use akka-actor 2.4.0-RC2, and the activator uses 2.3. Is there a way to force the activator to use 2.4? Or do I need to wait for a new activator release?

I tried adding

  "com.typesafe.akka" % "akka-actor_2.11" % "2.4.0-RC2" 

to libraryDependencies , but it gave a warning about the evicted dependency and the same error as not found.

I am not very familiar with the interaction between play and activator . If there is a way to do this work, getting rid of one of them without adding a lot of extra work, that's fine too.

+5
source share
1 answer

I do not think this is a version issue. This seems like a problem with Slf4j.

Try adding akka-slf4j to built.sbt :

  libraryDependencies += "com.typesafe.akka" %% "akka-slf4j" % "2.3.6" 

Update

For akka 2.4.0 actor, you need to add the version of slf4j version 2.4.0:

  libraryDependencies += "com.typesafe.akka" %% "akka-slf4j" % "2.4.0" 
+7
source

Source: https://habr.com/ru/post/1234159/


All Articles