Spring bug解决方案

这是在实际过程中遇到的bug及解决方案

1. QQ邮件发送错误

在本地测试发送邮件没有问题,打包发送到服务器之后,无法发送邮件

问题:端口修改成465,出现错误spring boot Could not connect to SMTP host: smtp.xxx.com, port: 465, response: -1

参考spring boot Could not connect to SMTP host: smtp.xxx.com, port: 465, response: -1

解决:在properties配置中加上

spring.mail.properties.mail.smtp.ssl.enable=true

# 完整如下
spring.mail.host=smtp.qq.com
spring.mail.username=[email protected]
spring.mail.password=密码
spring.mail.protocol=smtp
spring.mail.properties.mail.smtp.port=465
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.ssl.enable=true
spring.mail.default-encoding=utf-8

2. 访问http://localhost:8080/druid需要用户名和密码

问题:使用druid监控,访问监控网页时,需要输入用户名和密码

解决:在application.properties中配置账号密码

spring.datasource.druid.stat-view-servlet.login-username=用户名
spring.datasource.druid.stat-view-servlet.login-password=密码

   转载规则


《Spring bug解决方案》 Mycroft Wong 采用 知识共享署名 4.0 国际许可协议 进行许可。
 上一篇
将阿里云作为git服务器 将阿里云作为git服务器
将阿里云作为git服务器前言本来一开始在研究,如何部署在github上的博客自动发布到aliyun上,这样就不用每次更新需要在aliyun服务器上进行一次pull操作 看了些使用git hook操作的文章,没有看到,很多都是一些步骤,也不说
2019-08-11
下一篇 
hexo添加category目录 hexo添加category目录
hexo添加category目录一开始我以为直接在配置文件_config.yml中去掉注释categories即可,这样是不对的,还需要手动建立categories目录 新建categories目录使用命令hexo new page cat
2019-08-09
  目录