These are chat archives for adamw/macwire
I currently try to wire an actor with an implicit parameter. The project compiles but I get an
IllegalArgumentException at runtime.
The constructor looks as follow:
class Connector(brokerService: BrokerService)( implicit ec: ExecutionContext ) extends Actor with LazyLogging
The error is the follow:
java.lang.IllegalArgumentException: no matching constructor found on class app.actors.Connector for arguments [class app.models.services.BrokerServiceImpl]
If I remove the implicit parameter, all works as expected.
val connector: ActorRef = wireActor[Connector]("connector")The
BrokerServiceis injected in the class which instantiates the connector actor.
Props(classOf[Connector], brokerService)which is the non-typesafe way of creating new instances of actors
Props(new Connector(brokerService))things would work fine