-
Notifications
You must be signed in to change notification settings - Fork 181
Play 2.5 and Unable to create injector #67
Comments
Probably cause they removed the plugin API in 2.5: https://playframework.com/documentation/2.5.x/Migration25#Removed-Plugins-API // possibly duplicates #66 |
could by, but I did add this to my application.conf per instructions: |
Is this change already in 1.5.1? benmccann@234eb63 It removes the Plugin Support and adds it as a Module. |
@poornerd Right. Just identified another reason... Play removed/changed iteratees in 2.5, so something in the Trying to bugfix it and provide a working version for 2.5... Please provide me with any imputs, if you have some ;) |
In 2.5 the IMHO, we have to rewrite the ApiHelpController streaming part from Iteratees to reactive streams to enable support for 2.5... Source:
EDIT: Application lifecycle has also changed. This results in rewriting the Any inputs @rayyildiz @poornerd @fehguy ? |
Just seen, that the stop-hook is already implemented in the Is the |
Just opened a PR in #68. Please post any further 2.5 related stuff there, if possible ;) |
Opened an update PR in #88 which currently seems to work perfectly for me. |
I met the same problem, I don't know how to solve,I need help,My email dev@bzdriver.com. |
I met the same problem too. I use swagger-play2 1.5.2 with play 2.5.4 |
Hi, is there any update to fix that problem in play 2.5.x? |
+1 is there an update to fix this problem in play 2.5.x? |
I am running into the same problem with play 2.5.4 with swagger-play2 1.5.2 |
Same problem here, Play 2.5.6 and swagger-play2 1.5.2 |
Same problem, Play 2.5.6 and swagger-play2 1.5.2. Does anyone have a forked solution for this? Is there any chance, 1.5.3 will be added to the maven repository? |
If you want use swagger with play 2.5.6 you can use our temporary fork git clone https://michal_zubkowicz@bitbucket.org/michal_zubkowicz/swagger-play.git and then in build.sbt: |
Hi, if a PR is ready to update the library I can push it to maven central. |
Experiencing the same issues, Is this resolved? |
Experiencing the same issue here. If anybody needs a temporary fix, use this guide and @michalzubkowicz's fork. Would really be nice to not have to go through the whole song and dance. |
Hi I am getting the same error on Play 2.5.4 with ( "io.swagger" %% "swagger-play2" % "1.5.3"). Any idea how to get it working is really appreciated. Regards, Ayache |
@akhettar I solved this by using the fork made by @michalzubkowicz above, and that guide which tells you how to pull |
@mach-kernel I tried cloning the repo but i had no access. Any advice would be appreciated Cloning into 'swagger-play'... |
Hi. I've updated original answer also. |
@michalzubkowicz Sorry but it still dosnt work for me 😢 Cloning into 'swagger-play'... Please make sure you have the correct access rights |
Hmm, it looks like some kind of bitbucket bug, this repository is public for sure. Try to clone by https, it should work then: |
@michalzubkowicz I was able to clone the repo via https . Thank you very much and have a nice day. |
@michalzubkowicz It seems like you used scala 2.10 for the module. Is there a work around to make it compatible with my 2.11.7 project? |
I'm using it in few 2.11.8 projects. What's the problem? |
@michalzubkowicz I'm sorry. I guess I dont fully understand how to use a local dependency with sbt on windows. |
You need to ask some Windows user :(, but did you ran sbt command wit publish-local for sure?
|
@michalzubkowicz Thank you very much. I forgot to use the "++2.11.7" argument so thats why it tried to use Scala 2.10. |
@michalzubkowicz I tried your branch 1.6.0-BTG locally with play 2.5.6, doesn't work. Below is the error: |
@sshanamplify , please re - read carefully documentation of swagger plugin. For sure it's working, I've been using it with that version of play for a while. |
If somebody is interested there is working for me version with Play 2.5.12: |
Hi @michalzubkowicz , I just tried your branch 1.6.0-BTG and still no good. Any updates now? I am using scala 2.11.8 and play 2.5.10. CreationException: Unable to create injector, see the following errors:
1) Error injecting constructor, java.util.ServiceConfigurationError: io.swagger.converter.ModelConverter: Provider io.swagger.scala.converter.SwaggerScalaModelConverter could not be instantiated
at play.modules.swagger.SwaggerPluginImpl.<init>(SwaggerPlugin.scala:39)
while locating play.modules.swagger.SwaggerPluginImpl
at play.modules.swagger.SwaggerModule.bindings(SwaggerModule.scala:11):
Binding(interface play.modules.swagger.SwaggerPlugin to ConstructionTarget(class play.modules.swagger.SwaggerPluginImpl) eagerly) (via modules: com.google.inject.util.Modules$OverrideModule -> play.api.inject.guice.GuiceableModuleConversions$$anon$1)
while locating play.modules.swagger.SwaggerPlugin |
@namco1992 , why don't you try official version? It's working now. |
The version 1.5.3 (which is not tagged) works. I think this issue could be closed |
There is much confusion from this and open issues still. See: - swagger-api#67 (comment) - swagger-api#95
hi iam having an error while starting server [info] application - ApplicationTimer demo: Starting application at 2017-12-15T08:29:19.146Z.
8 errors |
@Lveastcoast , I think it's not this case. It's problem with Your app: "No implementation for play.modules.reactivemongo.ReactiveMongoApi was bound." |
@michalzubkowicz but it runs in sbt run |
import javax.inject._ class DBConnectionController @Inject()(jobResult: JobResult, dBConnectionService: DBConnectionService) extends Controller { def index = Action { implicit request => def spiderData = Action.async(parse.json) { implicit request => def getLoadData = Action.async(parse.json) { implicit request => def getLoadFilter = Action.async(parse.json) { implicit request => def getConfigData = Action.async(parse.json) { implicit request => def getMapData = Action.async(parse.json) { def statsData = Action.async(parse.json) { implicit request => def groupStats = Action.async(parse.json) { implicit request => def getClusterData = Action.async(parse.json) { def parallelData = Action.async(parse.json) { implicit request => def overlayData = Action.async(parse.json) { implicit request => // val connection = Json.fromJsonPostEntity def scatterData = Action.async(parse.json) { implicit request => def getProfileData = Action.async(parse.json) { implicit request => def getTimelineData = Action.async(parse.json) { implicit request => private def handleValidationError(e: JsError): Future[Result] = Future.successful(Status(400)(Json.obj("errors" -> JsError.toJson(e).toString()))) |
this is my code |
import javax.inject.Inject class JobResult @Inject()(val reactiveMongoApi: ReactiveMongoApi) { /** Mongodb */ lazy val db = reactiveMongoApi.db def saveExportData(obj: JsObject, obj_id: Option[String]): String = { |
import javax.inject._ class DBConnectionService @Inject()(jobResult: JobResult) { |
it works fine in sbt run. but while i try to run in sbt dist and then project-SNAPSHOT/bin/bmw-smart-insight -Dconfig.file=:/dev/data2/bmw-smart-insight-2.0/target/universal/bmw-smart-insight-1.0-SNAPSHOT/conf/application.conf -Dplay.crypto.secret=="changeme" -Dhttp.address=127.0.0.1 -Dhttp.port=9001 |
i hope there is something wrong about reactiveMongoApi. database initialization is that the problem |
@Lveastcoast it's not a support forum, but bug report :). Your case it's not related to this issue. |
This saved my day !! Thanks a lot 👍 |
I added
swagger-play2
- 1.5.1 as described on this page: https://github.com/swagger-api/swagger-play/tree/master/play-2.4/swagger-play2BUT, I am getting this error, and can't get rid of it - does anyone else have this problem?
The text was updated successfully, but these errors were encountered: