我正在尝试将SecureSocial scala / demo(3.0-M1-play-2.2.x)集成到我自己的Play应用程序中。
我从演示中复制了Scala文件并添加了一个securesocial.conf并扩展了我的路由文件以链接到SecureSocial路由。
编译很好,但是当我尝试运行时,我得到以下异常:
[error] application -
! Internal server error, for (GET) [/] ->
java.lang.reflect.InvocationTargetException: null
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_25]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_25]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_25]
at java.lang.reflect.Constructor.newInstance(Constructor.java:408) ~[na:1.8.0_25]
at Global$$anonfun$2.apply(Global.scala:35) ~[na:na]
Caused by: java.lang.NoSuchMethodError: play.api.mvc.Results$Status.apply(Ljava/lang/Object;Lplay/api/http/Writeable;)Lplay/api/mvc/SimpleResult;
at securesocial.core.SecureSocial$class.$init$(SecureSocial.scala:46) ~[securesocial_2.10-3.0-M1-play-2.2.x.jar:3.0-M1-play-2.2.x]
at controllers.Application.<init>(Application.scala:23) ~[na:na]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_25]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_25]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_25]
Global.scla:35是:
来自示例的getControllerInstance方法行是:
_.asInstanceOf[Constructor[A]].newInstance(MyRuntimeEnvironment)
所以看起来它无法实例化应用程序类,应用程序类的头部如下所示:
class Application(override implicit val env: RuntimeEnvironment[DemoUser]) extends securesocial.core.SecureSocial[DemoUser] {
这个例子正在运作,但我自己的项目不是,我无法弄清楚问题,如果有人可以帮助我,我会很高兴。
答案 0 :(得分:0)
好的,我发现了错误。
我不得不使用:
"ws.securesocial" %% "securesocial" % "master-SNAPSHOT"
代替:
"ws.securesocial" % "securesocial_2.10" % "3.0-M1-play-2.2.x"