1、對項(xiàng)目進(jìn)行優(yōu)化實(shí)現(xiàn)讀寫分離,項(xiàng)目啟動時報錯如下:
Caused by: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
原因:javax.net.ssl.SSLHandshakeException:沒有適當(dāng)?shù)膮f(xié)議(協(xié)議被禁用或密碼套件不合適)
2、bug解決:
? ? 注意: useSSL=false和true的區(qū)別:
? ? ? ?SSL(Secure Sockets Layer 安全套接字協(xié)議),在mysql進(jìn)行連接的時候,如果mysql的版本是5.7之后的版本必須要加上useSSL=false,一般情況下都是使用useSSL=false,尤其是在將項(xiàng)目部署到linux上時,一定要使用useSSL=false?。?!,useSSL=true是進(jìn)行安全驗(yàn)證,一般通過證書或者令牌什么的,useSSL=false就是通過賬號密碼進(jìn)行連接,通常使用useSSL=false?。?!
url: jdbc:mysql://192.168.137.123:3306/FuturePlant?characterEncoding=utf-8&useSSL=false
?3、加上之后又出現(xiàn)以下錯誤
?
?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.
不鼓勵依賴循環(huán)引用,默認(rèn)情況下禁止使用循環(huán)引用。更新應(yīng)用程序以刪除 Bean 之間的依賴關(guān)系循環(huán)。作為最后的手段,可以通過將spring.main.allow-circular-references設(shè)置為true來自動打破循環(huán)。
出現(xiàn)了spring的循環(huán)依賴問題
在yaml文件中添加如下代碼
spring:
main:
allow-circular-references: true
4、兩個問題解決完后成功啟動文章來源:http://www.zghlxwxcb.cn/news/detail-767554.html
文章來源地址http://www.zghlxwxcb.cn/news/detail-767554.html
到了這里,關(guān)于java項(xiàng)目實(shí)現(xiàn)讀寫分離,項(xiàng)目連接Linux部署的數(shù)據(jù)庫異常javax.net.ssl.SSLHandshakeException: No appropriate protocol的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!