play-samples icon indicating copy to clipboard operation
play-samples copied to clipboard

play-java-dagger2-example inject JPAApi

Open zakharovsergey1000 opened this issue 3 years ago • 0 comments

I am exploring the play-java-dagger2-example project. I tried to get JPAApi instance from MyComponentsFromContext like this:

JPAApi jpaApi = application().injector().instanceOf(JPAApi.class);

But this throws [NoSuchMethodException: play.db.jpa.JPAApi.<init>()] What is the correct way to get JPAApi with Dagger 2?

zakharovsergey1000 avatar Jul 17 '22 19:07 zakharovsergey1000