我正在用mysql编写一个简单的jdbc代码。一切正常,我可以通过select语句打印表中的记录。但是当我使用connection.close()关闭连接时,我得到了下面的异常。感谢您的帮助。
WARN: Caught while disconnecting...
EXCEPTION STACK TRACE:
**BEGIN NESTED EXCEPTION**
javax.net.ssl.SSLException
MESSAGE: closing inbound before receiving peer's close_notify
STACKTRACE:
javax.net.ssl.SSLException: closing inbound before receiving peer's close_notify
at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:129)
at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:117)
at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:308)
at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:264)
at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:255)
at java.base/sun.security.ssl.SSLSocketImpl.shutdownInput(SSLSocketImpl.java:645)
at java.base/sun.security.ssl.SSLSocketImpl.shutdownInput(SSLSocketImpl.java:624)
at com.mysql.cj.protocol.a.NativeProtocol.quit(NativeProtocol.java:1312)
at com.mysql.cj.NativeSession.quit(NativeSession.java:182)
at com.mysql.cj.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:1750)
at com.mysql.cj.jdbc.ConnectionImpl.close(ConnectionImpl.java:720)
at com.jdbc.Driver.display(Driver.java:27)
at com.jdbc.Driver.main(Driver.java:38)
1条答案
按热度按时间nmpmafwu1#
这是Java11上mysql驱动程序的一个问题https://bugs.mysql.com/bug.php?id=93590
这已在connector/j版本8.0.16中修复