Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VerifyError; Expecting a stack map frame in method controllers.Secure$Security.authentify

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).

like image 270
Robert de W Avatar asked Jul 15 '11 08:07

Robert de W


1 Answers

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.

like image 175
Codemwnci Avatar answered Oct 16 '22 03:10

Codemwnci