I got the following problem when trying to run my application. Have debugged everything and still nothing.
The IDE is finding the bean without any issue so I\'m very con
As per comment from mserioli the answer is that the bean must be declared in the configuration file being called at root.
In this case: Move
@Bean
public JavaMailSenderImpl mailSender()
to
public class ExtraConfig {
@Bean
public JavaMailSenderImpl mailSender() {
JavaMailSenderImpl javaMailSender = new JavaMailSenderImpl();
javaMailSender.setProtocol("SMTP");
javaMailSender.setHost("127.0.0.1");
javaMailSender.setPort(25);
return javaMailSender;
}
}
which is called in:
@Override
protected Class>[] getRootConfigClasses() {
return new Class>[]{ExtraConfig.class};
}
Thus solving the problem. Thanks guys for assistance.