java项目实现读写分离,项目连接Linux部署的数据库异常javax.net.ssl.SSLHandshakeException: No appropriate protocol

1、对项目进行优化实现读写分离,项目启动时报错如下:

Caused by: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)

原因:javax.net.ssl.SSLHandshakeException:没有适当的协议(协议被禁用或密码套件不合适)

2、bug解决:

    注意: useSSL=false和true的区别:
       SSL(Secure Sockets Layer 安全套接字协议),在mysql进行连接的时候,如果mysql的版本是5.7之后的版本必须要加上useSSL=false,一般情况下都是使用useSSL=false,尤其是在将项目部署到linux上时,一定要使用useSSL=false!!!,useSSL=true是进行安全验证,一般通过证书或者令牌什么的,useSSL=false就是通过账号密码进行连接,通常使用useSSL=false!!!

    url: jdbc:mysql://192.168.137.123:3306/FuturePlant?characterEncoding=utf-8&useSSL=false

 3、加上之后又出现以下错误

 

 Relying upon circular references is discouraged and they are prohibited by default. Update your application to remove the dependency cycle between beans. As a last resort, it may be possible to break the cycle automatically by setting spring.main.allow-circular-references to true.

不鼓励依赖循环引用,默认情况下禁止使用循环引用。更新应用程序以删除 Bean 之间的依赖关系循环。作为最后的手段,可以通过将spring.main.allow-circular-references设置为true来自动打破循环。

出现了spring的循环依赖问题

在yaml文件中添加如下代码

spring:
  main:
    allow-circular-references: true

4、两个问题解决完后成功启动

版权声明:本文为博主作者:喔的 喔的嘛呀原创文章,版权归属原作者,如果侵权,请联系我们删除!

原文链接:https://blog.csdn.net/2201_75809246/article/details/135184674

共计人评分,平均

到目前为止还没有投票!成为第一位评论此文章。

(0)
xiaoxingxing的头像xiaoxingxing管理团队
上一篇 2024年1月8日
下一篇 2024年1月8日

相关推荐