-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with inject dependencies service in job #3
Comments
Same issue here |
I surrendered to the problem by below: class SmsNotificationDaily @Inject()(actorSystem: ActorSystem)
} (but Guice throws a lot exceptions complaining to the dependencies, I am still search solutions for it here) |
I'm running into the same issue. @zuoky your workaround unfortunately results in java.lang.NullPointerException: null when I try call a function on the injected service. |
This library is not suitable for DI. You can see the class JobClassLoader, and it use reflection to get instance of out user-defined job, not with DI. I think the only way is to get the instance from DI by Play.current.injector.getInstance, but it is depreted after play 2.5. |
Hi, sorry for my English.
I want to use a task lib in my projec with Scala 2.12 and Play 2.6. When I set up and inject dependencies of play in it, it does not work because of the error: Could not find the default constructor with no parameters in: myClass for example: class Person @Inject()(actorSystem: ActorSystem, val carService: carService) extends AbstractConfigurationJob(actorSystem). The TestJobs do work correctly. Any suggestion?
Thanks
The text was updated successfully, but these errors were encountered: