Error creating bean with name 'defaultEmailService'
ariunbatb opened this issue · comments
Ariunbat Ulambayar commented
i just followed this tutorial and when i mvn clean install i got this error. But project runs without error and sending email
https://sanaulla.info/2017/09/15/using-gmail-as-smtp-server-from-java-spring-boot-apps/
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'defaultEmailService' defined in URL [jar:file:/C:/Users/Keaner/.m2/repository/it/ozimov/spring-boot-email-core/0.6.3/spring-boot-email-core-0.6.3.jar!/it/ozi
mov/springboot/mail/service/defaultimpl/DefaultEmailService.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframewor
k.mail.javamail.JavaMailSender' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.mail.javamail.JavaMailSender' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
Roberto Trunfio commented
Hi,
I do not know that tutorial. Have you tried our examples in the example folder? Which version of SpringBoot are you using?
Ariunbat Ulambayar commented
Spring boot version 2.0.4. This tutorial is same as example
Ariunbat Ulambayar commented
Full error
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'defaultEmailService' defined in URL [jar:file:/C:/Users/Keaner/.m2/repository/it/ozimov/spring-boot-email-core/0.6.3/spring-boot-email-core-0.6.3.jar!/it/ozi
mov/springboot/mail/service/defaultimpl/DefaultEmailService.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframewor
k.mail.javamail.JavaMailSender' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.mail.javamail.JavaMailSender' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
Ariunbat Ulambayar commented
Without any mail service just writing @EnableEmailTools in bootApplication gives error
Roberto Trunfio commented
Ok, because I have not found the time to upgrade to Spring Boot 2.0. So it won't work.