SecureSocial InvocationTargetException

79 Views Asked by At

I'm trying to get the SecureSocial scala/demo (3.0-M1-play-2.2.x) integrated in my own Play app.

I copied the Scala files from the demo and added a securesocial.conf and extended my routes file to link to the SecureSocial routes.

Compilation is fine but when I am trying to run I get the following exception:

[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 is: the getControllerInstance Method from the example the line is: _.asInstanceOf[Constructor[A]].newInstance(MyRuntimeEnvironment)

So it looks like it can not instantiate the Application Class the header of the application class looks like: class Application(override implicit val env: RuntimeEnvironment[DemoUser]) extends securesocial.core.SecureSocial[DemoUser] {

The example is working but my own project isn't, I can't figure out the problem and would be glad if someone could help me.

1

There are 1 best solutions below

1
On

Ok I found the error.

I had to use: "ws.securesocial" %% "securesocial" % "master-SNAPSHOT"

instead of: "ws.securesocial" % "securesocial_2.10" % "3.0-M1-play-2.2.x"