0

I've followed through this docs http://doc.akka.io/docs/akka/snapshot/scala/microkernel.html#microkernel-scala to make standalaone akka app using microkernel. I have fulfilled its dependecies and sbt plugins. Here's my main class :

package id.nolimit.platform.store.actor

import com.typesafe.config.ConfigFactory
import akka.actor.ActorSystem
import akka.actor.Props
import akka.routing.RoundRobinRouter
import akka.kernel.Bootable

object AppMainKernel extends Bootable{
    val system = ActorSystem("PlatformStore", ConfigFactory.load().getConfig("RemoteSys"))

    def startup = {
        val storeActor = system.actorOf(Props(new StoreActor).withDispatcher("dispatcher").withRouter(RoundRobinRouter(nrOfInstances = 5)), name = "storeActor")
    }

    def shutdown = {
        system.shutdown()
    }
}

what's really happen with thread 'main' ? Thank you :)

ans4175
  • 432
  • 1
  • 9
  • 23
  • Can you post the code for `StoreActor`? An `InstantiationException` usually stems from incorrect creation of actor via `Props` or a failure in the constructor/pre-start code of the actor. – cmbaxter Dec 15 '14 at 13:07

1 Answers1

1

Change your AppMainKernal from an object to a class. The code that boots up your Bootable is trying to instantiate it via reflection but can't because it's defined as an object (singleton with non-visible constructor) and not a class.

cmbaxter
  • 35,283
  • 4
  • 86
  • 95
  • It works like a charm and yes it was my dumb mistake. Thank you very much. Just like tutorial said http://doc.akka.io/docs/akka/snapshot/scala/microkernel.html#microkernel-scala it should be a class :) – ans4175 Dec 16 '14 at 04:02