3

我是使用 Play 框架的新手,我正在尝试使用 Facebook-OAuth2 提供程序将 SecureSocial 插件合并到我的应用程序中。当我向以下位置发送 GET 请求时遇到了这个错误/login

! @6apkmf9m3 - Internal server error, for request [GET /login] ->

play.core.ActionInvoker$$anonfun$receive$1$$anon$1: Execution exception [[NoSuchMethodError: securesocial.controllers.ReverseLoginPage.authenticate(Ljava/lang/String;)Lplay/api/mvc/Call;]]
    at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:134) [play_2.9.1.jar:2.0.2]
    at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:115) [play_2.9.1.jar:2.0.2]
    at akka.actor.Actor$class.apply(Actor.scala:318) [akka-actor.jar:2.0.2]
    at play.core.ActionInvoker.apply(Invoker.scala:113) [play_2.9.1.jar:2.0.2]
    at akka.actor.ActorCell.invoke(ActorCell.scala:626) [akka-actor.jar:2.0.2]
    at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:197) [akka-actor.jar:2.0.2]
Caused by: java.lang.NoSuchMethodError: securesocial.controllers.ReverseLoginPage.authenticate(Ljava/lang/String;)Lplay/api/mvc/Call;
    at securesocial.core.IdentityProvider.authenticationUrl(IdentityProvider.scala:86) ~[classes/:na]
    at securesocial.views.html.login$$anonfun$apply$3$$anonfun$apply$4.apply(login.template.scala:44) ~[classes/:na]
    at securesocial.views.html.login$$anonfun$apply$3$$anonfun$apply$4.apply(login.template.scala:43) ~[classes/:na]
    at play.templates.TemplateMagic$.defining(ScalaTemplates.scala:756) ~[templates_2.9.1.jar:2.0.2]
    at securesocial.views.html.login$$anonfun$apply$3.apply(login.template.scala:43) ~[classes/:na]
    at securesocial.views.html.login$$anonfun$apply$3.apply(login.template.scala:42) ~[classes/:na]
  • 有人可以提示我在哪里可以找到有关此错误的更多信息吗?
  • Play 如何工作从securesocial.controllers.ReverseLoginPagesecuresocial.controllers.LoginPage,前者存在于模块中?
4

2 回答 2

4

来自Play 2 文档

对于路由文件中使用的每个控制器,路由器将在路由包中生成一个“反向控制器”,具有相同的操作方法,具有相同的签名,但返回的是 play.api.mvc.Call 而不是 play.api .mvc.动作。

我认为这就是它的ReverseLoginPage来源,但我不知道是什么失败了。也许路线中有一些错误,或者仍然存在的旧课程。尝试运行clean,以确保不是这样。

于 2012-07-02T18:38:14.147 回答
0

即使我是新手玩框架。我现在不知道为什么,但这与您的路线文件有关。这是因为securesocial 正在尝试调用您的配置中未提供路线的操作。试试这个示例路线,可以尝试通过删除您认为不必要的路线来进行调试,以获得您缺少的一条路线。

# Routes
# This file defines all application routes (Higher priority routes first)
# ~~~~

# Home page
GET     /                           controllers.Application.index()




# Map static resources from the /public folder to the /assets URL path
GET     /assets/*file               controllers.Assets.at(path="/public", file)

# Login page
GET     /login                      securesocial.controllers.LoginPage.login
GET     /logout                     securesocial.controllers.LoginPage.logout

# User Registration and password handling (only needed if you are using UsernamePasswordProvider)
GET     /signup                     securesocial.controllers.Registration.startSignUp
POST    /signup                     securesocial.controllers.Registration.handleStartSignUp
GET     /signup/:token              securesocial.controllers.Registration.signUp(token)
POST    /signup/:token              securesocial.controllers.Registration.handleSignUp(token)
GET     /reset                      securesocial.controllers.Registration.startResetPassword
POST    /reset                      securesocial.controllers.Registration.handleStartResetPassword
GET     /reset/:token               securesocial.controllers.Registration.resetPassword(token)
POST    /reset/:token               securesocial.controllers.Registration.handleResetPassword(token)
GET     /password                   securesocial.controllers.PasswordChange.page
POST    /password                   securesocial.controllers.PasswordChange.handlePasswordChange


# Providers entry points
GET     /authenticate/:provider     securesocial.controllers.ProviderController.authenticate(provider)
POST    /authenticate/:provider     securesocial.controllers.ProviderController.authenticateByPost(provider)
GET     /not-authorized             securesocial.controllers.ProviderController.notAuthorized

它适用于我的 play 2.2.0 版本,安全社交位于 master-SNAPSHOT。

于 2013-12-26T10:15:17.970 回答