2
我嘗試將Swagger附加到Play Framework應用程序時遇到問題。 Swagger lib掃描未初始化的類並導致問題。任何建議如何處理?Swagger-play在應用程序初始化期間拋出異常
我提取的應用程序的一部分,如例如:
https://github.com/mgosk/play-swagger-example
CreationException: Unable to create injector, see the following errors:
1) Error injecting constructor, java.lang.RuntimeException: There is no started application
at auth.services.AuthService.<init>(AuthService.scala:24)
while locating auth.services.AuthService
for parameter 0 at auth.AnonymousAuthController.<init>(AuthController.scala:16)
while locating auth.AnonymousAuthController
for parameter 1 at router.Routes.<init>(Routes.scala:43)
while locating router.Routes
while locating play.api.inject.RoutesProvider
while locating play.api.routing.Router
for parameter 1 at play.modules.swagger.SwaggerPluginImpl.<init>(SwaggerPlugin.scala:33)
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
你最終修好了嗎?我有同樣的問題。 – Damian
@Damian號我沒有修復它。 – mgosk
@Damian問題在最新版本的版本中得到解決 – mgosk