Vraptor task does not work

Asked

Viewed 104 times

1

I’m having a problem with the vraptor task. I have a Vraptor 4 project created that is sending email 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]");
}

}

Thank you to all who can help.

1 answer

1

On the line:

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

You should put @this way:

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

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

I hope I’ve helped,

Browser other questions tagged

You are not signed in. Login or sign up in order to post.