Reputation: 173
I tried to migrate my Play 2.4.6 project to Play 2.5.8 following the official migration guide: https://www.playframework.com/documentation/2.5.x/Migration25
After the Database successfully connects i get the following error message (Full Stacktrace):
[info] p.a.d.DefaultDBApi - Database [default] connected at XXX;
[error] application -
! @71in3ncdp - Internal server error, for (GET) [/de] ->
play.api.UnexpectedException: Unexpected exception[CreationException: Unable to create injector, see the following errors:
1) Error in custom provider, java.lang.NullPointerException
while locating play.api.db.evolutions.ApplicationEvolutionsProvider
at play.api.db.evolutions.EvolutionsModule.bindings(EvolutionsModule.scala:22):
Binding(class play.api.db.evolutions.ApplicationEvolutions to ProviderConstructionTarget(class play.api.db.evolutions.ApplicationEvolutionsProvider) eagerly) (via modules: com.google.inject.util.Modules$OverrideModule -> play.api.inject.guice.GuiceableModuleConversions$$anon$1)
while locating play.api.db.evolutions.ApplicationEvolutions
1 error]
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(DevServerStart.scala:180)
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(DevServerStart.scala:131)
at scala.Option.map(Option.scala:146)
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1.apply(DevServerStart.scala:131)
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1.apply(DevServerStart.scala:129)
at scala.util.Success.flatMap(Try.scala:231)
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1.apply(DevServerStart.scala:129)
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1.apply(DevServerStart.scala:121)
at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
Caused by: com.google.inject.CreationException: Unable to create injector, see the following errors:
1) Error in custom provider, java.lang.NullPointerException
while locating play.api.db.evolutions.ApplicationEvolutionsProvider
at play.api.db.evolutions.EvolutionsModule.bindings(EvolutionsModule.scala:22):
Binding(class play.api.db.evolutions.ApplicationEvolutions to ProviderConstructionTarget(class play.api.db.evolutions.ApplicationEvolutionsProvider) eagerly) (via modules: com.google.inject.util.Modules$OverrideModule -> play.api.inject.guice.GuiceableModuleConversions$$anon$1)
while locating play.api.db.evolutions.ApplicationEvolutions
1 error
at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:466)
at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:184)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
at com.google.inject.Guice.createInjector(Guice.java:96)
at com.google.inject.Guice.createInjector(Guice.java:84)
at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:181)
at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:123)
at play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21)
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1$$anonfun$2.apply(DevServerStart.scala:168)
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1$$anonfun$2.apply(DevServerStart.scala:164)
Caused by: java.lang.NullPointerException: null
at com.avaje.ebean.config.dbplatform.DatabasePlatform.createDdlHandler(DatabasePlatform.java:209)
at com.avaje.ebean.dbmigration.model.CurrentModel.handler(CurrentModel.java:150)
at com.avaje.ebean.dbmigration.model.CurrentModel.createDdl(CurrentModel.java:141)
at com.avaje.ebean.dbmigration.model.CurrentModel.getCreateDdl(CurrentModel.java:107)
at play.db.ebean.EbeanDynamicEvolutions.generateEvolutionScript(EbeanDynamicEvolutions.java:93)
at play.db.ebean.EbeanDynamicEvolutions.lambda$create$4(EbeanDynamicEvolutions.java:59)
at java.util.HashMap.forEach(HashMap.java:1280)
at play.db.ebean.EbeanDynamicEvolutions.create(EbeanDynamicEvolutions.java:58)
at play.api.db.evolutions.ApplicationEvolutions.start(ApplicationEvolutions.scala:40)
at play.api.db.evolutions.ApplicationEvolutions.<init>(ApplicationEvolutions.scala:150)
The strange thing is, i don't use the Play Evolutions, i even disabled it in application.conf:
play.evolutions.enabled=false
Upvotes: 2
Views: 5782
Reputation: 173
I just solved the problem myself.
The Evolutions Module has to be disabled with an additional line in the config file, so i have this two lines in my application.conf now:
play.evolutions.enabled=false
play.modules.disabled += "play.api.db.evolutions.EvolutionsModule"
I don't really get why this is needed and why it isn't documented in https://www.playframework.com/documentation/2.5.x/Evolutions
Hopefully it will help someone in the future.
Upvotes: 6