【发布时间】:2013-05-17 21:39:13
【问题描述】:
我已在我的应用中添加了一个 Akka 演员,可与 Spring 和 OSGI 配合使用。
我尝试像这样使用来自Spring @Component bean 的Actor:
private final ActorSystem system = ActorSystem.create("actor-system");
private ActorRef managerActorRef = system.actorOf(Props.create(ManagerActor.class), "ldapManagerActor");
当我启动应用程序时,它会引发异常 (No configuration setting found for key 'akka'):
Instantiation of bean failed; nested exception is org.springframework.
beans.BeanInstantiationException: Could not instantiate bean class [com.myconpany....ByBean]: Constructor threw exception; nested exception is com.typesafe.config.ConfigException$Missing: No configuration setting found for key 'akka'
我看过this: doc。似乎我的问题的根源与class loader 有关,我应该将其传递给/用于描述此问题的akka-system 和application.conf 文件。
但到目前为止,我找不到合适的 stets 来完成所有工作。
有人可以帮忙吗?
我的尝试:
流动的this 文章。
当我输入时:
<bean id="actorSystem" class="akka.actor.ActorSystem" factory-method="create" scope="singleton"></bean>
我有类似的错误:
Could not autowire field: private akka.actor.ActorSystem
com.typesafe.config.ConfigException$Missing: No configuration setting fou
nd for key 'akka'
【问题讨论】:
-
你有没有 application.conf 文件,如果有,你能把它贴出来,并告诉我该文件是否在类路径的根目录下可用。
-
已经有了。我刚刚把 akka-actor_.jar/referece.conf 的所有内容都放在那里。它似乎开始工作了。很快就会检查。
标签: spring configuration osgi classloader akka