ozimov / spring-boot-email-tools

A set of services and tools for sending emails in a Spring Boot 1.5.x application using a Template Engine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error creating bean with name 'defaultEmailService'

ariunbatb opened this issue · comments

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: {}


Hi,

I do not know that tutorial. Have you tried our examples in the example folder? Which version of SpringBoot are you using?

Spring boot version 2.0.4. This tutorial is same as example

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: {}

Without any mail service just writing @EnableEmailTools in bootApplication gives error

Ok, because I have not found the time to upgrade to Spring Boot 2.0. So it won't work.