我正在嘗試在glassfish 5中爲Microsoft SQL Server數據庫創建jdbc連接池。我使用的是mssql-jdbc-6.2.2.jre8.jar
和最新的SQLExpress服務器版本(MSSQL14.SQLEXPRESS)Glassfish中的JDBC連接池ping錯誤
資源類型:javax.sql.DataSource
數據源類名稱:com.microsoft.sqlserver.jdbc.SQLServerDataSource
Ping Connection Pool failed for sql_tire_pool. Connection could not be allocated because: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "Unsupported curveId: 29". ClientConnectionId:f86f1ef8-29c4-4e39-b112-f5da9cbfe13d Please check the server.log for more details.
而這個我•服務器日誌:
[2017-10-11T10:55:11.747+0300] [glassfish 5.0] [WARNING] [test.connection.pool.failed] [javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors.service] [tid: _ThreadID=125 _ThreadName=admin-listener(7)] [timeMillis: 1507708511747] [levelValue: 900] [[ RAR8054: Exception while creating an unpooled [test] connection for pool [ test_pool ], Connection could not be allocated because: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "Unsupported curveId: 29". ClientConnectionId:4c325981-4c97-4db2-b4fb-f7aafca4f03b]]
[2017-10-11T10:55:11.750+0300] [glassfish 5.0] [SEVERE] [] [org.glassfish.admingui] [tid: _ThreadID=51 _ThreadName=admin-listener(3)] [timeMillis: 1507708511750] [levelValue: 1000] [[ RestResponse.getResponse() gives FAILURE. endpoint = ' http://localhost:4848/management/domain/resources/ping-connection-pool.json '; attrs = '{id=test_pool}']]
我運行Windows 10,也都在本地運行(GlassFish安裝,SQL服務器)
UPDATE
使用公認的答案的解決方案,問題是部分解決了。連接池現在成功地ping了數據庫,但是我遇到了同樣的問題,因爲當我的應用程序嘗試通過jpa/hibernate運行查詢時,在glassfish日誌中拋出了同樣的錯誤。
它看起來像[SSL對於Microsoft SQL Server是必需的](https://blogs.msdn.microsoft.com/jdbcteam/2008/09/09/the -driver-可以-未建立-A-安全連接到SQL服務器逐使用安全的套接字層的SSL加密/)。愚蠢的問題:你有沒有試過[啓用SSL](https://docs.microsoft.com/en-us/sql/connect/jdbc/connecting-with-ssl-encryption)配置? – Al1
其實我並沒有因爲此刻我不需要SSL ... 雖然我用連接到glassfish-4安裝的同樣的數據庫沒有問題。 – jenny
完全相同的問題在這裏(因爲這個,無法升級到GlassFish 5.0,儘管它在4.1.1上工作正常),你是否能夠修復這個問題? –