Activator Activator: "start" works, but "start" fails

I am working on a project using Java Play-framework. So far I have always tested it by executing ./activator run

which worked flawlessly. Now I wanted to try and deploy it by running ./activator start

. This throws a compilation error and I don't know why because the code seems to be fine.

Mistake:

[error] /home/ghijs/psopv/psopv-2015-groep13/Code/activator-CodeSubmission/app/helpers/Login.java:12: illegal cyclic reference involving method Login
[error] public class Login {
[error]              ^
[error] one error found
[error] (compile:doc) Scaladoc generation failed
[error] Total time: 16 s, completed Jun 4, 2015 2:02:31 PM

      

Login class:

package helpers;

import models.User;
import play.Logger;
import play.data.Form;
import play.data.validation.Constraints.MinLength;
import play.data.validation.Constraints.Required;

public class Login {

    @Required
    @MinLength(4)
    private String username;

    @Required
    @MinLength(5)
    private String password;

    private String userID;
    private User.UserType userType;

    public void Login(String usrnm, String psswrd){
        username = usrnm;
        password = psswrd;
    }

    public String getUsername()         {return username;}
    public String getPassword()         {return password;}
    public String getUserID()           {return userID;}
    public User.UserType getUserType()  {return userType;}

    public void setUsername(String u){username = u;}
    public void setPassword(String p){password = p;}


    public final static Form<Login> LOGIN_FORM = new Form(Login.class);

    public String validate(){
        Logger.info("Validating login info ...");
        User u = User.authenticate(username, password);
        if(u == null) {
            Logger.error("Invalid username or password.");
            return "Invalid user or password";
        }
        else {
            Logger.info("Validating login info ... OK");
            userID = u.getIdentifier();

            userType = u.getUserType();
            return null;
        }
    }
}

      

I need this because it is ./activator dist

throwing the same error and I need to be able to create a distribution version of the program.

+3


source to share


1 answer


public void Login(String usrnm, String psswrd){
    username = usrnm;
    password = psswrd;
}

      



This is not a constructor. Remove the keyword void

. Be aware that not having a default constructor for the form will result in runtime exceptions.

+3


source







All Articles