驱动程序无法通过使用安全套接字层(SSL)加密与 SQL Server 建立 安全连接。错误:“SQL Server 返回的响应不完整。连接已关闭

时间:2021-07-08 05:53:37

今天sqlserver2008 数据库由32位 换成 到64位 后启动tomcat 报如下错误,经调查是由于

bcprov-jdk14-128.jar 冲突导致的。特意记录下来。希望后面的人少走些弯路。



Caused by: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create Poolabl
eConnectionFactory (驱动程序无法通过使用安全套接字层(SSL)加密与 SQL Server 建立
安全连接。错误:“SQL Server 返回的响应不完整。连接已关闭。 ClientConnectionId:0c
9172b3-c4cf-4764-a620-8bb825c7c68d”。)
        at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDat
aSource.java:1225)
        at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSo
urce.java:880)
        at org.hibernate.connection.DatasourceConnectionProvider.getConnection(D
atasourceConnectionProvider.java:69)
        at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager
.java:423)
        ... 10 more
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: 驱动程序无法通过使用
安全套接字层(SSL)加密与 SQL Server 建立安全连接。错误:“SQL Server 返回的响应不
完整。连接已关闭。 ClientConnectionId:0c9172b3-c4cf-4764-a620-8bb825c7c68d”。
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerC
onnection.java:1667)
        at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1668)


        at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLSer
verConnection.java:1323)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConne
ction.java:991)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerCon
nection.java:827)
        at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.
java:1012)
        at org.apache.tomcat.dbcp.dbcp.DriverConnectionFactory.createConnection(
DriverConnectionFactory.java:38)
        at org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(Pool
ableConnectionFactory.java:294)
        at org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory
(BasicDataSource.java:1247)
        at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDat
aSource.java:1221)
        ... 13 more
Caused by: java.io.IOException: SQL Server 返回的响应不完整。连接已关闭。 Client
ConnectionId:0c9172b3-c4cf-4764-a620-8bb825c7c68d
        at com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream.ensur
eSSLPayload(IOBuffer.java:651)
        at com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream.readI
nternal(IOBuffer.java:708)
        at com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream.read(
IOBuffer.java:700)
        at com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream.readInternal
(IOBuffer.java:895)
        at com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream.read(IOBuffe
r.java:883)
        at com.sun.net.ssl.internal.ssl.InputRecord.readFully(InputRecord.java:2
93)
        at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:331)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.j
ava:789)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SS
LSocketImpl.java:1096)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketIm
pl.java:1123)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketIm
pl.java:1107)
        at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1618)


        ... 21 more
2013-11-05 11:08:47,812 ERROR - Job (DEFAULT.isValidJob threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exc
eption: org.hibernate.exception.GenericJDBCException: Cannot open connection]
        at org.quartz.core.JobRunShell.run(JobRunShell.java:214)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.j
ava:520)
* Nested Exception (Underlying Cause) ---------------
org.hibernate.exception.GenericJDBCException: Cannot open connection
        at org.hibernate.exception.SQLStateConverter.handledNonSpecificException
(SQLStateConverter.java:103)
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.j
ava:91)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelp
er.java:43)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelp
er.java:29)
        at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager
.java:426)
        at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.
java:144)
        at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:119)
        at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:
57)
        at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326
)
        at com.icss.ro.service.common.util.PersistenceUtil.getSession(Persistenc
eUtil.java:11)
        at com.icss.ro.gr.subscription.SubscriptionManager.isValid(Unknown Sourc
e)
        at com.icss.ro.gr.service.IsvalidService.isValid(Unknown Source)
        at com.icss.ro.gr.job.ISVALIDJob.execute(Unknown Source)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.j
ava:520)
Caused by: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create Poolabl
eConnectionFactory (驱动程序无法通过使用安全套接字层(SSL)加密与 SQL Server 建立
安全连接。错误:“SQL Server 返回的响应不完整。连接已关闭。 ClientConnectionId:0c
9172b3-c4cf-4764-a620-8bb825c7c68d”。)
        at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDat
aSource.java:1225)
        at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSo
urce.java:880)
        at org.hibernate.connection.DatasourceConnectionProvider.getConnection(D
atasourceConnectionProvider.java:69)
        at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager
.java:423)
        ... 10 more
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: 驱动程序无法通过使用
安全套接字层(SSL)加密与 SQL Server 建立安全连接。错误:“SQL Server 返回的响应不
完整。连接已关闭。 ClientConnectionId:0c9172b3-c4cf-4764-a620-8bb825c7c68d”。
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerC
onnection.java:1667)
        at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1668)


        at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLSer
verConnection.java:1323)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConne
ction.java:991)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerCon
nection.java:827)
        at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.
java:1012)
        at org.apache.tomcat.dbcp.dbcp.DriverConnectionFactory.createConnection(
DriverConnectionFactory.java:38)
        at org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(Pool
ableConnectionFactory.java:294)
        at org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory
(BasicDataSource.java:1247)
        at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDat
aSource.java:1221)
        ... 13 more
Caused by: java.io.IOException: SQL Server 返回的响应不完整。连接已关闭。 Client
ConnectionId:0c9172b3-c4cf-4764-a620-8bb825c7c68d
        at com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream.ensur
eSSLPayload(IOBuffer.java:651)
        at com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream.readI
nternal(IOBuffer.java:708)
        at com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream.read(
IOBuffer.java:700)
        at com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream.readInternal
(IOBuffer.java:895)
        at com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream.read(IOBuffe
r.java:883)
        at com.sun.net.ssl.internal.ssl.InputRecord.readFully(InputRecord.java:2
93)
        at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:331)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.j
ava:789)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SS
LSocketImpl.java:1096)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketIm
pl.java:1123)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketIm
pl.java:1107)
        at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1618)


        ... 21 more