首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用spring-boot-starter-mail后出现“应用程序无法启动”

使用spring-boot-starter-mail后出现“应用程序无法启动”
EN

Stack Overflow用户
提问于 2019-10-23 06:16:33
回答 1查看 723关注 0票数 1

想要实现基于spring-boot-starter-mail的简单邮件发送器解决方案,添加依赖项和设置属性后,我尝试运行应用程序,发现出现错误。我认为值得注意的是,我不是,也不是要实现Spring Cloud。只有邮件服务。我不明白为什么spring boot需要来自这些包的一些服务。

尝试了不同版本的依赖,定义了一些@Bean,但我不认为这是问题所在

代码语言:javascript
复制
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-mail</artifactId>
            <version>2.0.1.RELEASE</version>
        </dependency>

日志:

代码语言:javascript
复制
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-10-23 00:07:05.752 ERROR 19576 --- [  restartedMain] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Parameter 1 of method mailNotifier in de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$MailNotifierConfiguration required a bean of type 'de.codecentric.boot.admin.server.domain.entities.InstanceRepository' that could not be found.

The following candidates were found but could not be injected:
    - Bean method 'instanceRepository' in 'AdminServerAutoConfiguration' not loaded because @ConditionalOnBean (types: de.codecentric.boot.admin.server.config.AdminServerMarkerConfiguration$Marker; SearchStrategy: all) did not find any beans of type de.codecentric.boot.admin.server.config.AdminServerMarkerConfiguration$Marker


Action:

Consider revisiting the entries above or defining a bean of type 'de.codecentric.boot.admin.server.domain.entities.InstanceRepository' in your configuration.

只想通过smtp.gmail.com发送电子邮件希望spring-boot-starter-mail就足够了。

谢谢!

EN

回答 1

Stack Overflow用户

发布于 2019-10-24 19:21:17

正如LHCHIN评论的那样,这是<dependencyManagement/>中的spring-boot-admin-starter-serverspring-boot-admin-dependencies的问题

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58512973

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档