joscha / play-authenticate

An authentication plugin for Play Framework 2.x (Java)
http://joscha.github.com/play-authenticate/
Other
807 stars 366 forks source link

NullPointerException on registration #296

Closed popovoleksandr closed 8 years ago

popovoleksandr commented 8 years ago

Play-authenticate: 0.7.1 Play-framework: 2.4.6 Scala version: 2.11.6 Sbt version: 0.13.8

It worked before but unfortunately stopped recently. Could you please help me? Exception in console:

! @6pc522g00 - Internal server error, for (GET) [/authenticate/facebook?code=*****&state=****] ->

play.api.http.HttpErrorHandlerExceptions$$anon$1: Execution exception[[NullPointerException: null]]
    at play.api.http.HttpErrorHandlerExceptions$.throwableToUsefulException(HttpErrorHandler.scala:265) ~[play_2.11-2.4.6.jar:2.4.6]
    at play.api.http.DefaultHttpErrorHandler.onServerError(HttpErrorHandler.scala:191) ~[play_2.11-2.4.6.jar:2.4.6]
    at play.api.GlobalSettings$class.onError(GlobalSettings.scala:179) [play_2.11-2.4.6.jar:2.4.6]
    at play.core.j.JavaGlobalSettingsAdapter.play$core$j$JavaGlobalSettingsAdapter$$super$onError(JavaGlobalSettingsAdapter.scala:36) [play_2.11-2.4.6.jar:2.4.6]
    at play.core.j.JavaGlobalSettingsAdapter$$anonfun$onError$2.apply(JavaGlobalSettingsAdapter.scala:36) [play_2.11-2.4.6.jar:2.4.6]
    at play.core.j.JavaGlobalSettingsAdapter$$anonfun$onError$2.apply(JavaGlobalSettingsAdapter.scala:36) [play_2.11-2.4.6.jar:2.4.6]
    at scala.Option.getOrElse(Option.scala:121) [scala-library-2.11.7.jar:na]
    at play.core.j.JavaGlobalSettingsAdapter.onError(JavaGlobalSettingsAdapter.scala:36) [play_2.11-2.4.6.jar:2.4.6]
    at play.api.http.GlobalSettingsHttpErrorHandler.onServerError(HttpErrorHandler.scala:94) [play_2.11-2.4.6.jar:2.4.6]
    at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$9$$anonfun$apply$1.applyOrElse(PlayDefaultUpstreamHandler.scala:151) [play-netty-server_2.11-2.4.6.jar:2.4.6]
Caused by: java.lang.NullPointerException: null
    at models.User.create(User.java:185) ~[classes/:2.4.6]
    at service.MyUserServicePlugin.save(MyUserServicePlugin.java:22) ~[classes/:na]
    at com.feth.play.module.pa.PlayAuthenticate.signupUser(PlayAuthenticate.java:418) ~[play-authenticate_2.11-0.7.1.jar:0.7.1]
    at com.feth.play.module.pa.PlayAuthenticate.handleAuthentication(PlayAuthenticate.java:534) ~[play-authenticate_2.11-0.7.1.jar:0.7.1]
    at com.feth.play.module.pa.controllers.Authenticate.authenticate(Authenticate.java:13) ~[play-authenticate_2.11-0.7.1.jar:0.7.1]
    at router.Routes$$anonfun$routes$1$$anonfun$applyOrElse$8$$anonfun$apply$8.apply(Routes.scala:834) ~[classes/:na]
    at router.Routes$$anonfun$routes$1$$anonfun$applyOrElse$8$$anonfun$apply$8.apply(Routes.scala:834) ~[classes/:na]
    at play.core.routing.HandlerInvokerFactory$$anon$4.resultCall(HandlerInvoker.scala:136) ~[play_2.11-2.4.6.jar:2.4.6]
    at play.core.routing.HandlerInvokerFactory$JavaActionInvokerFactory$$anon$14$$anon$3$$anon$1.invocation(HandlerInvoker.scala:127) ~[play_2.11-2.4.6.jar:2.4.6]
    at play.core.j.JavaAction$$anon$1.call(JavaAction.scala:70) ~[play_2.11-2.4.6.jar:2.4.6]

Exception on screen:

[NullPointerException: null]
In [project-dir]\target\scala-2.11\routes\main\router\Routes.scala:834
831    // @LINE:17
832    case com_feth_play_module_pa_controllers_Authenticate_authenticate7_route(params) =>
833      call(params.fromPath[String]("provider", None)) { (provider) =>
834        com_feth_play_module_pa_controllers_Authenticate_authenticate7_invoker.call(com.feth.play.module.pa.controllers.Authenticate.authenticate(provider))
835      }
836  
837    // @LINE:19
838    case controllers_Application_signup8_route(params) =>
839      call { 
popovoleksandr commented 8 years ago

Same thing for Google also:

[NullPointerException: null]
In [project-dir]\target\scala-2.11\routes\main\router\Routes.scala:834
831    // @LINE:17
832    case com_feth_play_module_pa_controllers_Authenticate_authenticate7_route(params) =>
833      call(params.fromPath[String]("provider", None)) { (provider) =>
834        com_feth_play_module_pa_controllers_Authenticate_authenticate7_invoker.call(com.feth.play.module.pa.controllers.Authenticate.authenticate(provider))
835      }
836  
837    // @LINE:19
838    case controllers_Application_signup8_route(params) =>
839      call { 
popovoleksandr commented 8 years ago

Strange added double quotes before and after key values in mine.conf and that worked. But that worked for me previously... one word its strange - could that be the issue?

joscha commented 8 years ago

So with double quotes the issue was resolved?

popovoleksandr commented 8 years ago

Is is possible that not only - with magic "clean compile run" but I may be wrong

quentinous commented 7 years ago

Double quotes solve the problem.