简体   繁体   中英

JDBC connection pool ping error in Glassfish

I am trying to create a jdbc connection pool in glassfish 5 for a Microsoft SQL Server database. I am using the mssql-jdbc-6.2.2.jre8.jar and the latest SQLExpress server version (MSSQL14.SQLEXPRESS)

Resource Type: javax.sql.DataSource

Datasource Classname: com.microsoft.sqlserver.jdbc.SQLServerDataSource

在此处输入图片说明 在此处输入图片说明 The connection pool is created successfully but when i try to ping, I get this error:

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.

And this is the server log:

[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}']]

I am running Windows 10 and also everything is running locally (Glassfish installation, SQL server)

UPDATE

Using the accepted answer's solution, the problem is partially solved.The connection pool now successfuly pings the database, but I encounter the same problem as the same error is thrown in the glassfish log when my application tries to run a query through jpa/hibernate.

Facing also this issue with Glassfish 5 on Windows 10 , disabling elliptic curves did the trick, just add:

-Dcom.sun.net.ssl.enableECC=false

to glassfish JVM options and restart server. posted workaround on glassfish issue tracker to help them fix it quickly

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM