简体   繁体   English

Glassfish中的JDBC连接池ping错误

[英]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. 我正在尝试在glassfish 5中为Microsoft SQL Server数据库创建一个jdbc连接池。 I am using the mssql-jdbc-6.2.2.jre8.jar and the latest SQLExpress server version (MSSQL14.SQLEXPRESS) 我正在使用mssql-jdbc-6.2.2.jre8.jar和最新的SQLExpress服务器版本(MSSQL14.SQLEXPRESS)

Resource Type: javax.sql.DataSource 资源类型: javax.sql.DataSource

Datasource Classname: com.microsoft.sqlserver.jdbc.SQLServerDataSource 数据源类名称: com.microsoft.sqlserver.jdbc.SQLServerDataSource

在此处输入图片说明 在此处输入图片说明 The connection pool is created successfully but when i try to ping, I get this error: 连接池创建成功,但是当我尝试ping时,出现此错误:

Ping Connection Pool failed for sql_tire_pool. 对sql_tire_pool进行Ping连接池失败。 Connection could not be allocated because: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. 无法分配连接,因为:驱动程序无法通过使用安全套接字层(SSL)加密建立到SQL Server的安全连接。 Error: "Unsupported curveId: 29". 错误:“不支持的curveId:29”。 ClientConnectionId:f86f1ef8-29c4-4e39-b112-f5da9cbfe13d Please check the server.log for more details. ClientConnectionId:f86f1ef8-29c4-4e39-b112-f5da9cbfe13d请查看server.log以获取更多详细信息。

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. [2017-10-11T10:55:11.747 + 0300] [glassfish 5.0] [警告] [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:为池[test_pool]创建未池化的[test]连接时发生异常,无法分配连接,原因是:驱动程序无法通过使用安全套接字层(SSL)加密建立与SQL Server的安全连接。 Error: "Unsupported curveId: 29". 错误:“不支持的curveId:29”。 ClientConnectionId:4c325981-4c97-4db2-b4fb-f7aafca4f03b]] 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. [2017-10-11T10:55:11.750 + 0300] [glassfish 5.0] [严重] [] [org.glassfish.admingui] [tid:_ThreadID = 51 _ThreadName = admin-listener(3)] [timeMillis:1507708511750] [ levelValue:1000] [[RestResponse.getResponse()给出失败。 endpoint = ' http://localhost:4848/management/domain/resources/ping-connection-pool.json '; 端点=' http:// localhost:4848 / management / domain / resources / ping-connection-pool.json '; attrs = '{id=test_pool}']] attrs ='{id = test_pool}']]

I am running Windows 10 and also everything is running locally (Glassfish installation, SQL server) 我正在运行Windows 10,并且一切都在本地运行(Glassfish安装,SQL Server)

UPDATE 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. 使用接受的答案的解决方案,该问题得到了部分解决。连接池现在可以成功ping数据库,但是当我的应用程序尝试通过jpa / hibernate运行查询时,我遇到了相同的问题,因为glassfish日志中引发了相同的错误。

Facing also this issue with Glassfish 5 on Windows 10 , disabling elliptic curves did the trick, just add: 面对Windows 10上的Glassfish 5这个问题,禁用椭圆曲线也可以解决问题,只需添加:

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

to glassfish JVM options and restart server. Glassfish JVM选项并重新启动服务器。 posted workaround on glassfish issue tracker to help them fix it quickly 在glassfish问题跟踪器上发布了变通办法,以帮助他们快速修复它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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