Vraptor task does not work

1

I'm having a problem with the vraptor task. I have a Vraptor 4 project created that is sending mail normally, but when I try to create a task it does not send email. See the task class

Controller

public class EntrevistaTask {

private final EmailJava email;

@Inject
public EntrevistaTask(EmailJava email){
this.email = email;
}

@Deprecated
public EntrevistaTask(){
this(null);
}

Scheduled(cron="0/30 * * * * ?")
public void avisoEntrevista() throws EmailException{
email.enviarEmail("[email protected]", "Nova vaga", "Vaga cadastrada com sucesso", "[email protected]");
}

}

Thanks to all who can help.

    
asked by anonymous 26.05.2016 / 02:36

1 answer

1

On line:

Scheduled(cron="0/30 * * * * ?")

You should put @, like this:

@Scheduled(cron="0/30 * * * * ?")

Considering that sending emails works normally, only this change should make your code work!

I hope I have helped,

    
26.05.2016 / 03:33