22

我想知道..你把application.conf配置演员的文件放在哪里?我正在尝试做这里正在做的事情,但 SBT 没有收到文件 - 我的印象是 SBT 会找到application.conf并自动将其添加到我的-classpath. 我目前application.conf/project/application.conf

我得到的错误是:

[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)

谢谢!-kstruct

4

2 回答 2

40

如果你把它放进去,它应该最终出现在类路径中src/main/resources/application.conf

于 2012-04-12T01:04:19.380 回答
0

刚刚更新:

//  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
于 2017-12-06T11:16:24.833 回答