Java ile Azure'da Postgres veritabanına bağlanılamıyor

Sep 23 2020

Aşağıdaki talimatları izleyerek Azure'da bir Postgres veritabanı oluşturdum https://docs.microsoft.com/en-us/azure/postgresql/connect-java. Artık veritabanına yerel PgAdmin'im aracılığıyla ve ayrıca psql. Ancak java kodumda (java 8) Hibernate (5.4.21 sürümü) ile bağlantı kurmaya çalıştığımda her zaman herhangi bir açıklama olmadan aşağıdaki hatayı alıyorum.

org.postgresql.util.PSQLException: The connection attempt failed.
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:315)
    at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:51)
    at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:225)
    at org.postgresql.Driver.makeConnection(Driver.java:465)
    at org.postgresql.Driver.connect(Driver.java:264)
    at java.sql.DriverManager.getConnection(DriverManager.java:664)
    at java.sql.DriverManager.getConnection(DriverManager.java:247)
    at test.ui.V9.main(V9.java:17)
Caused by: java.io.EOFException
    at org.postgresql.core.PGStream.receiveChar(PGStream.java:443)
    at org.postgresql.core.v3.ConnectionFactoryImpl.enableGSSEncrypted(ConnectionFactoryImpl.java:436)
    at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:144)
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:213)
    ... 7 more

Farklı SSL modu seçeneklerini denedim ama başarılı olamadım. Ayrıca Azure tarafından SSL'yi devre dışı bıraktım ama yine de başarılı olamadım. Birisi bu sorunu çözmeme yardım edebilir mi?

Yanıtlar

2 JacobStampeMikkelsen Sep 23 2020 at 20:57

42.2.15Sürücünün sürümüyle aynı sorunu yaşadık . Ayarlamayı dene

gssEncMode=disable

Daha fazla oku: https://gitmemory.com/issue/pgjdbc/pgjdbc/1868/683710515