adelbertc
adelbertc

Reputation: 7320

application.conf for Scala SBT Akka Actors

I was wondering.. where do you put the application.conf file that configures actors in a file? I'm trying to do what is being done here but SBT is not picking up on the file - I was under the impression that SBT will find the application.conf and automatically add it to my -classpath. I currently have application.conf in /project/application.conf

The error I'm getting is:

[ERROR] [04/11/2012 16:08:13.174] [HittingTimeSystem-akka.actor.default-dispatcher-2] [akka://HittingTimeSystem/user/master] error while creating actor
akka.config.ConfigurationException:router Actor[akka://HittingTimeSystem/user/master/workerRouter] needs external configuration from file (e.g. application.conf)

Thanks! -kstruct

Upvotes: 22

Views: 11148

Answers (2)

nexoma
nexoma

Reputation: 285

just update:

//  val conffactory = ConfigFactory.load() //  from 'src/test/resources' if 'sbt test'
//  val conffactory = ConfigFactory.load() //  from 'src/main/resources' if 'sbt run'
    val conf = ConfigFactory.parseFile(new File("config/application.conf")).getConfig("my") // from '/config' where / - root of app

Upvotes: 0

stew
stew

Reputation: 11366

It should end up on the classpath if you put it in src/main/resources/application.conf

Upvotes: 40

Related Questions