As Rob suggested, please have it in your classpath, if you are using maven
it should be in " src/main/resources"
On Wednesday, October 5, 2016 at 12:53:22 PM UTC-4, Luigi D'Onofrio wrote:
>
> I have it in *myproject/src/* directory but i got error:
>
> [ERROR] [10/05/2016 17:21:33.097] [System-akka.actor.default-dispatcher-3]
> [akka://System/user/master] null
> akka.actor.ActorInitializationException: exception during creation
> at akka.actor.ActorInitializationException$.apply(Actor.scala:166)
> at akka.actor.ActorCell.create(ActorCell.scala:596)
> at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:456)
> at akka.actor.ActorCell.systemInvoke(ActorCell.scala:478)
> at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:263)
> at akka.dispatch.Mailbox.run(Mailbox.scala:219)
> at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(
> AbstractDispatcher.scala:397)
> at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260
> )
> at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(
> ForkJoinPool.java:1339)
> at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:
> 1979)
> at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(
> ForkJoinWorkerThread.java:107)
> Caused by: java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(
> NativeConstructorAccessorImpl.java:57)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
> DelegatingConstructorAccessorImpl.java:45)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
> at akka.util.Reflect$.instantiate(Reflect.scala:66)
> at akka.actor.ArgsReflectConstructor.produce(Props.scala:355)
> at akka.actor.Props.newActor(Props.scala:255)
> at akka.actor.ActorCell.newActor(ActorCell.scala:552)
> at akka.actor.ActorCell.create(ActorCell.scala:578)
> ... 9 more
> Caused by: akka.ConfigurationException: configuration problem while
> creating [akka://System/user/master/router1] with router dispatcher
> [akka.actor.default-dispatcher] and mailbox [akka.actor.default-mailbox]
> and routee dispatcher [akka.actor.default-dispatcher] and mailbox
> [akka.actor.default-mailbox]
> at akka.actor.LocalActorRefProvider.actorOf(ActorRefProvider.scala:753
> )
> at akka.actor.dungeon.Children$class.makeChild(Children.scala:206)
> at akka.actor.dungeon.Children$class.actorOf(Children.scala:37)
> at akka.actor.ActorCell.actorOf(ActorCell.scala:369)
> at Actors.Master.<init>(Master.java:27)
> ... 18 more
> Caused by: akka.ConfigurationException: Configuration missing for router [
> akka://System/user/master/router1] in 'akka.actor.deployment' section.
> at akka.routing.FromConfig.verifyConfig(RouterConfig.scala:297)
> at akka.routing.RoutedActorRef.<init>(RoutedActorRef.scala:40)
> at akka.actor.LocalActorRefProvider.actorOf(ActorRefProvider.scala:751
> )
> ... 22 more
>
> I got this running this:
> this.workerRouter = getContext().actorOf(Props.create(Worker.class).
> withRouter(new FromConfig()), "router1");
>
> and my application.conf is:
>
> akka{
> actor{
> deployment {
> /master/router1 {
> router = round-robin-pool
> nr-of-instances = 5
> }
> }
> }
> }
>
>
>
>
>
>
> Rob Crawford ha scritto:
>>
>> At run-time it should be in your classpath, at the top-most level.
>>
>> If you're using the Maven project structure, that would be in
>> src/main/resources
>>
>>
>> On Tuesday, October 4, 2016 at 3:09:48 PM UTC-4, Luigi D'Onofrio wrote:
>>>
>>> Hello guys, i'm farely new to Akka and i'm loving it.
>>> Today i was trying to create a router using configuration file, but i
>>> can't figure where the application.conf file should be located and how it
>>> should be written correctly, can you give me some advise and maybe an
>>> example?
>>>
>>> Currently using Java 7 + Akka 2.3.15 - Eclipse as IDE.
>>> Thanks in advance!
>>>
>>
> Il giorno mercoledì 5 ottobre 2016 16:57:04 UTC+2, Rob Crawford ha scritto:
>>
>> At run-time it should be in your classpath, at the top-most level.
>>
>> If you're using the Maven project structure, that would be in
>> src/main/resources
>>
>>
>> On Tuesday, October 4, 2016 at 3:09:48 PM UTC-4, Luigi D'Onofrio wrote:
>>>
>>> Hello guys, i'm farely new to Akka and i'm loving it.
>>> Today i was trying to create a router using configuration file, but i
>>> can't figure where the application.conf file should be located and how it
>>> should be written correctly, can you give me some advise and maybe an
>>> example?
>>>
>>> Currently using Java 7 + Akka 2.3.15 - Eclipse as IDE.
>>> Thanks in advance!
>>>
>>
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.