Вы не должны смешивать использование нового с Autowired.
Как только вы используете новое ключевое слово, вы ломаете все инъекции, используемые с @Autowired (это означает, что MorningService и NightService не будут инициализировано), поэтому вы получаете NPE.
Soulution №1
используйте AUTOWIRE
@Autowired
public MorningService ms;
@Autowired
public NightService ns;
@Autowired
GenerateMessage gm;
@RequestMapping(path = "/test")
public String starter(){
// GenerateMessage gm=new GenerateMessage();
ns.mesage(); // this call working fine
gm.mes();
return "Mail scheduled.";
}
Решение № 2
использование это ключевое слово
@RequestMapping(path = "/test")
public String starter(){
// GenerateMessage gm=new GenerateMessage();
ns.mesage(); // this call working fine
this.mes();
return "Mail scheduled.";
}