I followed the tutorial introducing the Play framework, but it gives me an error:
Execution exception VerifyError occured : Expecting a stack map frame in method controllers.Secure$Security.authentify(Ljava/lang/String;Ljava/lang/String;)Z at offset 33
I'm not sure what I did wrong. The code I'm using (snippets):
package controllers;
..
@With(Secure.class)
public class Application extends Controller
{
@Before
public static void setConnectedUser()
{
if (Security.isConnected())
{
User user = User.find("byEmail", Security.connected()).first();
user.password = null;
renderArgs.put("user", user);
}
}
...
For the Security class:
package controllers;
import models.*;
public class Security extends Secure.Security {
static boolean authenticate(String username, String password) {
return User.connect(username, password) != null;
}
}
I also added the secure module to dependencies.yml which loads correctly after restarting Play framework. I added the secure model to my routes. Eclipse gives no errors; error only occurs on execution time. The Secure.Security class does actually have the public static isConnected method available. I'm using the most recent version for the Play framework (1.2.2).
The message group for Play has discussed that there are some issues with JDK1.7, and that Play does not officially support this yet. If possible, please try with JDK 6, and see if you still get this error.
If you are confined to JDK7, you can use the option
java.source=1.6
in your application.conf file.
Update 18th August 2011: Nicolas Leroux recently sent out a message on Twitter to say that Java 7 support had been added to Play in the master branch. It probably won't make the 1.2.3 release, but will make the release after that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With