użycie wtyczki guice z aktorem powoduje wyświetlenie wskaźnika zerowego
Otrzymuję wyjątek wskaźnika zerowego na iniekcji pola serwera, który jest uruchamiany jako akka actor.
Część harmonogramowa:
private ActorRef myActor = Akka.system().actorOf(
new Props(Retreiver.class));
@Override
public void onStart(Application app) {
log.info("Starting schedular.....!");
Akka.system()
.scheduler()
.schedule(Duration.create(0, TimeUnit.MILLISECONDS),
Duration.create(30, TimeUnit.MINUTES), myActor, "tick",
Akka.system().dispatcher());
}
Część klasy Retreiver:
public class Retreiver extends UntypedActor {
private Logger.ALogger log = Logger.of(Retreiver .class);
@Inject
private myDataService dataService;
@Override
public void onReceive(Object arg0) throws Exception {
if (0 != dataService.getDataCount()) {
....
....
....
}
}
Otrzymuję wartość null dla usługi danych. Proszę o radę w tej sprawie.
Dzięki.