Note that there are some explanatory texts on larger screens.

plurals
  1. POPlay Framework: How to log in using POST?
    primarykey
    data
    text
    <p>I'm developing a web service using Play Framework. My next step is to log in using module secure. However, Im getting a nullpointer exception as the following:</p> <pre><code>play.exceptions.JavaExecutionException at play.mvc.ActionInvoker.invoke(ActionInvoker.java:227) at Invocation.HTTP Request(Play!) Caused by: java.lang.NullPointerException at play.utils.Java.invokeStaticOrParent(Java.java:146) at controllers.Secure$Security.invoke(Secure.java:193) at controllers.Secure$Security.access$0(Secure.java:184) at controllers.Secure.authenticate(Secure.java:61) at play.mvc.ActionInvoker.invokeWithContinuation(ActionInvoker.java:540) at play.mvc.ActionInvoker.invoke(ActionInvoker.java:498) at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:474) at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:469) at play.mvc.ActionInvoker.invoke(ActionInvoker.java:157) ... 1 more </code></pre> <p>According to <a href="https://stackoverflow.com/questions/5762246/playframework-secure-module-how-do-you-log-in-to-test-a-secured-controller-in">Playframework Secure module: how do you &quot;log in&quot; to test a secured controller in a FunctionalTest?</a> it's possible to do a post to /login, which I also have tested and it works perfectly in a test-case.</p> <p>To recreate nullpointer exception do the following:</p> <ol> <li>List item</li> <li>Create a new project</li> <li>Add the module secure as a dependency</li> <li>install the dependencies 'play dependencies'</li> <li>Restart web app.</li> <li>Send a post to /login. I have added two request headers (username and password), but the exception occurs both with and without any headers. The post is (in my case) sent using REST Client for Firefox.</li> </ol> <p>Thankful for any help!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload