다중 db 를 연결하는 스프링 부트 프로젝트인데 db 정보를 3 개까지 연결할 때는 아무런 이상 없이 잘 도착했습니다.
근데 네번째 db 를 연결하는 순간 아래와 같은 에러가 발생했습니다.

java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
...
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
...
org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is org.hibernate.exception.JDBCConnectionException: Unable to acquire JDBC Connection
...
Caused by: java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
...
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
...
Caused by: javax.net.ssl.SSLException: Unsupported record version Unknown-0.0
뭐든지 다 (?) 잘 알고있는 chatGPT 에게 물어보니 아래와 같은 답변이 왔습니다.

구글링을 이것저것 해보니 결국은 Connection 문제와 db ssl 문제가 가장 많이 의심되고 있습니다.
테스트 성공
- 기존에 추가되어있던 db 에서 데이터 조회 성공

테스트 실패
- 추가한 db 에서 데이터 조회 실패 ( 특정 db 만 실패 )

java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.

아무튼 저는 useSSL=false 를 명시함으로써 해결했습니다. !!!
댓글