Jacob Groundwater
Jacob Groundwater

Reputation: 6671

Cannot Access Play! Internal Actor System

I'm following the documentation here as I would like to add Actors to the application-provided actor system. I try to import the application actor system with:

import play.libs.concurrent.Akka

I'm using sbt compile to invoke my compilation and receive the following error

[error] app/controllers/Application.scala:9: object concurrent is not a member of package play.libs
[error] import play.libs.concurrent.Akka
[error]                  ^
[error] one error found

conf/pplication.conf

#Disable DBPlugin
dbplugin=disabled

#Disable DB evolutions
evolutionplugin=disabled

#Disable Eh Cache
ehcacheplugin=disabled


# Logger
# ~~~~~
# You can also configure logback (http://logback.qos.ch/), by providing a logger.xml file in the conf directory .

# Root logger:
logger.root=ERROR

# Logger used by the framework:
logger.play=INFO

# Logger provided to your application:
logger.application=DEBUG

akka.default-dispatcher.core-pool-size-max = 64
akka.debug.receive = on

project/Build.scala

import sbt._
import Keys._
import PlayProject._

object ApplicationBuild extends Build {

    val appName         = "SomeCoolApp"
    val appVersion      = "1.0"

    val appDependencies = Seq(
      // Add your project dependencies here,
      "com.typesafe.akka" % "akka-actor" % "2.+"
    )

    val main = PlayProject(appName, appVersion, appDependencies, mainLang = SCALA).settings(
      // Add your own project settings here      
    )

}

Upvotes: 1

Views: 1257

Answers (1)

Jacob Groundwater
Jacob Groundwater

Reputation: 6671

To access the Play! 2.0 internal actor system, use

import play.api.libs.concurrent.Akka.system

Refer to the API doc for the correct implementation.

Upvotes: 5

Related Questions