Play Framework Error injecting constructor, java.lang.NoSuchMethodError in controller

1.9k views Asked by At

Play 2.6.6, Scala 2.12.3. I'm using a library to implement authentication

The full error is:

ProvisionException: Unable to provision, see the following errors:

1) Error injecting constructor, java.lang.NoSuchMethodError: jp.t2v.lab.play2.stackc.StackableController.$init$(Ljp/t2v/lab/play2/stackc/StackableController;)

The controller that is causing the error is implemented like this:

class AuthController @Inject() (override val accountsTable: Accounts) extends Controller with AuthElement with AuthConfigImpl {

StackableController is used in the AuthElement trait as follows:

trait AuthElement extends StackableController with AsyncAuth {

which is itself a trait.

I cannot figure out why the DI system is failing on this piece of the library. This code has worked previously for me, but it was a Play 2.4.x project

1

There are 1 answers

0
cbley On

You cannot use a Play 2.4 module within a Play 2.6 project. APIs have changed, which is indicated by the minor version bump. The play2-auth module seems to be unmaintained for some while, at least there is a PR for Play 2.6 support: https://github.com/t2v/play2-auth/pull/191 ...