要求失败:未配置默认日志插件,请参阅'reference.conf'

问题描述 投票:0回答:1

我在与cassandra一起使用persistentActor时遇到错误,我什至找不到问题所在,甚至在application.conf文件中将cassandra添加为日志。

错误

[ERROR] [04/29/2020 14:55:57.517] [main-akka.actor.default-dispatcher-3] [akka://main/user/localstoreactor] requirement failed: default journal plugin is not configured, see 'reference.conf'
akka.actor.ActorInitializationException: akka://main/user/localstoreactor: exception during creation
    at akka.actor.ActorInitializationException$.apply(Actor.scala:193)
    at akka.actor.ActorCell.create(ActorCell.scala:669)
    at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:523)
    at akka.actor.ActorCell.systemInvoke(ActorCell.scala:545)
    at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:283)
    at akka.dispatch.Mailbox.run(Mailbox.scala:224)
    at akka.dispatch.Mailbox.exec(Mailbox.scala:235)
    at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
    at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
    at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Caused by: java.lang.IllegalArgumentException: requirement failed: default journal plugin is not configured, see 'reference.conf'
    at scala.Predef$.require(Predef.scala:277)
    at akka.persistence.Persistence.defaultJournalPluginId$lzycompute(Persistence.scala:199)
    at akka.persistence.Persistence.defaultJournalPluginId(Persistence.scala:197)
    at akka.persistence.Persistence.journalConfigFor(Persistence.scala:283)
    at akka.persistence.Eventsourced.$init$(Eventsourced.scala:90)
    at section3.LocalStore.<init>(LocalStore.scala:10)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at java.lang.Class.newInstance(Class.java:442)
    at akka.util.Reflect$.instantiate(Reflect.scala:45)
    at akka.actor.NoArgsReflectConstructor.produce(IndirectActorProducer.scala:105)
    at akka.actor.Props.newActor(Props.scala:212)
    at akka.actor.ActorCell.newActor(ActorCell.scala:624)
    at akka.actor.ActorCell.create(ActorCell.scala:650)
    ... 9 more

[INFO] [04/29/2020 14:55:57.526] [main-akka.actor.default-dispatcher-3] [akka://main/user/localstoreactor] Message [java.lang.String] without sender to Actor[akka://main/user/localstoreactor#-328214976] was not delivered. [1] dead letters encountered. If this is not an expected behavior, then [Actor[akka://main/user/localstoreactor#-328214976]] may have terminated unexpectedly, This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
[INFO] [04/29/2020 14:55:57.527] [main-akka.actor.default-dispatcher-3] [akka://main/user/localstoreactor] Message [java.lang.String] without sender to Actor[akka://main/user/localstoreactor#-328214976] was not delivered. [2] dead letters encountered. If this is not an expected behavior, then [Actor[akka://main/user/localstoreactor#-328214976]] may have terminated unexpectedly, This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.

下面是我的配置文件

cassandrademo{
  akka.persistence.jornal.plugin =  "cassandra.journal"
  akka.persistence.snapshot-store{
    plugin = "cassandra-snapshot-store"
  }
}

我的代码

LocalStoreActor是我的演员

object Postgress extends App{


  val system = ActorSystem("main",ConfigFactory.load().getConfig("cassandrademo"))
  val localstore = system.actorOf(Props[LocalStoreActor],"localstoreactor");
  localstore ! "hello world"
  localstore ! "print"

}

我在与cassandra一起使用persistentActor期间遇到错误,我什至找不到问题所在,甚至我在应用程序.conf文件中将cassandra添加为日志错误[错误] [04/29/2020 14:55:57.517] [...] >

scala akka akka-cluster akka-persistence
1个回答
0
投票

问题是,Cassandra期望all these configs present in reference.conf。所以要么

  • [reference.confcassandrademo{}一起换行-以便可以使用该reference.conf的内容
© www.soinside.com 2019 - 2024. All rights reserved.