KarelCemus / play-i18n

Multi-format localization plugin for Play framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Play 2.8 support

aljchristensen opened this issue · comments

Similar to #16, I'm running into issues migrating from Play 2.7 to 2.8. I'm encountering the error below:

CreationException: Unable to create injector, see the following errors:

1) Error injecting constructor, java.lang.NoSuchMethodError: 'void play.api.i18n.DefaultMessagesApi.<init>(scala.collection.immutable.Map, play.api.i18n.Langs, java.lang.String, boolean, boolean, scala.Option, play.api.http.HttpConfiguration)'
  at play.ext.i18n.MultiFormatMessagesApi.<init>(MultiFormatMessagesModule.scala:16)
  at play.ext.i18n.MultiFormatMessagesApi.class(MultiFormatMessagesModule.scala:16)
  while locating play.ext.i18n.MultiFormatMessagesApi
  while locating play.api.i18n.MessagesApi
    for the 1st parameter of play.i18n.MessagesApi.<init>(MessagesApi.java:32)
  at play.ext.i18n.MultiFormatMessagesModule.bindings(MultiFormatMessagesModule.scala:53):
Binding(class play.i18n.MessagesApi to self) (via modules: com.google.inject.util.Modules$OverrideModule -> play.api.inject.guice.GuiceableModuleConversions$$anon$4)
  while locating play.i18n.MessagesApi
...

Do you plan to support Play 2.8? Thank you!

I wasn't but I can. I didn't know that somebody actually uses this library. I will look at it probably today and see what I can do

Released version 2.1.0, should be in maven repos in a couple of hours. Are you willing to test it and give me some feedback? I slightly revamped the provider of MessagesApi so I hope it works

As far as I can tell, everything seems to be working as expected with the new release. Thanks so much for taking a look at this so quickly.

Happy to hear, thanks for the feedback

Hi @KarelCemus i am using 2.8.16 and still seeing this issue
[info] java.lang.NoSuchMethodError: 'void play.api.i18n.DefaultMessagesApi.<init>(scala.collection.immutable.Map, play.api.i18n.Langs, java.lang.String, boolean, boolean, scala.Option, play.api.http.HttpConfiguration)'
could you please direct me to the version with the fix.

Which version of play-i18n are you using? Btw it is more convenient if you can provide the full stacktrace or at least the significant part of it, since errors without any context cannot be debugged or reproduced

Thanks for replying. I don't have a dependency defined for play-118n. Here is trace
[info] java.lang.NoSuchMethodError: 'void play.api.i18n.DefaultMessagesApi.<init>(scala.collection.immutable.Map, play.api.i18n.Langs, java.lang.String, boolean, boolean, scala.Option, play.api.http.HttpConfiguration)' [info] at com.xx.xxx.xxx.util.test.playHelpers$.defaultControllerComponents(playHelpers.scala:183) [info] at controllers.GraphQLControllerTest$TestEnv.createGqlController(GraphQLControllerTest.scala:415) [info] at controllers.GraphQLControllerTest$TestEnv.<init>(GraphQLControllerTest.scala:379)

If you don't use have a dependency on play-i18n then you don't have an error related to this library :-) The name of this lib is a bit unfortunate but this is not the official play-i18n dependency, this is a custom implementation. Therefore it is not wired to your project

Your code at com.xx.xxx.xxx.util.test.playHelpers$.defaultControllerComponents(playHelpers.scala:183) is complied against a different/old version of play, I guess