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
Apache License 2.0
195 stars 95 forks source link

No qualifying bean of type 'it.ozimov.springboot.mail.service.EmailService' available #48

Closed ostenant closed 7 years ago

ostenant commented 7 years ago

WARN 6496 --- [ main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'simpleMimeEmailWithThymeleafApplication': Unsatisfied dependency expressed through field 'simpleThymeleafEmailService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'simpleThymeleafEmailService': Unsatisfied dependency expressed through field 'emailService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'it.ozimov.springboot.mail.service.EmailService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

robertotru commented 7 years ago

Hi, Generally speaking, trying to understand what goes wrong without knowing the version that bring the error and without having a look at the configuration of the main class and at the application.properties it's really complex.

In this case, I would suggest to have a look at the examples folder. There is an example that shows you how to autowire the service been

ostenant commented 7 years ago

The reason is that I forgot to add the @EnableEmailTools Annotation.

在 2017-04-05 20:05:04,"Roberto Trunfio" notifications@github.com 写道:

Hi, Generally speaking, trying to understand what goes wrong without knowing the version that bring the error and without having a look at the configuration of the main class and at the application.properties it's really complex.

In this case, I would suggest to have a look at the examples folder. There is an example that shows you how to autowire the service been

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

robertotru commented 7 years ago

Super! I'll close the issue then!